Load and Save Options — Aspose.3D FOSS for Python API Reference

Enumerations

جميع عمليات الاستيراد والتصدير تقبل كائن خيارات اختياري مشتق من LoadOptions أو SaveOptions. مرّر الفئة الفرعية المناسبة إلى Scene.open() أو Scene.save() للتحكم في السلوك الخاص بالتنسيق.

Enumerations: aspose.threed.formats

from aspose.threed.formats import (
    LoadOptions, SaveOptions,
    ObjLoadOptions, ObjSaveOptions,
    GltfLoadOptions, GltfSaveOptions,
    StlLoadOptions, StlSaveOptions,
    FbxLoadOptions, FbxSaveOptions,
    ColladaLoadOptions, ColladaSaveOptions,
    ThreeMfLoadOptions, ThreeMfSaveOptions,
)

Enumerations

Enumerations LoadOptions و SaveOptions ترث من IOConfig. الخصائص التالية متاحة في كل كائن خيارات.

EnumerationsEnumerationsEnumerations
file_format`FileFormatNone`
encoding`strNone`
file_system`FileSystemNone`
lookup_pathslist[str]مجلدات إضافية للبحث عند حل المراجع الخارجية
file_name`strNone`

LoadOptions

الفئة الأساسية لجميع كائنات خيارات التحميل.

خاصية إضافية (ما وراء IOConfig):

EnumerationsEnumerationsEnumerations
encoding`strNone`

SaveOptions

الفئة الأساسية لجميع كائنات خيارات الحفظ.

خاصية إضافية (ما وراء IOConfig):

EnumerationsEnumerationsEnumerations
export_texturesboolEnumerations True,، يتم نسخ القوام المشار إليها في المشهد إلى المخرجات. القيمة الافتراضية هي False

ObjLoadOptions

خيارات التحميل لملفات Wavefront OBJ (.obj).

from aspose.threed.formats import ObjLoadOptions
opts = ObjLoadOptions()
opts.flip_coordinate_system = True
opts.scale = 0.01
scene = Scene()
scene.open("model.obj", opts)
EnumerationsEnumerationsEnumerationsEnumerations
flip_coordinate_systemboolFalseعكس نظام الإحداثيات عند الاستيراد
enable_materialsboolTrueتحميل المرفق .mtl ملف مادة
scalefloat1.0المقياس الموحد يُطبق على جميع الهندسة المستوردة
normalize_normalboolTrueتطبيع المتجهات العادية المستوردة إلى طول وحدة

ObjSaveOptions

مرجع فئة GlobalTransform.

from aspose.threed.formats import ObjSaveOptions
opts = ObjSaveOptions()
opts.enable_materials = False
scene.save("output.obj", opts)
EnumerationsEnumerationsEnumerationsEnumerations
apply_unit_scaleboolFalseتطبيق عامل مقياس الوحدة للمشهد على الإحداثيات المصدرة
point_cloudboolFalseتصدير الرؤوس فقط (بدون أوجه مضلعة)
verboseboolFalseإدراج تعليقات OBJ إضافية في الناتج
serialize_wboolFalseكتابة المكوّن W لنقاط التحكم
enable_materialsboolTrueاكتب .mtl ملف مادة وإحاله من .obj
flip_coordinate_systemboolFalseعكس نظام الإحداثيات عند التصدير
axis_system`AxisSystemNone`None

GltfLoadOptions

خيارات التحميل لملفات glTF 2.0 و GLB (.gltf, .glb).

from aspose.threed.formats import GltfLoadOptions
opts = GltfLoadOptions()
opts.flip_tex_coord_v = False
scene = Scene()
scene.open("model.gltf", opts)
EnumerationsEnumerationsEnumerationsEnumerations
flip_tex_coord_vboolTrueعكس إحداثيات القوام V عند الاستيراد (glTF يستخدم الأصل أعلى اليسار; True يتحول إلى أسفل اليسار)

GltfSaveOptions

خيارات الحفظ لإخراج glTF 2.0.

from aspose.threed.formats import GltfSaveOptions
opts = GltfSaveOptions()
opts.binary_mode = True   # produce a .glb file
scene.save("output.glb", opts)
EnumerationsEnumerationsEnumerationsEnumerations
binary_modeboolFalseEnumerations True, يكتب ملف GLB ثنائي مستقل؛ عندما False, يكتب JSON .gltf مع مخزن خارجي
flip_tex_coord_vboolTrueعكس إحداثيات القوام V عند التصدير
export_texturesboolFalseنسخ القوامات المشار إليها إلى حزمة الإخراج (موروثة من SaveOptions)

StlLoadOptions

