Animation not working for all bones (makehuman 1.0.1 + blender 2.70a)

I created a model in makehuman 1.0.1 using game rig, exported it to blender 2.70a.
I added a root bone to the armature to parent all the others and placed it at the center of the model.
I applied rotation, translation and scale.
Then I created 2 animations.
They work fine on blender (they are a pair of very basic stand and walk).
When I import the model (Blender importer, not Ogre) on jMonkey Capuchin Prime, and test the animations on scene editor, parts of the animation that involves some bones does not works. More specifically, for example, I have the model scratching his head, so he must move arm, forearm and hands. But only the arm moves. Inn another case, when walking, he must move hips, legs, shin and feet. But the movements of shin and feet does not shows on scene editor, although they are ok on blender.
Any tip to solve this issue would be greatly appreciated.

Well, I was able to run the makehuman model using the ogre exporter. It seems it does not work with blender 2.70a. To be on safe side I used blender 2.63a just to export the model. (I keep working all other model stuff in blender 2.70a).
It is running fine in jME SDK with multiple animations (thanks to @normen tips on another post), clothes and the high poly eyes.
But I’d say blender importer is doing an amazing job, I hope it gets able to get it all done soon.
One point: It seems we do not need to add a root bone on center feet anymore. At least the animations of the test models I’ve built worked fine without the need of a root bone.

1 Like

What about the blender version that ships with the SDK, does that work?

You mean the ogre exporter, right? It is just the one I am using, as I said it did not work with blender 2.70a for me, but worked fine on blender 2.63a (I am running all in linux slackware 14.1 64 bits).
If you or someone else wants to check here is a link to my model.

No, I mean the bundled blender.

Sorry, I really was not aware that a blender version came bundled into SDK, just checked it out.
I will try it and post results later.
thx!

Well, I tried to use blender 2.69 that comes bundled into SDK, and the Ogre exporter failed.
But when I opened the model in blender 2.63a and exported it (without changings, just as it was built in bundled 2.69 blender with all actions and stuff) all worked fine.

Those are the lines where the export error from the bundled bender appears: (It seems that for a start it does not find the materials).

Processing Scene
Processing Materials
WARNING: no materials, not writting .material script
- Exporting root node: gilb
- Generating: gilb:Body.mesh.xml
- Writing shared geometry
Done at 1.64 seconds
- Writing submeshes
Done at 2.07 seconds
Traceback (most recent call last):
File “/home/duo/Development/jmonkeyplatform/blender/2.69/scripts/addons/io_export_ogreDotScene.py”, line 3133, in execute
self.ogre_export(self.filepath, context)
File “/home/duo/Development/jmonkeyplatform/blender/2.69/scripts/addons/io_export_ogreDotScene.py”, line 3555, in ogre_export
xmlparent = doc._scene_nodes
File “/home/duo/Development/jmonkeyplatform/blender/2.69/scripts/addons/io_export_ogreDotScene.py”, line 3841, in _node_export
xmlparent=o
File “/home/duo/Development/jmonkeyplatform/blender/2.69/scripts/addons/io_export_ogreDotScene.py”, line 3712, in _node_export
self.dot_mesh( ob, os.path.split(url)[0] )
File “/home/duo/Development/jmonkeyplatform/blender/2.69/scripts/addons/io_export_ogreDotScene.py”, line 3363, in dot_mesh
dot_mesh( ob, path, force_name, ignore_shape_animation=False )
File “/home/duo/Development/jmonkeyplatform/blender/2.69/scripts/addons/io_export_ogreDotScene.py”, line 5337, in dot_mesh
mesh.user_clear()
ReferenceError: StructRNA of type Mesh has been removed

location: <unknown location>:-1

location: <unknown location>:-1
Saved session recovery to ‘/tmp/quit.blend’
Error: Not freed memory blocks: 2
IDProperty group len: 128 0x7f886960fab8
uiAfterFunc len: 256 0x7f8869396338

1 Like

And when converting the .blend directly you get the same issue as before?

