GLTF with multiple scene animated got an error to all scenes none default

Hi

I create the simplest GLTF file ever two scenes each one have one object
SceneA got a cube SceneB got a sphere
both mesh are animated.

If my default scene his sceneA the sceneA got a mesh animated and scene B got the mesh loaded but no animation and with an error on the console like he doesn’t find sphere.position on track

If I go to the GLTF.file, and I change the default scene the problem reverse to the other scene so SceneA mesh got an error and the SceneB got his mesh animated.

Any help will be welcome

I even try to create a different mixer for each scene inside a loop gltf.scenes.forEach … …
with no result
I try to clone each scene with the hope to avoid this issue no result also
I try to target each action clip of the gltf and make them play manually by pressing a touch no result aslo

starting to be hopeless



    mixer = new THREE.AnimationMixer(gltf.scene):


    annimationGLTF.forEach((element, index) => {
      console.log(`Animation Clip ${index}: ${element.name}`);
 

      action = mixer.clipAction(element);
      clip = action.getClip();
 




    }) // end each animation\
document.addEventListener("keydown", handleKeyPress5);
function handleKeyPress3(event) {
  if (event.code === 'Numpad7') {
    mixer._actions.forEach((action) => { action.play(); })
    
    console.log("numpad7 press");


  }
}

When you export GLTFs i don’t think it will export tracks that aren’t tied to an existing object in the scene?
Can you reproduce your issue in a glitch or codepen, and we can take a look?

In addition to @manthrax advice above, you’ll almost certainly want to use a different AnimationMixer for each scene. I can’t tell if that’s the case from the code snippet you’ve shared.

1 Like