I use fbx-loader to load my fbx file, which has an bone animation, when the file init loaded in scene, it looks good, but when I play the animation use action.reset(); action.play()
, the animation’s orientation is changed to a wrong direction, when the animation finished, the orientation becomes normal.
I have inspected , It played well in 3DX MAX.
So any advice you smart guys can give me ?
some tips for me to locate the issue point?
Can you share the model, and a complete code sample that illustrates the problem?
updateAnimation(dt) {
if (this.mixers.length > 0) {
for (var i = 0; i < this.mixers.length; i++) {
this.mixers[i].update(dt);
}
}
}
clipAnimation(bLoopRepeat) {
this.meshObj.mixer = new THREE.AnimationMixer(this.meshObj);
this.mixers.push(this.meshObj.mixer);
for(var i=0; i< this.meshObj.children.length; ++i) {
if(this.meshObj.children[i] instanceof THREE.SkinnedMesh) {
this.meshObj.children[i].material.skinning = true;
}
}
this.action = this.meshObj.mixer.clipAction(this.meshObj.animations[0]);
var loop = bLoopRepeat ? THREE.LoopRepeat : THREE.LoopOnce;
this.action.setLoop(loop);
this.action.reset();
}
stopAnimation() {
this.action.stop();
}
playAnimation() {
this.action.reset();
this.action.play();
}
pauseAnimation() {
this.action.paused = true;
}
This the code I used to play animation, I could share the fbx file for some reason. I also tried use the same fbx file in babylon.js, it works fine.
Find the problem.
“The root bone do not need animation”, this is my colleague’s suggest.
PS. I don’t know why unity, 3ds max and babylon they all handle this saturation well, maybe this is a corner case which fbxloader doesn’t handle well. @looeee
@Liu_Hao I really couldn’t say without taking a look at the FBX file.