Yeap, some bones gets the animation, others don’t.

1 Like

Hello,

i am facing the same problem, that the animation on forearms and lower part of legs (on a makehuman character) works fine in blender but when i import the blender model to jmonkey, these animations do not work. However, the animations on upper part of legs and the arms work fine.

@duodecimo said: Well, I was able to run the makehuman model using the ogre exporter. It seems it does not work with blender 2.70a. To be on safe side I used blender 2.63a just to export the model. (I keep working all other model stuff in blender 2.70a).

So, what i understand is that i import the .mhx into blender 2.63a, make the animation again and then export it to ogre? I am exporting the blender file into jmonkey rather than ogre as i was having some trouble with ogre. Can you please explain a bit more how can i get rid of this problem (while importing blender into jmonkey) ?

thanks,

I am facing ogre 3d exporter python error in 2.63a blender all though I am using the right exporter script. I wonder what I am missing…

-Tommi

I have been very busy, but I will try to help posting the solutions I came up with, I hope it is on time to give some hints.
About python errors I am afraid I can’t help. (works fine for me in Slackware Linux 14.1 installing orgre exporter from jMe3 IDE into blender 2.63a, I got error using embedded blender or other blender versions).

First I will state that I was able to import makehuman 1.01 chars to blender, animate them, and them import them into jMe3.
I have both used bvh files for animations, and animated the chars with blender.

There are two options regarding how the animations will work on jMe3:
A single animation or an animation to each part of the char (body, eyes, clothes, …).

To have a single animation one has to unite all meshes of the char in a single mesh in blender.
If not, blender exporter will put each mesh animation under the specific mesh.

In case one has several mesh animations, there is a code I adapted from some explanations given by @Normen in a previous post that works fine:
(Just call setAnimation(String animation, float speed), making sure to declare the lists animChannels and animControls on your SimpleApplication class and add the code).

[java]


private List<AnimChannel> animChannels;
private List<AnimControl> animControls;

