12
$\begingroup$

I'm trying to animate a mesh via it's skeleton on a webpage using a BVH. Here's the overall process of what I'm trying to do:

  1. Make a character using MakeHuman and export (mhx format? seems to work best).
  2. Import the character into Blender.
  3. Retarget to a BVH using the MakeWalk plugin for Blender.
  4. Export the character to json using the Three.js exporter.
  5. Export the BVH (not sure if this is necessary, but I figured I might have better luck getting the BVH to match up with the skeleton after retargeting)
  6. Load the character into a web page using Three.js
  7. Animate the character using a BVH.

The animation looks great in blender. I'm trying to use the BVH viewer code from here modified to use the skeleton created by MakeHuman instead of it creating a skeleton from the BVH data. Whenever I try to animate the character, it gets very distorted.

Here's the desired result (more or less) rendered from Blender:

desired result

And this is what is happening on the webpage:

buggy result

As you can see, it's getting totally messed up. I also had to zoom way out in order to see the whole image.

I've tried using different rigs, different file formats, resaving the BVH after retargeting, you name it. I also tried to follow the example here (scroll down to see the instructions), but it says to delete the armature modifiers and when I do that, no bones get exported and Three.js throws an error.

I am at a loss. Is there an up-to-date example somewhere that shows how to do what I'm trying to do?

$\endgroup$
  • $\begingroup$ Fortunately there is a way in this five part video tutorial series youtube.com/… $\endgroup$ – user17939 Sep 6 '15 at 8:49
  • $\begingroup$ @VusumuziTshabangu, that tutorial has absolutely nothing to do with Three.js. $\endgroup$ – adam0101 Sep 8 '15 at 15:47
3
$\begingroup$

The simplest process to achieve character animations, created from makehuman in Blender is the following:

1. Install makewalk. This is a Blender addon that should be contained in a folder called blendertools in your makehuman folder.

enter image description here

Drag the makewalk folder into your blender addons folder. On windows, it is c:\users*your_name*\appdata\roaming\blender foundation\blender\2.78\scripts\addons

enter image description here

Then, within blender, go to setting, addons, hit the refresh button on the bottom of the window, and search for makewalk, and enable it, then save your settings

2. Install the .mhx2 plugin to export from Makehuman and import into Blender. The addon consists of two seperate parts - one addon for makehuman and one for Blender.

Download information and instruction on how to install can be found here

3. Create your character in Makehuman, add a mocap skeleton, and export as mhx2, taking note of the setting shown below

enter image description here

enter image description here

4. Import the mxh2 model in blender.

5. Download motionbuilder compatible bvh files. Here is a source with thousands of motion capture files https://sites.google.com/a/cgspeed.com/cgspeed/motion-capture/cmu-bvh-conversion

6. In blender, with the makewalk addon, attach the bvh file to your character's armature.

enter image description here

$\endgroup$
  • $\begingroup$ Rereading your question, I realise that my answer does not directly relate to your more complex process, but will leave it on for others searching on how to create animations. $\endgroup$ – dimitarsp Apr 25 '17 at 22:45
  • $\begingroup$ Thanks. These are pretty much the steps that I was taking to get it that far. Since then, I've given up on using the exported BVH as the source to animate the character on the web and instead have had much better success exporting the animation along with the character as JSON using the Three.js exporter. Then I ran it through a console app I created to strip out extraneous quotes and whitespace and the result was a file that was actually comparable in size to the BVH file. $\endgroup$ – adam0101 Apr 25 '17 at 22:55
  • $\begingroup$ thank you my friend, its worked fine here before I try the impossible to make my character dance $\endgroup$ – Armando Marques Sobrinho Oct 18 '17 at 18:54
  • $\begingroup$ So now, I need to integrate in this character various .bvh file to continue the animation, it is possible? thanks! $\endgroup$ – Armando Marques Sobrinho Oct 18 '17 at 20:17
1
$\begingroup$

I posted the same on SO: https://stackoverflow.com/a/30050230/3091066, but here is my answer for other users who might be interested:

The same thing happened to me when I exported from Blender to Three.js. The solution that worked for me was (after step 3 in your list) to ensure in Blender that there were no object rotations still that hadnt been applied (Ctrl+A). In other word the skeleton and the mesh must have no additional rotations or scaling.

$\endgroup$
  • $\begingroup$ I've seen that before and I know that resetting the location, rotation, and scale has helped a lot of people, but unfortunately I had already done that. $\endgroup$ – adam0101 May 5 '15 at 13:07
1
$\begingroup$

I had trouble exporting animations to THREE js as shown in the issue here:

https://github.com/mrdoob/three.js/issues/6751

Make sure you follow the troubleshooting steps that are there. Also make sure like above that the rotation/location/scale is applied on both the mesh, and the armature.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.