Running a blender animation in jMonkeyEngine

I’ve created a model in Blender, and added an animation for a part of that model. When I try to run that animation in jMonkeyEngine, the part that I am trying to animate is displaced and overlaps with the main body. I am still trying to figure out what has gone wrong, I thought that if I run the animation in jMonkeyEngine I should get the same result as in blender.

Anyway, my questions are ,

Are there any guidelines that I should follow while creating a blender model and adding an animation to it so that it would work properly with jMonkeyEngine?

Did anyone face a similar problem and knows what might cause this?

I assume you are exporting with the Ogre Exporter?
There are a few tricks to it, but it does work: https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:ogrecompatibility

Make sure your model’s location, scaling and rotation are all set to zero (in blender). This sounds like a scaling issue.

I’ve imported the model .blend file directory, does it work or should I export through OgreXML? I’ve just animated a part and parented it, is that enough or should I create an armature?

JME supports only armature animations atm. So this is the way to go…

JME also supports spatial animation so if your animation consists of basic transformation (translation/rotation/scale) of the object, it should work.
Mesh animation (aka Pose animation) is not supported atm.

1 Like

Sorry. I presented thing too quickly.

Of course, JME supports spatial animations… But it does not import them from blender.

Sorry for that :frowning:

Sorry but I got a little bit confused. just to make sure I understand everything, my options are (please correct me if I am wrong):

1- You can add a skeleton to your model, animate it, import the .blend file to your workspace and you can run the created animation
2- you can animate the object through jme and just supply a model through blender

are there any advantages to exporting the model through OgreXML exporter? I’ve tried importing the .blend file and it seemed to work for another simpler model.

does the importer has any limitation on the complixity of files being imported? I’ve downloaded a complex model for a tank in 3ds format, imported it in blender and it had heaps of verticies, parts, materials, added a simple animation to it and tried importing it into jme sdk with no luck… I cant provide the stacktrace right now but I will add it later on.

The direct blend import works very well for simple models, however I’m not sure what the state is on importing animations. Last I heard for skeletal animations you had to go blender->ogre->jme3 to get the skeletal animations across.

@yang71 said: Sorry. I presented thing too quickly.

Of course, JME supports spatial animations… But it does not import them from blender.

Sorry for that :frowning:


Actually, yes it does, with the blender loader. It doesn’t with Ogre I believe.

So I’ve gone through the whole thing again, I’ve tried to follow the links normen posted in the thread " http://hub.jmonkeyengine.org/forum/topic/importing-models-with-animations-from-blender/". what happens now is that I imported the model successfully, and I can see it when I run the application, but I still have two problems,

  • when I attach a debugger to the skeleton I only see the base bone, although I have one other child bone.
  • when I query the control for the animations, I get one which has the name “my_animation” which is not the animation that I have in the nla track

I’ve checked the skeleton xml file, I can find the missing bone and animation there… What am I missing? any help would be much appreciated

Actually, yes it does, with the blender loader. It doesn't with Ogre I believe.

Oh, it does ? Well that’s amazing!
That’s a pity I didn’t know that :(.

Blender loader becomes more and more interesting!

Edit : I confirm Ogre loader does not.

@oskanaan said: So I've gone through the whole thing again, I've tried to follow the links normen posted in the thread " http://hub.jmonkeyengine.org/forum/topic/importing-models-with-animations-from-blender/". what happens now is that I imported the model successfully, and I can see it when I run the application, but I still have two problems,
  • when I attach a debugger to the skeleton I only see the base bone, although I have one other child bone.
  • when I query the control for the animations, I get one which has the name “my_animation” which is not the animation that I have in the nla track

I’ve checked the skeleton xml file, I can find the missing bone and animation there… What am I missing? any help would be much appreciated

  1. is normal, JME Bones are more joints actually, so basically you see 2 dots linked by a line, that’s normal.
  2. is because you didn’t pack your animation as an NLA track. check out this video tutorial (NLA setting is discussed around 2:30) blender to jme3 though ogre XML - YouTube
1 Like

Yep, I’ve got it in one track, only one animation but still no luck :frowning:

I’ve seen that for the animation to be exported to ogre xml, it must be active… That is it must play within Blender.
If your timeline contains twice your animation, this animation will be exported twice also.

For BenderLoader, I don’t know…

Its working now, but how did it work that I dont know :), all I did was playing the animation in scene composer and then when I inspect the value of getAnimationNames I get my animations there, this doesnt make sense but if I come across the same problem again and find the solution for that I will post it back on this thread …

1 Like