Split Animations

@Normen: Did not want to hijack the other thread…

I know the tutorial you posted. Read it several times and still got problems with the animations. I have a model
with one long animation and want to split it to seperate animations. I could manage to import it into the sdk, however
animation does not work.

This is most probably due to my lacking blender skills, but any hint is welcome:)

I’m using animations (without IK) and directly importing the blend file in the SDK.

You can create multiple animations in blender (they are called actions) and split your animation there - then you can just play the animation you want when you want it.

Hi, thanks for the reply.

I am importing the model intor blender using the milkshape version and then directly import the blender file into the sdk.

When using “as-is” the model cannot be imported. There is no error message, or warning - it just cannot be imported. When
I go to the dope sheet and remove the action it is imported just fine (textures, model, but of course no animation).

“Out of desperation” I tried it again and removed a lot keyframes (the whole animation has about 2300 keyframes) so that the main animation
only has 230frames. And then i was able to imported it (only get a warning about Unsupported modifier type: EdgeSplitModifierData
but that is ok). Now I got 3 AnimControls. One under the armuature node (with the animation “full”), one under the modelnode without
any animations and a second one under the modelnode also with the “full” animation. Only the last one does anything. But now at least
there is something working - the animation is still not correct (just wobbling arround - sorry found no better word for it),

I have already corrected the skeleton (there have been two root bones - one without children and another one with all the subbones. I put
the one with the children under the empty one). And I think the root bones location is also correct - still no change. The animation looks
ok in blender…

Dont get me wrong - I still think that its my fault, but maybe you can guess whats wrong and help me out.

Sorry, I’m noob at animation myself. Maybe one of the others will know more tho.

Thanks anyway!

The Blender importer cannot handle a lot of the constraints in Blender. For simple rigs it works great, but I would try export the animations to Ogre XML, making sure that you follow the guidelines, i.e single root bone at (0, 0, 0), apply all other modifiers etc.

Hmm - I tried to avoid to have one additional script/dependency (Ogre XML) in my pipeline. Before JME I was using Ogre and the
blender exporter was a “pain in the …” very often (especially when there were new blender version available).

Anyway, I will try it with it. And if its working I try it again with the direct blender imported and maybe I can find out whats missing
and maybe also providing a patch… Just maybe;)

In terms of patches/etc there is already some work in progress. You should look at forum threads by @kaelthas - in particular on IK stuff.

Ah, I see - and I will;)

Do it like outlined here, step by step. If it doesn’t work, try again until it does: https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:external:blender#animations

I already did it like this and also with this “new” example blender animations file. It worked in both cases. But when I try it with the
imported milkshape model, it does only wabble arround.

I have spotted a difference between the imported action and the one of the example.

The example looks like this:
Screenshot1
And the imported one:
Screenshot2

But I am to noob to make a sense out of it - yet.

Sounds like it would be easier if you re-rig the model yourself instead of finding out whats different.

Hmm… Still hope there is a better solution. Idea behind buying a rigged and animated model was that I do not have to do it by myself…

Seems the animation is “baked” into poses - maybe thats the reason… will do further research…

Btw. the models are from dexsoft. Does anybody have experience with animated models from them?

Well I have a similar problem:

I have a very long animation containing several others, as ogre xml that works fine when imported, now I know the frame numbers I would need to split it to create the real single animations.

It loads fine with jme3(with the provided mesh.xml, It also loads fine with Ultimate Unwrap 3d(dae).

I finally also was albe to get in in blender, by loading the dae with a old blender version, save, load blend with new version, rotat everything 90°, however currently the blender importer does not seem to load my animation, I wonder why, no errors in console, yet i can’t find a AnimControl with a SceneGraphVisitor

Any suggestions on how i can accomplish what i need (either split the animation in the mesh.xml or get the animation to load from blender?

jfyi - I am working on a blenderimporter fix, and if this is done also on a animation split tool in the scenecomposer.
I let you know as soon as something is working. Currently the animation is loaded but not played correctly - the model
still “wobbles” around…

1 Like

@Empire Phoenix: Can you check if the vertex groups have the same names as the bones in blender?

The animations are working now. A little explanation for those who are interested.

First I used the Milkshape importer for Blender. Everything seemed to be fine, but it wasntXD
After a little debugging session I got the reason. The animation/action is supposed to have
groups, but the imported animation didnt have. So the imported made a SpatialTrack instead
of a BoneTrack. When playing this caused the “wabbling” effect. I guess because all modifiers
(dont know if this is the correct term) are only applied to the root bone, instead the correct one.

These missing groups also caused the strange view (screenshot) in blender you see in my previous
post. I guess this is because the milkshape importer was developed for blender < 2.5.

However, then I tried it with the collada importer. Mesh and animation have been imported - the resulting
blender file was about 120mb and caused a OutOfMemoryException during the import. The reason
for this big size is the amount of keyframes - there are 25/sec. To test it, ive deleted 80% of the keyframes.

The import was successful, but no visible animation. During the debugging I saw that now a BoneTrack
is created. I used the little skeleton debugger from jme3:external:blender.

And there I saw that the bones are moving correctly during the animation - so there was a problem with the
rigging.

After a few checks, I found the reason: The vertex groups did not have the correct names (must correspond
to the bone). The reason for that seems to be a bug in the collada importer from blender 2.66a - with 2.65
the vertex group names are correct.

With Blender 2.65 the animation went through the SDK import and now I see the animation in JME - at least
the first 10% frames.

To import the whole animation I needed to find a way to reduce the keyframes. Furtunately there is a standard
Blender addon which does exactly this. Called “Simply Curve” and is shortly explained in:
tip-simplify-animation-curves/

In my case, a setting of 0.2 reduced the keyframes to a reasonable amount and now the whole animation has
been imported into JME and is running smoothly.

Now I will start with the splitter - either I will write a little Blender script or add the functionality to the
scenecomposer. I will let you know as soon as there is something useable…

4 Likes

^Hm Vertex must be same as bone name, that could be the problem I have , lets check :slight_smile: