Load and Save Options — Aspose.3D FOSS for Python API Reference
Enumerations
Alle Import- und Exportvorgänge akzeptieren ein optionales Optionsobjekt, das abgeleitet ist von LoadOptions oder SaveOptions. Übergeben Sie die passende Unterklasse an Scene.open() oder Scene.save() um formatabhängiges Verhalten zu steuern.
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 und SaveOptions erben von IOConfig. Die folgenden Eigenschaften stehen in jedem Optionsobjekt zur Verfügung.
| Enumerations | Enumerations | Enumerations |
|---|---|---|
file_format | `FileFormat | None` |
encoding | `str | None` |
file_system | `FileSystem | None` |
lookup_paths | list[str] | Zusätzliche Verzeichnisse, die bei der Auflösung externer Referenzen durchsucht werden |
file_name | `str | None` |
LoadOptions
Basisklasse für alle Ladeoptionsobjekte.
Zusätzliche Eigenschaft (über IOConfig):
| Enumerations | Enumerations | Enumerations |
|---|---|---|
encoding | `str | None` |
SaveOptions
Basisklasse für alle Speicheroptionsobjekte.
Zusätzliche Eigenschaft (über IOConfig):
| Enumerations | Enumerations | Enumerations |
|---|---|---|
export_textures | bool | Enumerations True, von der Szene referenzierte Texturen werden in die Ausgabe kopiert. Standard ist False |
ObjLoadOptions
Ladeoptionen für Wavefront-OBJ-Dateien (.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 | Koordinatensystem beim Import umkehren |
enable_materials | bool | True | Lade die begleitende .mtl Materialdatei |
scale | float | 1.0 | Einheitlicher Maßstab, der auf alle importierte Geometrie angewendet wird |
normalize_normal | bool | True | Normalisiere importierte Normalenvektoren auf Einheitslänge |
ObjSaveOptions
Physically Based Rendering material, das von glTF 2.0 und anderen PBR‑fähigen Formaten verwendet wird.
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 | Wende den Einheitsskalierungsfaktor der Szene auf exportierte Koordinaten an |
point_cloud | bool | False | Exportiere nur Scheitelpunkte (keine Polygonflächen) |
verbose | bool | False | Füge zusätzliche OBJ-Kommentare in die Ausgabe ein |
serialize_w | bool | False | Schreibe die W‑Komponente der Kontrollpunkte |
enable_materials | bool | True | Schreibe ein .mtl Materialdatei und referenziere sie von der .obj |
flip_coordinate_system | bool | False | Spiegle das Koordinatensystem beim Export |
axis_system | `AxisSystem | None` | None |
GltfLoadOptions
Ladeoptionen für glTF 2.0- und GLB-Dateien (.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 | Spiegle V-Texturkoordinaten beim Import (glTF verwendet Ursprung oben links; True konvertiert zu unten‑links) |
GltfSaveOptions
Speicheroptionen für glTF 2.0-Ausgabe.
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, schreibt ein eigenständiges binäres GLB; wenn False, schreibt JSON .gltf mit einem externen Puffer |
flip_tex_coord_v | bool | True | V-Texturkoordinaten beim Export umkehren |
export_textures | bool | False | Kopiere referenzierte Texturen in das Ausgabepaket (geerbt von SaveOptions) |
StlLoadOptions
Ladeoptionen für STL-Dateien (.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 | Koordinatensystem beim Import umkehren |
scale | float | 1.0 | Einheitliche Skalierung auf importierte Geometrie angewendet |
StlSaveOptions
Speicheroptionen für STL‑Ausgabe.
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 | Koordinatensystem beim Export umkehren |
scale | float | 1.0 | Einheitliche Skalierung auf exportierte Geometrie angewendet |
binary_mode | bool | False | Binäres STL schreiben anstelle von ASCII STL |
FbxLoadOptions
Ladeoptionen für FBX-Dateien (.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 beibehalten GlobalSettings Eigenschaften in den Szenen-Asset-Informationen |
compatible_mode | bool | False | Kompatibilitätsmodus für FBX-Dateien von älteren Authoring-Tools aktivieren |
FbxSaveOptions
Speicheroptionen für FBX‑Ausgabe.
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 | Referenzierte Texturen in das Ausgabeverzeichnis kopieren |
reuse_primitive_mesh | bool | False | Duplizierte identische Mesh-Geometrie in der Ausgabe entfernen |
enable_compression | bool | True | Binäre interne FBX-Kompression aktivieren |
fold_repeated_curve_data | Enumerations | None | Identische Animationskurvensegmente zusammenfassen |
export_legacy_material_properties | bool | True | Legacy einbeziehen Phong/Lambert Materialeigenschaftsknoten für Kompatibilität |
video_for_texture | bool | False | Texturdaten in FBX-Video-Knoten einbetten |
embed_textures | bool | False | Texturdateien inline in die FBX-Binärdatei einbetten |
generate_vertex_element_material | bool | False | Füge ein VertexElementMaterial Ebene für pro-Polygon-Materialzuweisung |
ColladaLoadOptions
Ladeoptionen für COLLADA-Dateien (.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 | Koordinatensystem beim Import umkehren |
enable_materials | bool | True | COLLADA-Materialdefinitionen importieren |
scale | float | 1.0 | Einheitliche Skalierung auf importierte Geometrie angewendet |
normalize_normal | bool | True | Importierte Normalenvektoren normalisieren |
ColladaSaveOptions
Speicheroptionen für COLLADA-Ausgabe.
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 | Koordinatensystem beim Export umkehren |
enable_materials | bool | True | COLLADA-Materialdefinitionen schreiben |
indented | bool | True | XML-Ausgabe mit Einrückungen formatieren |
ThreeMfLoadOptions / ThreeMfSaveOptions
Lade- und Speicheroptionen für 3MF-Dateien (.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)Diese Klassen erben Basiseigenschaften von LoadOptions / SaveOptions bzw. Keine zusätzlichen format-spezifischen Eigenschaften sind für die aktuelle FOSS-Version dokumentiert.