simvx.graphics.assets.mesh_loader¶
Full glTF scene loading — meshes, materials, textures, node hierarchy.
Pure-Python parsing step: produces a GLTFScene with vertex/index arrays
and texture URIs (str) or embedded bytes. Backends (Vulkan desktop,
WebRenderer) consume the same data through TextureManager.resolve.
Two parser backends:
pygltflib— full glTF 2.0 support (default when available).Pure-stdlib fallback — handles the common
.gltfJSON + external.bin+ image files subset (POSITION, NORMAL, TEXCOORD_0, indices, base-colour texture). Used when pygltflib isn’t installed (notably inside Pyodide / web exports). Advanced features (animations, skinning, glTF 2.0 extensions, embedded .glb binaries) require pygltflib.
Module Contents¶
Classes¶
Extracted PBR metallic-roughness material. |
|
Scene graph node with optional mesh reference. |
|
Complete loaded glTF scene. |
Functions¶
Load complete glTF scene with all meshes, materials, textures, and hierarchy. |
Data¶
API¶
- simvx.graphics.assets.mesh_loader.__all__¶
[‘load_gltf’, ‘GLTFScene’, ‘GLTFMaterial’, ‘GLTFNode’]
- simvx.graphics.assets.mesh_loader.log¶
‘getLogger(…)’
- class simvx.graphics.assets.mesh_loader.GLTFMaterial[source]¶
Extracted PBR metallic-roughness material.
- name: str = <Multiline-String>¶
- albedo: tuple[float, float, float, float]¶
(1.0, 1.0, 1.0, 1.0)
- metallic: float¶
1.0
- roughness: float¶
1.0
- albedo_texture: str | bytes | None¶
None
- normal_texture: str | bytes | None¶
None
- metallic_roughness_texture: str | bytes | None¶
None
- emissive_texture: str | bytes | None¶
None
- ao_texture: str | bytes | None¶
None
- double_sided: bool¶
False
- alpha_mode: str¶
‘OPAQUE’
- class simvx.graphics.assets.mesh_loader.GLTFNode[source]¶
Scene graph node with optional mesh reference.
- name: str = <Multiline-String>¶
- mesh_index: int | None¶
None
- material_indices: list[int]¶
‘field(…)’
- transform: numpy.ndarray¶
‘field(…)’
- children: list[int]¶
‘field(…)’
- skin_index: int | None¶
None
- class simvx.graphics.assets.mesh_loader.GLTFScene[source]¶
Complete loaded glTF scene.
- meshes: list[tuple[numpy.ndarray, numpy.ndarray]]¶
‘field(…)’
- materials: list[simvx.graphics.assets.mesh_loader.GLTFMaterial]¶
‘field(…)’
- nodes: list[simvx.graphics.assets.mesh_loader.GLTFNode]¶
‘field(…)’
- root_nodes: list[int]¶
‘field(…)’
- skins: list[dict[str, Any]]¶
‘field(…)’
- animations: list[dict[str, Any]]¶
‘field(…)’
- simvx.graphics.assets.mesh_loader.load_gltf(file_path: str) simvx.graphics.assets.mesh_loader.GLTFScene[source]¶
Load complete glTF scene with all meshes, materials, textures, and hierarchy.
Returns a GLTFScene with all data extracted and ready for import. Dispatches to pygltflib when available, falling back to a stdlib parser suitable for simple
.gltf+.bin+ image bundles (Pyodide / web).