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 ] );