Load and Save Options — Aspose.3D FOSS for Python API Reference
ColladaSaveOptions
Toate operaţiunile de import şi export acceptă un obiect opţional de opţiuni derivat din LoadOptions sau SaveOptions. Transmite subclasa corespunzătoare către Scene.open() sau Scene.save() pentru a controla comportamentul specific formatului.
ColladaSaveOptions: aspose.threed.formats
from aspose.threed.formats import (
LoadOptions, SaveOptions,
ObjLoadOptions, ObjSaveOptions,
GltfLoadOptions, GltfSaveOptions,
StlLoadOptions, StlSaveOptions,
FbxLoadOptions, FbxSaveOptions,
ColladaLoadOptions, ColladaSaveOptions,
ThreeMfLoadOptions, ThreeMfSaveOptions,
)ColladaSaveOptions
ColladaSaveOptions LoadOptions și SaveOptions moştenesc de la IOConfig. Proprietăţile următoare sunt disponibile în fiecare obiect de opţiuni.
| ColladaSaveOptions | ColladaSaveOptions | ColladaSaveOptions |
|---|---|---|
file_format | `FileFormat | None` |
encoding | `str | None` |
file_system | `FileSystem | None` |
lookup_paths | list[str] | Directoare suplimentare de căutat la rezolvarea referințelor externe |
file_name | `str | None` |
LoadOptions
Clasa de bază pentru toate obiectele de opțiuni de încărcare.
Proprietate suplimentară (dincolo de IOConfig):
| ColladaSaveOptions | ColladaSaveOptions | ColladaSaveOptions |
|---|---|---|
encoding | `str | None` |
SaveOptions
Clasa de bază pentru toate obiectele de opțiuni de salvare.
Proprietate suplimentară (dincolo de IOConfig):
| ColladaSaveOptions | ColladaSaveOptions | ColladaSaveOptions |
|---|---|---|
export_textures | bool | ColladaSaveOptions True, texturile referențiate de scenă sunt copiate în ieșire. Implicit este False |
ObjLoadOptions
Opțiuni de încărcare pentru fișiere 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)| ColladaSaveOptions | ColladaSaveOptions | ColladaSaveOptions | ColladaSaveOptions |
|---|---|---|---|
flip_coordinate_system | bool | False | Inversează sistemul de coordonate la import |
enable_materials | bool | True | Încarcă fișierul asociat .mtl fișier de material |
scale | float | 1.0 | Scalare uniformă aplicată tuturor geometriei importate |
normalize_normal | bool | True | Normalizează vectorii normali importați la lungime unitară |
ObjSaveOptions
Opțiuni de salvare pentru fișiere Wavefront OBJ.
from aspose.threed.formats import ObjSaveOptions
opts = ObjSaveOptions()
opts.enable_materials = False
scene.save("output.obj", opts)| ColladaSaveOptions | ColladaSaveOptions | ColladaSaveOptions | ColladaSaveOptions |
|---|---|---|---|
apply_unit_scale | bool | False | Aplică factorul de scară unitate al scenei la coordonatele exportate |
point_cloud | bool | False | Exportă doar vârfurile (fără fețe poligonale) |
verbose | bool | False | Include comentarii suplimentare OBJ în ieșire |
serialize_w | bool | False | Scrie componenta W a punctelor de control |
enable_materials | bool | True | Scrie un .mtl fișier de material și referențiază-l din .obj |
flip_coordinate_system | bool | False | Inversează sistemul de coordonate la export |
axis_system | `AxisSystem | None` | None |
GltfLoadOptions
Opțiuni de încărcare pentru fișiere glTF 2.0 și GLB (.gltf, .glb).
from aspose.threed.formats import GltfLoadOptions
opts = GltfLoadOptions()
opts.flip_tex_coord_v = False
scene = Scene()
scene.open("model.gltf", opts)| ColladaSaveOptions | ColladaSaveOptions | ColladaSaveOptions | ColladaSaveOptions |
|---|---|---|---|
flip_tex_coord_v | bool | True | Inversează coordonatele de textură V la import (glTF folosește origine în colțul din stânga sus; True convertește la colțul din stânga-jos) |
GltfSaveOptions
Opțiuni de salvare pentru ieșirea glTF 2.0.
from aspose.threed.formats import GltfSaveOptions
opts = GltfSaveOptions()
opts.binary_mode = True # produce a .glb file
scene.save("output.glb", opts)| ColladaSaveOptions | ColladaSaveOptions | ColladaSaveOptions | ColladaSaveOptions |
|---|---|---|---|
binary_mode | bool | False | ColladaSaveOptions True, scrie un GLB binar autonom; când False, scrie JSON .gltf cu un buffer extern |
flip_tex_coord_v | bool | True | Inversează coordonatele de textură V la export |
export_textures | bool | False | Copiază texturile referențiate în pachetul de ieșire (moștenit de la SaveOptions) |
StlLoadOptions
Încarcă opțiuni pentru fișiere 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)| ColladaSaveOptions | ColladaSaveOptions | ColladaSaveOptions | ColladaSaveOptions |
|---|---|---|---|
flip_coordinate_system | bool | False | Inversează sistemul de coordonate la import |
scale | float | 1.0 | Scalare uniformă aplicată geometriei importate |
StlSaveOptions
Opțiuni de salvare pentru ieșirea STL.
from aspose.threed.formats import StlSaveOptions
opts = StlSaveOptions()
opts.binary_mode = True
scene.save("output.stl", opts)| ColladaSaveOptions | ColladaSaveOptions | ColladaSaveOptions | ColladaSaveOptions |
|---|---|---|---|
flip_coordinate_system | bool | False | Inversează sistemul de coordonate la export |
scale | float | 1.0 | Scalare uniformă aplicată geometriei exportate |
binary_mode | bool | False | Scrie STL binar în loc de STL ASCII |
FbxLoadOptions
Încarcă opțiuni pentru fișiere FBX (.fbx).
from aspose.threed.formats import FbxLoadOptions
opts = FbxLoadOptions()
opts.keep_builtin_global_settings = True
scene = Scene()
scene.open("animation.fbx", opts)| ColladaSaveOptions | ColladaSaveOptions | ColladaSaveOptions | ColladaSaveOptions |
|---|---|---|---|
keep_builtin_global_settings | bool | False | Păstrează FBX GlobalSettings proprietăți în informațiile activului scenei |
compatible_mode | bool | False | Activează modul de compatibilitate pentru fișiere FBX provenite din instrumente de authoring mai vechi |
FbxSaveOptions
Opțiuni de salvare pentru ieșirea FBX.
from aspose.threed.formats import FbxSaveOptions
opts = FbxSaveOptions()
opts.enable_compression = False
scene.save("output.fbx", opts)| ColladaSaveOptions | ColladaSaveOptions | ColladaSaveOptions | ColladaSaveOptions |
|---|---|---|---|
export_textures | bool | False | Copiază texturile referențiate în directorul de ieșire |
reuse_primitive_mesh | bool | False | Elimină duplicatele geometriei de mesh identice în ieșire |
enable_compression | bool | True | Activează compresia internă binară FBX |
fold_repeated_curve_data | ColladaSaveOptions | None | Îmbină segmentele de curbă de animație identice |
export_legacy_material_properties | bool | True | Include moștenire Phong/Lambert noduri de proprietate a materialului pentru compatibilitate |
video_for_texture | bool | False | Încorporează datele de textură în nodurile video FBX |
embed_textures | bool | False | Încorporează fișierele de textură în linie în binarul FBX |
generate_vertex_element_material | bool | False | Adaugă un VertexElementMaterial strat pentru atribuirea materialului pe fiecare poligon |
ColladaLoadOptions
Opțiuni de încărcare pentru fișierele COLLADA (.dae).
from aspose.threed.formats import ColladaLoadOptions
opts = ColladaLoadOptions()
opts.scale = 0.01
scene = Scene()
scene.open("model.dae", opts)| ColladaSaveOptions | ColladaSaveOptions | ColladaSaveOptions | ColladaSaveOptions |
|---|---|---|---|
flip_coordinate_system | bool | False | Inversează sistemul de coordonate la import |
enable_materials | bool | True | Importă definițiile de material COLLADA |
scale | float | 1.0 | Scalare uniformă aplicată geometriei importate |
normalize_normal | bool | True | Normalizează vectorii normali importați |
ColladaSaveOptions
Opțiuni de salvare pentru ieșirea COLLADA.
from aspose.threed.formats import ColladaSaveOptions
opts = ColladaSaveOptions()
opts.indented = False # compact output
scene.save("output.dae", opts)| ColladaSaveOptions | ColladaSaveOptions | ColladaSaveOptions | ColladaSaveOptions |
|---|---|---|---|
flip_coordinate_system | bool | False | Inversează sistemul de coordonate la export |
enable_materials | bool | True | Scrie definițiile de material COLLADA |
indented | bool | True | Formatează frumos ieșirea XML cu indentare |
ThreeMfLoadOptions / ThreeMfSaveOptions
Opțiuni de încărcare și salvare pentru fișiere 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)Aceste clase moștenesc proprietățile de bază de la LoadOptions / SaveOptions respectiv. Nu există proprietăți suplimentare specifice formatului documentate pentru versiunea curentă FOSS.