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. الخصائص التالية متاحة في كل كائن خيارات.
| Enumerations | Enumerations | Enumerations |
|---|---|---|
file_format | `FileFormat | None` |
encoding | `str | None` |
file_system | `FileSystem | None` |
lookup_paths | list[str] | مجلدات إضافية للبحث عند حل المراجع الخارجية |
file_name | `str | None` |
LoadOptions
الفئة الأساسية لجميع كائنات خيارات التحميل.
خاصية إضافية (ما وراء IOConfig):
| Enumerations | Enumerations | Enumerations |
|---|---|---|
encoding | `str | None` |
SaveOptions
الفئة الأساسية لجميع كائنات خيارات الحفظ.
خاصية إضافية (ما وراء IOConfig):
| Enumerations | Enumerations | Enumerations |
|---|---|---|
export_textures | bool | Enumerations 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)| Enumerations | Enumerations | Enumerations | Enumerations |
|---|---|---|---|
flip_coordinate_system | bool | False | عكس نظام الإحداثيات عند الاستيراد |
enable_materials | bool | True | تحميل المرفق .mtl ملف مادة |
scale | float | 1.0 | المقياس الموحد يُطبق على جميع الهندسة المستوردة |
normalize_normal | bool | True | تطبيع المتجهات العادية المستوردة إلى طول وحدة |
ObjSaveOptions
مرجع فئة GlobalTransform.
from aspose.threed.formats import ObjSaveOptions
opts = ObjSaveOptions()
opts.enable_materials = False
scene.save("output.obj", opts)| Enumerations | Enumerations | Enumerations | Enumerations |
|---|---|---|---|
apply_unit_scale | bool | False | تطبيق عامل مقياس الوحدة للمشهد على الإحداثيات المصدرة |
point_cloud | bool | False | تصدير الرؤوس فقط (بدون أوجه مضلعة) |
verbose | bool | False | إدراج تعليقات OBJ إضافية في الناتج |
serialize_w | bool | False | كتابة المكوّن W لنقاط التحكم |
enable_materials | bool | True | اكتب .mtl ملف مادة وإحاله من .obj |
flip_coordinate_system | bool | False | عكس نظام الإحداثيات عند التصدير |
axis_system | `AxisSystem | None` | 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)| Enumerations | Enumerations | Enumerations | Enumerations |
|---|---|---|---|
flip_tex_coord_v | bool | True | عكس إحداثيات القوام 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)| Enumerations | Enumerations | Enumerations | Enumerations |
|---|---|---|---|
binary_mode | bool | False | Enumerations True, يكتب ملف GLB ثنائي مستقل؛ عندما False, يكتب JSON .gltf مع مخزن خارجي |
flip_tex_coord_v | bool | True | عكس إحداثيات القوام V عند التصدير |
export_textures | bool | False | نسخ القوامات المشار إليها إلى حزمة الإخراج (موروثة من 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)| Enumerations | Enumerations | Enumerations | Enumerations |
|---|---|---|---|
flip_coordinate_system | bool | False | عكس نظام الإحداثيات عند الاستيراد |
scale | float | 1.0 | تطبيق مقياس موحد على الهندسة المستوردة |
StlSaveOptions
خيارات الحفظ لإخراج STL.
from aspose.threed.formats import StlSaveOptions
opts = StlSaveOptions()
opts.binary_mode = True
scene.save("output.stl", opts)| Enumerations | Enumerations | Enumerations | Enumerations |
|---|---|---|---|
flip_coordinate_system | bool | False | عكس نظام الإحداثيات عند التصدير |
scale | float | 1.0 | تطبيق مقياس موحد على الهندسة المصدرة |
binary_mode | bool | False | اكتب 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)| Enumerations | Enumerations | Enumerations | Enumerations |
|---|---|---|---|
keep_builtin_global_settings | bool | False | حافظ على FBX GlobalSettings الخصائص في معلومات أصول المشهد |
compatible_mode | bool | False | تمكين وضع التوافق لملفات FBX من أدوات التأليف القديمة |
FbxSaveOptions
خيارات الحفظ لإخراج FBX.
from aspose.threed.formats import FbxSaveOptions
opts = FbxSaveOptions()
opts.enable_compression = False
scene.save("output.fbx", opts)| Enumerations | Enumerations | Enumerations | Enumerations |
|---|---|---|---|
export_textures | bool | False | نسخ القواميس المشار إليها إلى دليل الإخراج |
reuse_primitive_mesh | bool | False | إزالة التكرار للهندسة المتطابقة للشبكة في الإخراج |
enable_compression | bool | True | تمكين ضغط داخلي ثنائي لـ FBX |
fold_repeated_curve_data | Enumerations | None | دمج مقاطع منحنى الرسوم المتحركة المتطابقة |
export_legacy_material_properties | bool | True | تضمين النسخة القديمة Phong/Lambert عقد خصائص المادة للتوافق |
video_for_texture | bool | False | تضمين بيانات القوام في عقد فيديو FBX |
embed_textures | bool | False | تضمين ملفات القوام مضمَّنة داخل الثنائي FBX |
generate_vertex_element_material | bool | False | أضف VertexElementMaterial طبقة لتعيين المادة لكل مضلع |
ColladaLoadOptions
خيارات التحميل لملفات COLLADA (.dae).
from aspose.threed.formats import ColladaLoadOptions
opts = ColladaLoadOptions()
opts.scale = 0.01
scene = Scene()
scene.open("model.dae", opts)| Enumerations | Enumerations | Enumerations | Enumerations |
|---|---|---|---|
flip_coordinate_system | bool | False | عكس نظام الإحداثيات عند الاستيراد |
enable_materials | bool | True | استيراد تعريفات المواد في COLLADA |
scale | float | 1.0 | تطبيق مقياس موحد على الهندسة المستوردة |
normalize_normal | bool | True | تطبيع المتجهات العمودية المستوردة |
ColladaSaveOptions
خيارات الحفظ لإخراج COLLADA.
from aspose.threed.formats import ColladaSaveOptions
opts = ColladaSaveOptions()
opts.indented = False # compact output
scene.save("output.dae", opts)| Enumerations | Enumerations | Enumerations | Enumerations |
|---|---|---|---|
flip_coordinate_system | bool | False | عكس نظام الإحداثيات عند التصدير |
enable_materials | bool | True | كتابة تعريفات المواد في COLLADA |
indented | bool | True | تنسيق مخرجات 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 على التوالي. لا توجد خصائص إضافية خاصة بالتنسيق موثقة للإصدار الحالي من البرمجيات المفتوحة المصدر.