I have a glb created in Blender. I am importing it to my scene just fine. I can see the animations and they play when running on the gltf viewere . I can see them in my console…
The problem is I cannot get the animation to play. I have been reading this discourse for days and cannot figure what I’m doing wrong here…I’m just trying to pose this figure. Some guidance would be appreciated.
Thanks!
loader.load('/public/makeavatar/base/avatar.glb', function ( gltf ) {,,,,,
let avatar = gltf.scene
avatar.animations = gltf.animations;
scene.add(avatar);
function setPose (avatar, getPose){
console.log (avatar.animations);
var i = 0
avatar.animations.forEach((clip) => {
if (clip.name == getPose){
var mixer = new AnimationMixer( avatar );
console.log(i + " " +clip.name)
var action = mixer.clipAction(clip);
action.clampWhenFinished = true;
action.play();
console.log(action);
}
i = i + 1
});
}
setPose (avatar, “Standing”);