scene_data¶
Backend-independent intermediate representation (IR) for imported 3-D models.
An importer backend (algan.mobs.three_d_models.gltf_loader for glB/glTF via trimesh,
or algan.mobs.three_d_models.assimp_loader for FBX via pyassimp) parses a model file
into these plain dataclasses; Model3D
consumes them and builds the Algan mob tree. Keeping the IR separate from both
the parser and the mob builder means:
the parsing backend is swappable (trimesh, FBX SDK, pyassimp, …) without touching
Model3D;the IR can be hand-built in tests, so the mob builder is testable with no parser backend present.
The IR is intentionally a superset of what the current (static-geometry) import
phase consumes: SkinData, morph targets and AnimationData are populated
by the loader where available and are the hooks the skeletal / morph animation
phases build on. Phase 1 reads only
meshes,
materials and the node
transforms.
All arrays are plain torch.Tensor (or None); coordinates are in the
model’s own space (the loader applies assimp’s post-process transforms, e.g.
triangulation and, when requested, axis conversion).
Classes
A named animation clip: a set of per-node keyframe tracks. |
|
A surface material. |
|
One triangulated mesh: per-vertex arrays plus triangle indices. |
|
Keyframed local transform track for a single node (rigid / node animation, and the per-bone tracks skeletal animation reads). |
|
A node in the model's scene graph. |
|
A whole imported model. |
|
Linear-blend-skinning data for a mesh. |