Supported Formats
Overview
Scene.open() and Scene.save() route to a per-format plugin registered in IOService. Each plugin supplies its own LoadOptions and SaveOptions class with format-specific settings. Not every format has equal import and export support in this fork — check the table below before relying on a round trip.
Format support
| Format | Import | Export | Options class |
|---|---|---|---|
| OBJ | Yes | Yes | ObjLoadOptions / ObjSaveOptions |
| STL (ASCII + binary) | Yes | Yes | StlLoadOptions / StlSaveOptions |
| glTF 2.0 / GLB | Yes | Yes | GltfLoadOptions / GltfSaveOptions |
| COLLADA (.dae) | Yes | Yes | ColladaLoadOptions / ColladaSaveOptions |
| 3MF | Yes | Yes | ThreeMfLoadOptions / ThreeMfSaveOptions |
| FBX (ASCII) | Partial — low-level tokenizer and parser only | Not implemented | FbxExporter.save raises NotImplementedError in this fork |
FBX is the one format where this fork’s implementation is visibly incomplete: the source tree includes an FbxTokenizer and FbxParser for FBX ASCII content, but there is no confirmed Scene-level Scene.open() path for FBX, and FbxExporter.save and FbxExporter.save_to_stream both raise NotImplementedError. Treat FBX as not supported for application code until that changes.
Format-specific load options
Each format’s LoadOptions class controls import behavior. The pattern is the same for every format — construct the options, set the relevant flags, then pass them to Scene.open():
from aspose.threed import Scene
from aspose.threed.formats.obj import ObjLoadOptions
scene = Scene()
options = ObjLoadOptions()
options.enable_materials = True
scene.open("model.obj", options)ObjLoadOptions also exposes flip_coordinate_system, scale, and normalize_normal. StlLoadOptions exposes flip_coordinate_system and scale. ColladaLoadOptions and GltfLoadOptions and ThreeMfLoadOptions each expose flip_coordinate_system (Collada, 3MF) or flip_tex_coord_v (glTF).
Format-specific save options
SaveOptions classes work the same way, passed as the second argument to Scene.save(). GltfSaveOptions.binary_mode selects between .gltf (text) and .glb (binary) output for the same exporter:
from aspose.threed import Scene
scene = Scene()
scene.open("model.obj")
scene.save("model.glb")StlSaveOptions.binary_mode controls ASCII vs. binary STL output the same way. ThreeMfSaveOptions additionally exposes enable_compression and pretty_print.
Tips and Best Practices
- Pass the format-specific LoadOptions or SaveOptions class explicitly when you need non-default behavior (materials, coordinate flipping, binary mode); Scene.open()/Scene.save() with no options argument use each plugin’s defaults.
- Do not write code against FBX export in this fork — FbxExporter.save is not implemented, and will raise NotImplementedError at runtime.
- When converting between formats, test the specific pair you need; options are not symmetric (for example, STL has no material properties at all, so round-tripping a materialed OBJ through STL silently drops material data).
- Use scene.save() with a plain file extension for the common case; reach for the *SaveOptions classes only when you need to deviate from the format’s default output mode.
Common Issues
| Issue | Cause | Fix |
|---|---|---|
| NotImplementedError when saving to .fbx | FbxExporter.save is not implemented in this fork | Export to glTF, OBJ, STL, COLLADA, or 3MF instead |
| Materials disappear after exporting to STL | STL has no material representation | Export to OBJ, glTF, COLLADA, or 3MF if material data must survive |
| glTF output is binary when a text file was expected (or vice versa) | GltfSaveOptions.binary_mode was left at its default | Set binary_mode explicitly to choose .gltf vs .glb |
| OBJ import ignores the .mtl file | ObjLoadOptions.enable_materials was not set | Set options.enable_materials = True before calling Scene.open() |
FAQ
Can I import an FBX file with this fork?
Not reliably at the Scene level. The source includes an FBX ASCII tokenizer and parser, but there is no confirmed Scene.open() path for FBX, and FBX export is not implemented at all.
Which formats support round-tripping materials?
OBJ, glTF, COLLADA, and 3MF all have material-aware load and save options. STL has no material concept in either direction.
Does Scene.save() infer the format automatically?
Yes, from the file extension, unless you pass an explicit SaveOptions instance or FileFormat value as the second argument.
API Reference Summary
| Class/Method | Description |
|---|---|
| IOService | Registry of per-format importers, exporters, and detectors |
| ObjLoadOptions / ObjSaveOptions | OBJ import/export options, including .mtl material support |
| StlLoadOptions / StlSaveOptions | STL import/export options, including ASCII/binary mode |
| GltfLoadOptions / GltfSaveOptions | glTF/GLB import/export options |
| ColladaLoadOptions / ColladaSaveOptions | COLLADA (.dae) import/export options |
| ThreeMfLoadOptions / ThreeMfSaveOptions | 3MF import/export options |
| FbxExporter | Present but save() / save_to_stream() are not implemented |