Import Blender model with animations

I’m have issues importing a Blender model with an armature and animations using recent JME3 builds. An example model can be downloaded from https://code.google.com/p/bats-game/source/browse/trunk/assets/Models/units/bob/bob.blend

It’s quite possible I’ve done something odd or unsupported in Blender. However, I’ve found some evidence which suggests this could be a regression in JME3’s importer.

If I convert the bob model to J3O using the IDE (which uses 3.0.4 libraries) I get good results. For instance, the B-B animation looks like this:

But if I convert using an up-to-date trunk build (rev10956) the B-B animation winds up with both its forearms bent out of shape:

The other four animations have similar issues, all in the arms.

Due to various unrelated bugs, hanging back with 3.0.4 is not a good workaround for me, so I’d like to figure out what’s going on here. Any theories?

2nd attempt to inline the images:

@Kaelthas, I would very much appreciate your insight here.

Few days ago I’ve provided a fix for the simple action animations from Blender without Skeletons. http://hub.jmonkeyengine.org/forum/topic/blender-objecthelper-bug/page/2/

It might as well be that the bugfix solved one bug but created an other. Because I haven’t tested it with skeletons. If you go back before revision r10946 does that solve your problem?

2 Likes

Hi @sgold

I have had similar issues with some of my models. I have been tracking this bug for some time. But thanks to your model I am now almost sure that the problem is not
with computation but with assigning tracks to animations.
Blender (I belive) does not attach action (Animation in JME) to the model. It stores them separately and this causes that I cannot assign a list of actions to a certain model.
In blender you can use one action in several different models and they should work as long as you name the bones alike.

That is my guess for now. If I am wrong please someone correct me because I do not follow blender’s approach to animations in 100% :wink:

I will let you know if I find anything out.

2 Likes
@arpagaus said: Few days ago I've provided a fix for the simple action animations from Blender without Skeletons. http://hub.jmonkeyengine.org/forum/topic/blender-objecthelper-bug/page/2/

It might as well be that the bugfix solved one bug but created an other. Because I haven’t tested it with skeletons. If you go back before revision r10946 does that solve your problem?

I’ll do a bisection search to figure out which commit(s) caused the bug and report back.

@sgold said: I'll do a bisection search to figure out which commit(s) caused the bug and report back.

All 5 of the animations in my Blender model imported fine prior to November 3rd. It appears that rev 10872 broke the import of the trail.L and trail.R animations.

I haven’t yet figured out when the other animations stopped importing properly.

Thank you for your response, @Kaelthas. Let me know if there’s anything I might do to help you understand the problem.

I’m puzzled by your comment about assigning tracks to animations. The list of animation names in the imported J3O matches the list of actions in the dope sheet of the original Blend file, more or less. It looks to me as though the importer is distorting the mesh for some reason. How could that not be a problem with computation?

I took a look at the rev10872 diffs but (as expected) I couldn’t make much sense of them. I’m curious what “static pose transformations” are – in case I inadvertently included some in my Blend file.

After deleting the model’s wrist, forearm, and elbow bones and reassigning their vertices to the upper arm bones, I managed to import successfully using rev10872. This makes me hopeful that I can work around whatever went wrong there.

After some trial and error, I found an acceptable workaround, which I’ll describe here in the hope that others will find it helpful.

The bob.blend file I committed on Jan. 4 (rev 663) was saved in pose position. If (in Blender) I go into the armature’s object properties, change the skeleton from pose position to rest position, and save, JME3 imports the model’s animations correctly.

@sgold
yeah that must be the pose positions.
I disabled them now, and my model also works good.

I will do some tests but it looks like I will need to discard pose loading.

2 Likes

Hey @sgold
I have just made a commit.

Since I made one very important change, please read this:
http://hub.jmonkeyengine.org/forum/topic/changes-to-animations-loading-in-blender-importer-important-for-importer-users/

Hope it will work well now.
And if not - let me know :wink:

1 Like