Makehuman character export to blender and then animation in jmonkeyengine

Hello everyone,

I want a character animation and for this:

  • I have made a character in MakeHuman application, exported it in .mhx format, and then imported it in blender.
  • I then followed the tutorial “Animations in Blender 2.61 and JME3 - YouTube” to animate my character
  • I then exported the model as Ogre 3D(.scene and .mesh)
  • I then import the Ogre model in jmonkeyengine

The problems i am having:

  • Only the .mesh and .skeleton files are created but no material files
  • So in jmonkeyengine my character is just a red coloured image

Regarding animation:

  • I make 2 animations in blender “head movement” and “walk”,
    -The red coloured girl image in jmonkey plays only the last animation that i have played in blender (if the last animation that i played in blender was head movemenet, in jmonkeyengine it only plays headmovement even if i call it for a walk).

  • If i import the blender model inside jmonkeyengine instead of the Ogre mesh, and use the .j3o file, it gives me null pointer exception at “control.addListener(this)”

Anyone can help me please to get out of these problems :frowning: i amstruggling from 2 days,

Thanks a lot,

Ayesha

@ayesha-kashif said: - If i import the blender model inside jmonkeyengine instead of the Ogre mesh, and use the .j3o file, it gives me null pointer exception at "control.addListener(this)"

Most likely you are retrieving the control incorrectly. When reading a model from .blend, chances are it’s a Node with many children… one of those children will have the control. You can see this easily in the scene explorer.

1 Like

Could you upload the model so that others can help investigate this issue?

Here is the model:

Ayesha

If you could struggle a few days more, fix it and then make a rundown in the wiki, that would be helpful. :slight_smile:

pspeed, here is the image for what i can see in scene explorer…

@pspeed said: Most likely you are retrieving the control incorrectly. When reading a model from .blend, chances are it's a Node with many children... one of those children will have the control. You can see this easily in the scene explorer.

Yes i have seen in the scene explorer and uploaded an image above as well. My animations are inside:

girl --> girlBody --> AnimControl

Although there is

girl --> AnimControl

but there is no animation

In my code i use :

control = player.getControl(AnimControl.class);
control.addListener(this);
channel = control.createChannel();

Can you please tell me how i can correctly retrive the control?

Thanks a lot…

@normen said: If you could struggle a few days more, fix it and then make a rundown in the wiki, that would be helpful. :)

Yes for sure …

@ayesha-kashif said: Yes i have seen in the scene explorer and uploaded an image above as well. My animations are inside:

girl --> girlBody --> AnimControl

Although there is

girl --> AnimControl

but there is no animation

In my code i use :

control = player.getControl(AnimControl.class);
control.addListener(this);
channel = control.createChannel();

Can you please tell me how i can correctly retrive the control?

Thanks a lot…

http://hub.jmonkeyengine.org/javadoc/com/jme3/scene/Node.html#getChild(java.lang.String)

1 Like
@pspeed said:

http://hub.jmonkeyengine.org/javadoc/com/jme3/scene/Node.html#getChild(java.lang.String)

Thanks, pspeed for your kind help, the null pointer error is resolved.

So, now i am attaching each node to the rootnode, i.e. the character’s body, hair, clothes etc.

Still a problem that the clothes, hair etc are transparent. When i attach them i can see them there but as some transparent things :frowning:

Anyone have an idea why is it so?

Thanks again all of you for your help,

Ayesha

Although my nullpointer exception is gone and now i am playing the animation on girlBody node.

But this way only the body plays the animation and the hair and clothes (which for the moment are some white things) remains static.

The animation is appliaed to each part seperately (body, clothes, hair etc). but i need it as a whole on my character.

But how i can manage this in blender? any tips please?

Thanks,

@ayesha-kashif said: Although my nullpointer exception is gone and now i am playing the animation on girlBody node.

But this way only the body plays the animation and the hair and clothes (which for the moment are some white things) remains static.

The animation is appliaed to each part seperately (body, clothes, hair etc). but i need it as a whole on my character.

But how i can manage this in blender? any tips please?

Thanks,

You have to play the animation on all of the animation controls.

1 Like
@pspeed said: You have to play the animation on all of the animation controls.

Thanks pspeed, now everything is fine … except the clothes, shoes etc which are some transparent things rather then the real clothes or shoes etc.

@ayesha-kashif said: Thanks pspeed, now everything is fine ..... except the clothes, shoes etc which are some transparent things rather then the real clothes or shoes etc.

A picture is worth a thousand words.

@pspeed said: A picture is worth a thousand words.

:slight_smile: well said,

The character in makehuman:

when i import in jmonkey:

inside jmonkey:

Thanks,

New proverb from 2014 : “A picture on imgur is worth a thousand pictures on dropbox”

I like the transparent clothes…and just out of curiosity… what are the animations on the girl_tongue01 Node? :smiley:

First check the material, does it uses material colors (“useMaterialColors” checked). Is the diffuse color alpha something different than 1? if so set it to 1.

Else check the textures, maybe they have a non 1 alpha channel.
Then, check for each geometries that they are in the opaque bucket.

On a side note, this model is really not optimised for a game engine. The fact that you have fully modeled toes hidden by shoes it a huge waste of resource. Same for the legs and so on. Idk if makehuman has an option for that, but if it doesn’t IMO that would make it a no go for me.
I guess it’s ok if you have only this model…but still you should look into it.

1 Like
@nehon said: New proverb from 2014 : "A picture on imgur is worth a thousand pictures on dropbox"

:slight_smile:

Well, thanks for your reply and advices, one of them really worked… as shown in the image. I unchecked the alpha option and finally clothes are no more transparent.

@nehon said:

I like the transparent clothes…and just out of curiosity… what are the animations on the girl_tongue01 Node? :smiley:

hehehe… no i took out the tongue and teeth this time as i am not using them…

@nehon said:

On a side note, this model is really not optimised for a game engine. The fact that you have fully modeled toes hidden by shoes it a huge waste of resource. Same for the legs and so on. Idk if makehuman has an option for that, but if it doesn’t IMO that would make it a no go for me.
I guess it’s ok if you have only this model…but still you should look into it.

Yes, i will check for it… Also i have entered this gaming world a month and a half before…so not an expert but will try to optimize the stuff…

Thanks again,
Ayesha