Load and Save Options — Aspose.3D FOSS for Python API Reference
Enumerations
Alle import- og eksportoperationer accepterer et valgfrit options-objekt afledt fra LoadOptions eller SaveOptions. Videregiv den passende underklasse til Scene.open() eller Scene.save() for at styre format-specifik adfærd.
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 og SaveOptions arver fra IOConfig. Følgende egenskaber er tilgængelige på hvert options-objekt.
| Enumerations | Enumerations | Enumerations |
|---|---|---|
file_format | `FileFormat | None` |
encoding | `str | None` |
file_system | `FileSystem | None` |
lookup_paths | list[str] | Yderligere mapper, der skal søges i, når eksterne referencer løses |
file_name | `str | None` |
LoadOptions
Basisklasse for alle load‑option‑objekter.
Yderligere egenskab (ud over IOConfig):
| Enumerations | Enumerations | Enumerations |
|---|---|---|
encoding | `str | None` |
SaveOptions
Basisklasse for alle save‑option‑objekter.
Yderligere egenskab (ud over IOConfig):
| Enumerations | Enumerations | Enumerations |
|---|---|---|
export_textures | bool | Enumerations True, teksturer, der refereres til af scenen, kopieres til outputtet. Standard er False |
ObjLoadOptions
Indlæsningsindstillinger for Wavefront OBJ-filer (.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 | Vend koordinatsystemet ved import |
enable_materials | bool | True | Indlæs den tilhørende .mtl materialfil |
scale | float | 1.0 | Ensartet skalering anvendt på al importeret geometri |
normalize_normal | bool | True | Normaliser importerede normalvektorer til enhedslængde |
ObjSaveOptions
Save‑options for Wavefront OBJ‑filer.
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 | Anvend scenens enhedsskalafaktor på eksporterede koordinater |
point_cloud | bool | False | Eksporter kun vertexer (ingen polygonflader) |
verbose | bool | False | Inkluder yderligere OBJ-kommentarer i outputtet |
serialize_w | bool | False | Skriv W-komponenten af kontrolpunkter |
enable_materials | bool | True | Skriv en .mtl materialfil og referer til den fra .obj |
flip_coordinate_system | bool | False | Vend koordinatsystemet ved eksport |
axis_system | `AxisSystem | None` | None |
GltfLoadOptions
Indlæsningsindstillinger for glTF 2.0 og GLB-filer (.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 | Vend V-teksturkoordinater ved import (glTF bruger øverste‑venstre oprindelse; True konverterer til nederste‑venstre) |
GltfSaveOptions
Save‑options for glTF 2.0‑output.
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, skriver en selvstændig binær GLB; når False, skriver JSON .gltf med en ekstern buffer |
flip_tex_coord_v | bool | True | Vend V-teksturkoordinater ved eksport |
export_textures | bool | False | Kopier refererede teksturer ind i outputpakken (arvet fra SaveOptions) |
StlLoadOptions
Indlæsningsindstillinger for STL-filer (.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 | Vend koordinatsystemet ved import |
scale | float | 1.0 | Ensartet skalering anvendt på importeret geometri |
StlSaveOptions
Gemmeindstillinger for STL-output.
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 | Vend koordinatsystemet ved eksport |
scale | float | 1.0 | Ensartet skalering anvendt på eksporteret geometri |
binary_mode | bool | False | Skriv binær STL i stedet for ASCII STL |
FbxLoadOptions
Indlæsningsindstillinger for FBX-filer (.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 | Bevar FBX GlobalSettings egenskaber i scenens asset-info |
compatible_mode | bool | False | Aktiver kompatibilitetstilstand for FBX-filer fra ældre authoring-værktøjer |
FbxSaveOptions
Gemmekindstillinger for FBX-output.
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 | Kopier refererede teksturer til output-mappen |
reuse_primitive_mesh | bool | False | Fjern dubletter af identisk mesh-geometri i output |
enable_compression | bool | True | Aktiver intern binær FBX-komprimering |
fold_repeated_curve_data | Enumerations | None | Fold identiske animationskurve-segmenter |
export_legacy_material_properties | bool | True | Inkluder ældre Phong/Lambert materialeegenskabsnoder for kompatibilitet |
video_for_texture | bool | False | Indlejr teksturdata i FBX-video-noder |
embed_textures | bool | False | Indlejr teksturfiler inline i FBX-binæren |
generate_vertex_element_material | bool | False | Tilføj en VertexElementMaterial lag for per-polygon materialtildeling |
ColladaLoadOptions
Indlæsningsindstillinger for COLLADA-filer (.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 | Vend koordinatsystemet ved import |
enable_materials | bool | True | Importér COLLADA-materialdefinitioner |
scale | float | 1.0 | Ensartet skalering anvendt på importeret geometri |
normalize_normal | bool | True | Normalisér importerede normalvektorer |
ColladaSaveOptions
Save‑options for COLLADA‑output.
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 | Vend koordinatsystemet ved eksport |
enable_materials | bool | True | Skriv COLLADA-materialdefinitioner |
indented | bool | True | Formater XML-outputtet pænt med indrykning |
ThreeMfLoadOptions / ThreeMfSaveOptions
Indlæsnings- og gemmeindstillinger for 3MF-filer (.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)Disse klasser arver grundlæggende egenskaber fra LoadOptions / SaveOptions henholdsvis. Ingen yderligere format‑specifikke egenskaber er dokumenteret for den aktuelle FOSS‑udgivelse.