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

FormatImportExportOptions class
OBJYesYesObjLoadOptions / ObjSaveOptions
STL (ASCII + binary)YesYesStlLoadOptions / StlSaveOptions
glTF 2.0 / GLBYesYesGltfLoadOptions / GltfSaveOptions
COLLADA (.dae)YesYesColladaLoadOptions / ColladaSaveOptions
3MFYesYesThreeMfLoadOptions / ThreeMfSaveOptions
FBX (ASCII)Partial — low-level tokenizer and parser onlyNot implementedFbxExporter.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

IssueCauseFix
NotImplementedError when saving to .fbxFbxExporter.save is not implemented in this forkExport to glTF, OBJ, STL, COLLADA, or 3MF instead
Materials disappear after exporting to STLSTL has no material representationExport 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 defaultSet binary_mode explicitly to choose .gltf vs .glb
OBJ import ignores the .mtl fileObjLoadOptions.enable_materials was not setSet 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/MethodDescription
IOServiceRegistry of per-format importers, exporters, and detectors
ObjLoadOptions / ObjSaveOptionsOBJ import/export options, including .mtl material support
StlLoadOptions / StlSaveOptionsSTL import/export options, including ASCII/binary mode
GltfLoadOptions / GltfSaveOptionsglTF/GLB import/export options
ColladaLoadOptions / ColladaSaveOptionsCOLLADA (.dae) import/export options
ThreeMfLoadOptions / ThreeMfSaveOptions3MF import/export options
FbxExporterPresent but save() / save_to_stream() are not implemented

See Also