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:
- Make a mesh in MakeHuman.
- Export as a Collada *.dae file.
- Import into Blender.
- Retarget to a BVH mocap file using the MakeWalk Blender add-on.
- If I play the animation in Blender at this point, it looks perfect.
- Because multiple sites say this fixed their problems, I clear any location, rotation, or scale on the mesh and armature.
- Export the whole scene using the Three.js exporter for Blender.
- Load the scene and embedded animation using the ObjectLoader.
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?