private void setAnimControls(Spatial spatial) {
if (spatial == null) {
if (animControls != null) {
for (Iterator<AnimControl> it = animControls.iterator(); it.hasNext():wink: {
AnimControl animControl = it.next();
animControl.clearChannels();
}
}
animControls = null;
animChannels = null;
return;
}

    SceneGraphVisitorAdapter visitor = new SceneGraphVisitorAdapter() {
        @Override
        public void visit(Geometry geom) {
            super.visit(geom);
            checkForAnimControl(geom);
        }

        @Override
        public void visit(Node geom) {
            super.visit(geom);
            checkForAnimControl(geom);
        }

        private void checkForAnimControl(Spatial geom) {
            AnimControl animControl = geom.getControl(AnimControl.class);
            if (animControl == null) {
                return;
            }
            if (animControls == null) {
                animControls = new ArrayList&lt;&gt;();
            }
            if (animChannels == null) {
                animChannels = new ArrayList&lt;&gt;();
            }
            animControls.add(animControl);
            animChannels.add(animControl.createChannel());
        }
    };
    spatial.depthFirstTraversal(visitor);
}

public void setAnimation(String animation, float speed) {
    for (AnimChannel animChannel : animChannels) {
        try {
            if (animChannel.getAnimationName().equals(animation)) {
                return;
            }
        } catch (Exception e) {
        }
        animChannel.setAnim(animation);
        animChannel.setSpeed(speed);
    }
}

private void checkGravity() {
    Vector3f dist = terrain.getWorldTranslation().subtract(characterNode.getWorldTranslation());
    if (dist.length() &lt; 24) {
        physicsCharacter.setGravity(dist.normalizeLocal().multLocal(9.81f));
    } else {
        physicsCharacter.setGravity(normalGravity);
    }
}

[/java]

1 Like

Thank you for the detailed information and pointers Duodecimo.

Much appreciated!

Br,
Tommi

Hi duodecimo

I am still working with the export. I have so far been able to export a simple human test model found from JME3 blender to Ogre XML guide. MakeHuman export with basic skeleton and Rigify support animates nicely in blender but export to Blender produces broken animation (all bent and twisted).

I am currently going through process of elimination to try to find the problem. Could you help me by answering the following questions:

  1. Were in JME3 release you found the ogre export script? I want to check if the blender to Ogre XML exporter script I found form the official site for 2.63a is the same you are using but I can not find it in the SDK. Could you put it in pastebin or such and link here?

  2. Were you using Rigify rig or did you rig yourself for inverse kinematics / did not use IK?

  3. Are you using Blender 32 or 64 bit version?

  4. Did you make any changes to the ogre exporter options?

Thank you again for the support,
Tommi

Hi

After experimenting with latest Blender 2.72 the process seems to work with:

This works with both MakeHuman basic and game skeletons if posed in Blender manually with plain skeletons or self made IK rigging but without Rigify.

I was able to make simple IK rigging and it worked without problems. There is either something fishy in the Rigify rig or a something is bugging in the export or JME3 side. I don’t think I will currently dive deeper in the Rigify problem but use custom rigging. If someone with more understanding wants to take a look then my rigify tests with basic MakeHuman skeleton can be found from here:

https://github.com/bubblecloud/jme3-open-asset-pack/tree/master/src/main/resources/character/human/male/basic_rigify

With Rigify I suppose one should get only the skeleton to be exported (no IK controls etc) and the IK poses should be project directly to the basic / game skeleton. This should be achieved with blender to ogre options export only deformable / animated bones unfortunately neither of options seemed to work with the Rigify rig.

If one loads the say the body mesh directly to JME3 then material file will be problematic as it is named same as the scene name.

Regards,
Tommi

Hi, Tommy!

I am glad to hear you got a solution.
But I am gonna try to answer some of the previous questions.

1) Were in JME3 release you found the ogre export script? I want to check if the blender to Ogre XML exporter script I found form the official site for 2.63a is the same you are using but I can not find it in the SDK. Could you put it in pastebin or such and link here?
In jMonkeyEngine SDK 3.0 main menu -> Tools -> OgreXML -> Install Blender OgreXML option, just navigate to the right place in your blender 2.63a.
2) Were you using Rigify rig or did you rig yourself for inverse kinematics / did not use IK?
I used the skeleton added by makehuman 1.01 (the simpler one offered). I used successfuly both animate the armature by myself in blender (for animation I used blender 2.7.0, I only used 2.63.a do to the ogre export), just a simple frame animation, no IK, and used bvh animations as well. The important thing is, first of all, as soon as the makehuman char is imported, to Apply Location, Rotation and Scale to mesh (all) and to skeleton. I had no need to create a root bone as recommended in a lot of tutorials I have read (I'd say it is no more necessary).
3) Are you using Blender 32 or 64 bit version?
All my software is 64 bits, as I am using Slackware Linux 14.1 64 bits version.
4) Did you make any changes to the ogre exporter options?
I just exported the scene, normally. I cant remember making any special change.

I hope this answers can be useful in some way.

Best Regards, have fun :smiley:

Hi

Thank you again. Did you notice that jme3 seems to only support export of animations from single NLA track. I tried first to have multiple NLA strips with and without export individual animations option but in each case I only got the first NLA track. It also seems that if you want blend animation to work to poses you need to have at least couple of frames per pose even if the frames are identical. Do you know if there is some other way to export single frame poses to JME3 and have smooth transitions between the poses?

-Tommi

Hi Tommi,

I know very little about blender and animation, but this is just what I do: I mount a single NLA track, making so that my animations don’t overlap. I never tryed to export a single pose, maybe if you create a animation with a single or a pair of poses, who knows. I believe that some of the limitations are imposed by the exporter, not jME3 itself :smiley:

Bumping this because I have the same problems. Has there been any fix to this in regards to being able to import .blend from MakeHuman files successfully? Currently I can get it working by exporting Ogre meshes but it’s a hassle because each mesh is created separately.

Cheers

By the way, even the Ogre export is bad - the meshes have holes where they should be joined…