I’m importing several scenes (FBX) into the same page creating a scene array, each scene goes in a div container. It works great. But the animation is not running.
Here the main code regarding the loader:
loaderF.load(url, function (object) {
const mixer = new THREE.AnimationMixer(object);
var action = mixer.clipAction(object.animations[0]);
action.play();
object.traverse(function (child) {
if (child.isMesh) {
child.castShadow = true;
child.receiveShadow = true;
}
});
scene.type_id = a.type;
scene.add(object);
object.updateMatrix();
them.scenes.push(scene); // the Array
}
The animate method is simple:
animate: function () {
this.render();
requestAnimationFrame(this.animate);
},
Finally into the render method I have a loop for each scene:
this.scenes.forEach(function (scene) {
var camera = scene.userData.camera;
vm.renderer.render(scene, camera);
}
What I am missing about the animations? I checked the fbx file and it contains a single animation
[EDIT] I noticed this error into console:
FBXLoader.js:1842 THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights.