I can’t seem to get this JSON model to animate in three.js. I’ve tried exporting it so many different ways using the three exporter, but I’m not sure if it’s the model or the code. I’m getting a trace on the animations from within the model (5), but nothing happens on the call-back. Any ideas?
new THREE.JSONLoader().load( 'assets/model/Gunnar.json', function ( model, material ) {
var mesh = new THREE.SkinnedMesh(model, material);
scene.add( mesh );
mesh.scale.x = mesh.scale.y = mesh.scale.z = 5;
var clips = model.animations;
mixer = new THREE.AnimationMixer( mesh );
mixer.clipAction( clips[0] ).play();
loaded = true;
animate();
} );
function animate() {
requestAnimationFrame( animate );
if (loaded) {
mixer.update(clock.getDelta());
}
renderer.render( scene, camera );
}
Blender 2.78
Three.js R88