[SOLVED] Problem with animation bones

Hello,
I exported boned model of dragon from blender via io_three. I got json with animations and model.

Here:
http://leteckaposta.cz/730472209

Index source is here:
https://pastebin.com/RY81HEXh

I try to play animation “Flying”

mixer = new THREE.AnimationMixer( dragon );
var action = mixer.clipAction( 'Flying' );
console.log(action);
action.play();

but I got this error:

Can someone help me where start to solve these errors?
Thanks

Try to create your mesh like this:

dragon = new THREE.SkinnedMesh( geometry, materials );
1 Like

Wow, thank you so much! :slight_smile:

One more small question.
Skeleton is being animated but model isnt.
Why?

I just changed
dragon = new THREE.SkinnedMesh( geometry, materials );

You have to set the skinning property of your materials to true. So iterate over the materials array and set the value for each instance.

2 Likes

Thank you again, you are PRO :slight_smile:
Now everything works.

1 Like

Yay :blush: :tada:

What did you do with the animation? Can you show? )

My robot: http://js.otrisovano.ru/tests/09-2botwar/gluk/ ) And I cant understand what’s happening…

Why are you doing this in your draw() function?

mesh.morphTargetInfluences[ 0 ] = Math.sin(delta) * 20.0;

If you playback the morph target animation with THREE.AnimationMixer, there is no need to manually adjust morphTargetInfluences.

http://js.otrisovano.ru/tests/09-2botwar/gluk/index1.html

!!!
ITS FANTASTIC ! THANKS ! I do not understand how to do it one week… )
!!!