Expand description
One-shot glTF 2.0 loading — load_gltf parses geometry, a skeleton,
and animation clips out of a .gltf/.glb file. Deliberately not
part of the Asset/LazyResource
pipeline: those retry forever on None, which is right for “the backend
isn’t ready yet” but wrong for “this file doesn’t exist” or “this glTF
feature isn’t supported” — conditions that can never resolve on their
own. Call load_gltf directly (in main(), a .once() system, wherever
you need it) and handle the Result like any other fallible I/O.
Scoped to geometry + skeleton + animation only — materials and textures
are never read, even though the file may reference them; load your own
textures via TextureBuilder and
write your own Material/shader separately.
See ModelLoadError::UnsupportedFeature for the full list of glTF
features this doesn’t handle (multiple skins, CUBICSPLINE
interpolation, sparse accessors, morph targets, non-indexed primitives).
Structs§
- Loaded
Model - Everything
load_gltfextracted from one file.skinned_meshesare primitives bound to the file’s one skin;static_meshesare everything else (rigid props, environment pieces in the same file) as the ordinaryMesh— not padded with identity joint weights just to force them through the skinned path.
Enums§
Functions§
- load_
gltf - Loads geometry, a skeleton, and animation clips from a glTF 2.0 file
(
.gltfor.glb— both handled transparently). One-shot and synchronous: call it directly, not through the asset pipeline (see the module docs above for why).