Load and Save Options — Aspose.3D FOSS for Python API Reference
Overview
All import and export operations accept an optional options object derived from LoadOptions or SaveOptions. Pass the appropriate subclass to Scene.open() or Scene.save() to control format-specific behaviour.
Package: aspose.threed.formats
from aspose.threed.formats import (
LoadOptions, SaveOptions,
ObjLoadOptions, ObjSaveOptions,
GltfLoadOptions, GltfSaveOptions,
StlLoadOptions, StlSaveOptions,
FbxLoadOptions, FbxSaveOptions,
ColladaLoadOptions, ColladaSaveOptions,
ThreeMfLoadOptions, ThreeMfSaveOptions,
)IOConfig (base)
Both LoadOptions and SaveOptions inherit from IOConfig. The following properties are available on every options object.
| Name | Type | Description |
|---|---|---|
file_format | FileFormat | None | The format this config is associated with (read-only after construction) |
encoding | str | None | Text encoding hint (e.g. "utf-8") |
file_system | FileSystem | None | Custom file-system abstraction for resolving texture/MTL paths |
lookup_paths | list[str] | Additional directories to search when resolving external references |
file_name | str | None | Base file name used for relative-path resolution |
LoadOptions
Base class for all load-option objects.
Additional property (beyond IOConfig):
| Name | Type | Description |
|---|---|---|
encoding | str | None | Text encoding override |
SaveOptions
Base class for all save-option objects.
Additional property (beyond IOConfig):
| Name | Type | Description |
|---|---|---|
export_textures | bool | When True, textures referenced by the scene are copied to the output. Defaults to False |
ObjLoadOptions
Load options for Wavefront OBJ files (.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)| Property | Type | Default | Description |
|---|---|---|---|
flip_coordinate_system | bool | False | Flip the coordinate system on import |
enable_materials | bool | True | Load the accompanying .mtl material file |
scale | float | 1.0 | Uniform scale applied to all imported geometry |
normalize_normal | bool | True | Normalise imported normal vectors to unit length |
ObjSaveOptions
Save options for Wavefront OBJ files.
from aspose.threed.formats import ObjSaveOptions
opts = ObjSaveOptions()
opts.enable_materials = False
scene.save("output.obj", opts)| Property | Type | Default | Description |
|---|---|---|---|
apply_unit_scale | bool | False | Apply the scene’s unit scale factor to exported coordinates |
point_cloud | bool | False | Export vertices only (no polygon faces) |
verbose | bool | False | Include additional OBJ comments in the output |
serialize_w | bool | False | Write the W component of control points |
enable_materials | bool | True | Write a .mtl material file and reference it from the .obj |
flip_coordinate_system | bool | False | Flip the coordinate system on export |
axis_system | AxisSystem | None | None | Override the output axis system |
GltfLoadOptions
Load options for glTF 2.0 and GLB files (.gltf, .glb).
from aspose.threed.formats import GltfLoadOptions
opts = GltfLoadOptions()
opts.flip_tex_coord_v = False
scene = Scene()
scene.open("model.gltf", opts)| Property | Type | Default | Description |
|---|---|---|---|
flip_tex_coord_v | bool | True | Flip V texture coordinates on import (glTF uses top-left origin; True converts to bottom-left) |
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)| Property | Type | Default | Description |
|---|---|---|---|
binary_mode | bool | False | When True, writes a self-contained binary GLB; when False, writes JSON .gltf with an external buffer |
flip_tex_coord_v | bool | True | Flip V texture coordinates on export |
export_textures | bool | False | Copy referenced textures into the output package (inherited from SaveOptions) |
StlLoadOptions
Load options for STL files (.stl).
from aspose.threed.formats import StlLoadOptions
opts = StlLoadOptions()
opts.scale = 0.001 # convert millimetres to metres
scene = Scene()
scene.open("part.stl", opts)| Property | Type | Default | Description |
|---|---|---|---|
flip_coordinate_system | bool | False | Flip the coordinate system on import |
scale | float | 1.0 | Uniform scale applied to imported geometry |
StlSaveOptions
Save options for STL output.
from aspose.threed.formats import StlSaveOptions
opts = StlSaveOptions()
opts.binary_mode = True
scene.save("output.stl", opts)| Property | Type | Default | Description |
|---|---|---|---|
flip_coordinate_system | bool | False | Flip the coordinate system on export |
scale | float | 1.0 | Uniform scale applied to exported geometry |
binary_mode | bool | False | Write binary STL instead of ASCII STL |
FbxLoadOptions
Load options for FBX files (.fbx).
from aspose.threed.formats import FbxLoadOptions
opts = FbxLoadOptions()
opts.keep_builtin_global_settings = True
scene = Scene()
scene.open("animation.fbx", opts)| Property | Type | Default | Description |
|---|---|---|---|
keep_builtin_global_settings | bool | False | Preserve FBX GlobalSettings properties in the scene asset info |
compatible_mode | bool | False | Enable compatibility mode for FBX files from older authoring tools |
FbxSaveOptions
Save options for FBX output.
from aspose.threed.formats import FbxSaveOptions
opts = FbxSaveOptions()
opts.enable_compression = False
scene.save("output.fbx", opts)| Property | Type | Default | Description |
|---|---|---|---|
export_textures | bool | False | Copy referenced textures into the output directory |
reuse_primitive_mesh | bool | False | Deduplicate identical mesh geometry in the output |
enable_compression | bool | True | Enable binary FBX internal compression |
fold_repeated_curve_data | Any | None | Fold identical animation curve segments |
export_legacy_material_properties | bool | True | Include legacy Phong/Lambert material property nodes for compatibility |
video_for_texture | bool | False | Embed texture data in FBX video nodes |
embed_textures | bool | False | Embed texture files inline in the FBX binary |
generate_vertex_element_material | bool | False | Add a VertexElementMaterial layer for per-polygon material assignment |
ColladaLoadOptions
Load options for COLLADA files (.dae).
from aspose.threed.formats import ColladaLoadOptions
opts = ColladaLoadOptions()
opts.scale = 0.01
scene = Scene()
scene.open("model.dae", opts)| Property | Type | Default | Description |
|---|---|---|---|
flip_coordinate_system | bool | False | Flip the coordinate system on import |
enable_materials | bool | True | Import COLLADA material definitions |
scale | float | 1.0 | Uniform scale applied to imported geometry |
normalize_normal | bool | True | Normalise imported normal vectors |
ColladaSaveOptions
Save options for COLLADA output.
from aspose.threed.formats import ColladaSaveOptions
opts = ColladaSaveOptions()
opts.indented = False # compact output
scene.save("output.dae", opts)| Property | Type | Default | Description |
|---|---|---|---|
flip_coordinate_system | bool | False | Flip the coordinate system on export |
enable_materials | bool | True | Write COLLADA material definitions |
indented | bool | True | Pretty-print the XML output with indentation |
ThreeMfLoadOptions / ThreeMfSaveOptions
Load and save options for 3MF files (.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)These classes inherit base properties from LoadOptions / SaveOptions respectively. No additional format-specific properties are documented for the current FOSS release.