Best way to import multiple animations for 1 model from 1 gltf file

I have animated a model in Maya, used the Game Exporter to create an FBX file, then used FBX2glTF to create a .gltf model with multiple animations in it. I can get at the animations by gltf.animations[0…20] or by THREE.AnimationClip.findByName( gltf.animations, ‘ANIMATION_NAME’ )
So far so good.

But is this the best way, to repeat this for every animation?
animOpen = new THREE.AnimationMixer( gltf.scene );
animOpenAction = animOpen.clipAction( gltf.animations[ 0 ] );

animClose = new THREE.AnimationMixer( gltf.scene );
  animCloseAction = animClose.clipAction( gltf.animations[ 1 ] );

Is it possible to get multiple clips from one mixer? Feels like I’m repeatedly hitting gltf.scene.
I tried this but it didn’t work

mainMixer = new THREE.AnimationMixer( gltf.scene );
  animOpenAction = mainMixer.clipAction( gltf.animations[ 0 ] );
  animCloseAction = mainMixer.clipAction( gltf.animations[ 1 ] );
1 Like

Everything above looks right. You can certainly use multiple clips with a single mixer – the mixer’s purpose is to mix animation clips. :wink:

I tried this but it didn’t work

Didn’t work in what way? You’ll need to call .play() on at least one action, and update the mixer on each frame.

You’re right. I had troubles in a different part of the code, getting the clips from the same mixer wasn’t my problem.