Hello everyone,
today I tried to start with animations again, after focusing a lot on game dynamics/mechanics.
As always, it started off with a NPE. Great.
This is what I did:
- make a model in Blender
- export it as .blend
- import it an convert it to .j3o (while doing this, I got triangulation warnings and “Animation found: ArmatureAction”)
- Try if the model is displayed (it is)
- Copy/Paste code from the beginner tutorial
When getting theAnimControl
, it returns null (which I find strange).
Here is what I did:
@Override
public void simpleInitApp() {
createEnv();
Node creature = (Node) assetManager.loadModel("Models/creature.j3o");
rootNode.attachChild(creature);
animControl = creature.getControl(AnimControl.class);
animControl.addListener((AnimEventListener) this);
AnimChannel chl_walk = animControl.createChannel();
chl_walk.setLoopMode(LoopMode.Loop);
chl_walk.setAnim("ArmatureAction");
}
If you need more code or the model, feel free to ask.
I think there’s something wrong with importing, but I wanted to ask about the code anyway.