How to make animated Models?

In the Manual it talks about Models with several animations like “walk”,“jump”, “attack” aso. But i do not understand how to archive that?

It’s literally as simple as adding the multiple actions you want to the model’s armature in blender, then exporting the model as gltf into jme. You may need to push each action into blender’s NLA editor, otherwise the actions might not get exported.

I mean in blender

Look, I am trying to help you out, but you really need to provide more information on what exactly you’re struggling with. That way we can arrive at an answer much faster. Too much information is waaay better than not giving enough information.

For creating animations with blender, you should look into tutorials specifically for blender. I can definitely recommend BlenderGuru, which is how I initially learned blender.

If you’re still struggling to understand how to get it to work nicely with jme, here’s what I do:

  1. Setup: 3D viewport, Dope Sheet (action editor mode), NLA editor.
  2. Select the armature to animate, switch to pose mode, and create a new action in the dope sheet.
  3. Create an animation for the new action.
  4. In the NLA editor, push down the action, and mute the resulting channel.
  5. Create a second action in the dope sheet.
  6. Create an animation for the second action.
  7. In the NLA editor, push down the second action, and mute the resulting channel.
  8. Export with GLTF. Make sure the appropriate animation and skinning settings are enabled in the exporter.

Now we get to my question

How do i Create an animation for the new action?

And how do I do the last step?

What are the corresponding animation and skinning settings?

There are plenty of tutorials that answer this question. Please look at them.

Just make sure animations and skinning are enabled in the exporter panel. They should be enabled by default anyway.

Your AnimComposer is null.

And why ? I set it to something

How should I know? You won’t post any code.

Sorry here is the code




The AnimComposer is probably not attached directly to animatedModel, in which case you’ll need to look around for it.

AnimComposer animComposer = null;
for (Spatial s : new SceneGraphIterator(animatedModel)) {
    animComposer = s.getControl(AnimComposer.class);
    if (animComposer != null) {
        break;
    }
}
if (animComposer == null) {
    throw new NullPointerException("Failed to locate AnimComposer");
}

PS: please copy/paste your code directly into the forum next time, instead of taking actual pictures of it.

Where should i put this Code?

It worked but now the Model won’t animate

the Animation won´t play now

You should play it.

1 Like

what do you mean?

Fix the thing so it works.

Pspeed is facetiously putting as much effort into answering your questions as you are putting into asking them.

People are helping for free so the quid pro quo is that your questions should be clear, detail what you’ve tried (including nicely formatted code; not photos of your screen - also why is your indentation all over the place, i would struggle to understand code with that level of random indentation) and precisely how it didn’t work.

1 Like