1

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:

  1. Make a mesh in MakeHuman.
  2. Export as a Collada *.dae file.
  3. Import into Blender.
  4. 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.
  5. Because multiple sites say this fixed their problems, I clear any location, rotation, or scale on the mesh and armature.
  6. Export the whole scene using the Three.js exporter for Blender.
  7. 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?

adam0101
  • 29,096
  • 21
  • 96
  • 174
  • There is an unknown checklist to use the blender exporter on animated meshes : https://devmatrix.wordpress.com/2013/02/27/creating-skeletal-animation-in-blender-and-exporting-it-to-three-js/. Does it solve the issue ? – Mouloud85 Sep 21 '15 at 16:12
  • @Atrahasis, unfortunately no. I tried following that months ago, but it is for a much older version of Three.js. If I try to "delete the armature before exporting" as it suggests, I get no bone info exported and Three.js throws an error. – adam0101 Sep 21 '15 at 16:18
  • I've been struggling with that for a while even with the link, so let me emphasize ont point : be sure to reset the bones' position/rotation/scale in pose mode. No need to delete the armature or anything else. I may join the github issue where i link all the related posts quickly found : https://github.com/mrdoob/three.js/issues/7135 – Mouloud85 Sep 21 '15 at 17:53
  • @Atrahasis, have you ever been able to get it to work correctly? – adam0101 Sep 23 '15 at 06:00
  • yes, i am now exporting massively without any issue. – Mouloud85 Sep 23 '15 at 08:07
  • @Atrahasis, I've been struggling with this for months. Would you mind meeting me on `join.me` and maybe you could show me where I went wrong in the process? – adam0101 Sep 23 '15 at 17:37

1 Answers1

0

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.

adam0101
  • 29,096
  • 21
  • 96
  • 174