Skip to content

Model loading pipeline

Editor path

  1. Browser File objects are collected.
  2. A root GLB or GLTF is selected.
  3. Every file receives an object URL.
  4. Relative dependency paths are normalized into a URL map.
  5. GLTFLoader resolves requests through the loading manager.
  6. Scene data, clips, bounds, meshes, materials, textures, and statistics are collected.
  7. Object URLs are revoked when the bundle changes or unmounts.

Runtime path

  1. GLTFLoader receives src and optional resourcePath.
  2. Draco and Meshopt decoders are attached.
  3. The loaded scene is cloned with SkeletonUtils.clone.
  4. Material overrides and replacement textures are applied.
  5. Local bounds and runtime statistics are calculated.
  6. The clone is mounted below ModelPivotGroup.
  7. Resources are disposed when replaced or unmounted.

Why clone

A loader cache may share the same scene or materials across instances. Cloning prevents one viewer's material overrides and animations from unexpectedly affecting another viewer.

Released under the MIT License.