خيارات التحميل لملفات STL (.stl).

from aspose.threed.formats import StlLoadOptions
opts = StlLoadOptions()
opts.scale = 0.001   # convert millimetres to metres
scene = Scene()
scene.open("part.stl", opts)
EnumerationsEnumerationsEnumerationsEnumerations
flip_coordinate_systemboolFalseعكس نظام الإحداثيات عند الاستيراد
scalefloat1.0تطبيق مقياس موحد على الهندسة المستوردة

StlSaveOptions

خيارات الحفظ لإخراج STL.

from aspose.threed.formats import StlSaveOptions
opts = StlSaveOptions()
opts.binary_mode = True
scene.save("output.stl", opts)
EnumerationsEnumerationsEnumerationsEnumerations
flip_coordinate_systemboolFalseعكس نظام الإحداثيات عند التصدير
scalefloat1.0تطبيق مقياس موحد على الهندسة المصدرة
binary_modeboolFalseاكتب STL ثنائي بدلاً من STL ASCII

FbxLoadOptions

خيارات التحميل لملفات FBX (.fbx).

from aspose.threed.formats import FbxLoadOptions
opts = FbxLoadOptions()
opts.keep_builtin_global_settings = True
scene = Scene()
scene.open("animation.fbx", opts)
EnumerationsEnumerationsEnumerationsEnumerations
keep_builtin_global_settingsboolFalseحافظ على FBX GlobalSettings الخصائص في معلومات أصول المشهد
compatible_modeboolFalseتمكين وضع التوافق لملفات FBX من أدوات التأليف القديمة

FbxSaveOptions

خيارات الحفظ لإخراج FBX.

from aspose.threed.formats import FbxSaveOptions
opts = FbxSaveOptions()
opts.enable_compression = False
scene.save("output.fbx", opts)
EnumerationsEnumerationsEnumerationsEnumerations
export_texturesboolFalseنسخ القواميس المشار إليها إلى دليل الإخراج
reuse_primitive_meshboolFalseإزالة التكرار للهندسة المتطابقة للشبكة في الإخراج
enable_compressionboolTrueتمكين ضغط داخلي ثنائي لـ FBX
fold_repeated_curve_dataEnumerationsNoneدمج مقاطع منحنى الرسوم المتحركة المتطابقة
export_legacy_material_propertiesboolTrueتضمين النسخة القديمة Phong/Lambert عقد خصائص المادة للتوافق
video_for_textureboolFalseتضمين بيانات القوام في عقد فيديو FBX
embed_texturesboolFalseتضمين ملفات القوام مضمَّنة داخل الثنائي FBX
generate_vertex_element_materialboolFalseأضف VertexElementMaterial طبقة لتعيين المادة لكل مضلع

ColladaLoadOptions

خيارات التحميل لملفات COLLADA (.dae).

from aspose.threed.formats import ColladaLoadOptions
opts = ColladaLoadOptions()
opts.scale = 0.01
scene = Scene()
scene.open("model.dae", opts)
EnumerationsEnumerationsEnumerationsEnumerations
flip_coordinate_systemboolFalseعكس نظام الإحداثيات عند الاستيراد
enable_materialsboolTrueاستيراد تعريفات المواد في COLLADA
scalefloat1.0تطبيق مقياس موحد على الهندسة المستوردة
normalize_normalboolTrueتطبيع المتجهات العمودية المستوردة

ColladaSaveOptions

خيارات الحفظ لإخراج COLLADA.

from aspose.threed.formats import ColladaSaveOptions
opts = ColladaSaveOptions()
opts.indented = False   # compact output
scene.save("output.dae", opts)
EnumerationsEnumerationsEnumerationsEnumerations
flip_coordinate_systemboolFalseعكس نظام الإحداثيات عند التصدير
enable_materialsboolTrueكتابة تعريفات المواد في COLLADA
indentedboolTrueتنسيق مخرجات XML بشكل جميل مع المسافات البادئة

ThreeMfLoadOptions / ThreeMfSaveOptions

خيارات التحميل والحفظ لملفات 3MF (.3mf).

from aspose.threed.formats import ThreeMfLoadOptions, ThreeMfSaveOptions

# Load
load_opts = ThreeMfLoadOptions()
scene = Scene()
scene.open("part.3mf", load_opts)

# Save
save_opts = ThreeMfSaveOptions()
scene.save("output.3mf", save_opts)

هذه الفئات ترث الخصائص الأساسية من LoadOptions / SaveOptions على التوالي. لا توجد خصائص إضافية خاصة بالتنسيق موثقة للإصدار الحالي من البرمجيات المفتوحة المصدر.


انظر أيضًا

 العربية