Reputation: 31055
I'm trying to render an animation in Three.js using a mesh from MakeHuman. The mesh loads correctly, but gets very distorted when the animation runs. If I add a SkeletonHelper, I can see that the skeleton does the animation correctly, however it's orientation is different than the mesh.
When the mesh loads it is face-down and the skeleton is right-side-up. If I rotate the mesh in Three.js so it is right-side-up, then the skeleton goes up-side-down for some reason. I'm not sure if this is maybe contributing to the mesh distortion.
Here's the steps I'm taking:
Any help would be much appreciated. Thanks.
Update - I was able to (briefly) get the model to mostly animate as expected (with just a little distortion) and the skeleton and mesh were both pointing in the same direction, but now I can't reproduce my success. I'm fairly certain that (in Blender) either clearing or applying the rotation, location, and scale is what made the difference, but when I try to run through the steps again, I can't get it to do it anymore. The skeleton and mesh are not in sync again. That has to be the problem, right?
I'm thinking I need to apply the rotation and location, but clear the scale. However, when I try to apply the location, the scale no longer appears "cleared". I guess I don't understand how Blender works. What is the proper way to clear or apply Rot,Loc,Scale? Do I apply/clear before or after retargeting to the BVH? Maybe both? Do I need to do that on each mesh and/or bone?
Upvotes: 1
Views: 886
Reputation: 31055
So I figured out how to make it work, although I could never figure out why my previous method wasn't working.
As soon as you import the model into Blender (and all the meshes are selected by default) clear the rotation, location, and scale. Then, if the model is facing the wrong way, press 'n' to show the Transform panel, select the root mesh node in the Outliner, and rotate it as needed. Then, click ctrl+A to apply the rotation.
So basically, instead of keeping the rotation that was set during the import process, clear it and apply your own.
Upvotes: 0