Discovered a strange behaviour regarding the GLTF importer. When I import a GLTF using SceneLoader.LoadAssetContainer, the importer immediately adds all the geometries of the GLTF into the scene even though i have not told the container to addAllToScene().
Even more strange is the asset container does not contain a record of the imported geometries, e.g. container.geometries == . And yet, a console log of scene.geometries clearly shows geometries were added.
I have two expectations:
-
If I have not added anything from the asset container to the scene, I should not see the GLTF geometries in the scene.
-
If I import a GLTF with SceneLoader.LoadAssetContainer, I expect to see the GLTF geometries in container.geometries.
I have created a simple PG to demo this:
https://playground.babylonjs.com/#VR60N0#14
I’m not sure if the above constitute as a bug and the GLTF loader to be patched.
Right now I’m applying a dirty workaround where i loop through all the container.meshes and get the geometry from each mesh to obtain a list of imported geometries for a given GLTF.