Quickstart

Overview

Once Aspose.3D FOSS for Python is installed, the fastest way to see it work is to open an existing model file, look at what loaded, and save it to a different format.


Prerequisites

RequirementDetail
Package installedSee Installation
Input fileAn OBJ, STL, glTF, COLLADA, or 3MF file to open

1. Open a scene file

Scene.open() reads a file into a Scene, optionally with format-specific load options:

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)

for node in scene.root_node.child_nodes:
    if node.entity is not None:
        mesh = node.entity
        print(f"{node.name}: {len(mesh.control_points)} vertices, {mesh.polygon_count} polygons")

2. Open with Scene.from_file() instead

For a quick one-liner without format-specific options, use Scene.from_file():

from aspose.threed import Scene

scene = Scene.from_file("model.obj")
scene.save("model.glb")

3. Inspect the node hierarchy

Every scene has a root_node; child nodes carry an optional entity (a Mesh, Camera, or Light) and an optional material:

from aspose.threed import Scene

scene = Scene()
scene.open("model.obj")

print(f"Root node children: {len(scene.root_node.child_nodes)}")
for node in scene.root_node.child_nodes:
    entity_type = type(node.entity).__name__ if node.entity else "no entity"
    print(f"  {node.name} [{entity_type}]")

scene.save("output.glb")
print("Saved output.glb")

Next Steps

See Also