You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GLTFLoader outputs an empty Group when multiple scenes refer to the same root node. I created a simple cube in Blender, exported to glTF. This works fine. But when I duplicate the scenes array in glTF file and try to view it in ThreeJS, glTF loader returns an empty group.
glTF specification allows referring to the same root nodes from multiple scenes, so I consider this a bug.
While I have no reason to duplicate scenes, we do sometimes load such models from external sources, and have no practical way to preprocess the files to remove
Reproduction steps
Download the attached GLB file
Add it to threejs editor, gltfviewer or any three.js scene
constloader=newGLTFLoader();loader.parse(e.target.result,'',gltf=>{console.log(gltf)if(gltf.scene.isGroup&&gltf.scene.children.length===0){console.error('gltf.scene is a group with no children!')}});
Agreed, while glTF models with multiple scenes are fairly rare, I would consider this a bug as well. Note that we'll need to either parse the node subtree a second time, or use SkeletonUtils.clone to make a copy. Calling node.clone() alone will break connections to the bones of skinned meshes.
Description
GLTFLoader outputs an empty Group when multiple scenes refer to the same root node. I created a simple cube in Blender, exported to glTF. This works fine. But when I duplicate the scenes array in glTF file and try to view it in ThreeJS, glTF loader returns an empty group.
So this works:
... while this doesn't:
glTF specification allows referring to the same root nodes from multiple scenes, so I consider this a bug.
While I have no reason to duplicate scenes, we do sometimes load such models from external sources, and have no practical way to preprocess the files to remove
Reproduction steps
duplicatescene.zip
Code
Live example
https://jsfiddle.net/jteq8mov/2/
Screenshots
No response
Version
r156 and r162 at least
Device
No response
Browser
No response
OS
No response
The text was updated successfully, but these errors were encountered: