Animation plays in SDK but not in Code?

Hello dear community,

for my game I exported an animated model from blender to my assets folder through ogre. In the SDK I can open the model and view the animations. The animations are played properly in the SDK.

Now, in code if I set an animation nothing happens. The model remains in its t-pose position. This never happened to me and this is not the first animated model I work with, so that’s really strange! I mean, if it works perfectly in the SDK, why shouldn’t it work in code as well?

I use the latest blender (2.79) and ogre (0.60) version. The model does not have a normal map.

Here a small test case. Nothing special as you can see.

public void simpleInitApp() {

    // demon model does not work
    Spatial demon = assetManager.loadModel("Models/Monster/Demon.j3o");
    AnimControl control = demon.getControl(AnimControl.class);
    AnimChannel channel = control.createChannel();

    // player works perfectly
    Spatial player = assetManager.loadModel(ModelType.Player);
    AnimControl control1 = player.getControl(AnimControl.class);
    AnimChannel channel1 =control1.createChannel();


    AmbientLight light = new AmbientLight();


Hopefully, somebody can help me.

Best regards

So, I finally figured it out. In my case I need to disable hardware skinning like this.

SkeletonControl skeletonControl = spatial.getControl(SkeletonControl.class);

Then the animations work. But I was told that disables HwSkinning has a negative effect regarding performance. So why does this model not work like any other? Are there some special settings in Blender I need to consider? (By the way, the model is not created by me).


Hmmm I just checked and my game has multiple models that uses hardware skinning and works fine. I’m not sure if this is of any help, but while I was working on that model it gave me this notification and I thought it could possibly be relevent to help you find the cause:

Material instances cannot be shared when hardware skinning is used. Ensure all models use unique material instances.

1 Like

Hey Dominic,upload your model so that we can have a look at it :slight_smile:

1 Like

Thanks for your answer. I had a look at the model again and it actually had several geometries using the same material. I have batched them into one geometry, but unfortunately I still need to disable hardware skinning to make it run the animation.

Alright, here is the model file (without texture):

FYI, this issue is fixed in jME 3.2

So I imported your model in the SDK 3.1 and no animation plays in the SDK.
None plays in code either,using the code you provided.
But it plays normally when I disable the hardware skinning.

Hi, okay, I think I know why I get this behavior. I use one of the latest builds of the SDK, which is newer than the version I use in my main project. (I work in another IDE). So it seems I don’t have the fix @Momoko_Fan talked about. I will try to use a newer build then.

The shared instances were only a warning that jme will now clone the marerial to use hwskinning, I think?

However this new Animation Feature is unsupported in 3.1, so j3os arent backwards compatible

That cannot be right, the Jaime J3O is a jME 3.1 model, but it still works in jME 3.2

I took it the other way… a 3.2 j3o won’t run in a 3.1 SDK.