I’ve been fiddling around with some animated objects in JME. However I keep running into the same two errors the first one is the can’t find animation error. I’ve tested the animations in the scene editor so I know they work and I can clearly see the name of the animation.
The second issue is the
control = player.getControl(AnimControl.class);
Fails to load the animation control. I have to create a new instance of the control in order for the sample to even work. Here is the code I have been using.
control = new AnimControl();
viewPort.setBackgroundColor(ColorRGBA.LightGray);
initKeys();
DirectionalLight dl = new DirectionalLight();
dl.setDirection(new Vector3f(-0.1f, -1f, -1).normalizeLocal());
rootNode.addLight(dl);
player = (Node) assetManager.loadModel("Models/bricky/bricky.j3o");
// player.setLocalScale(0.5f);
player.addControl(control);
rootNode.attachChild(player);
control = player.getControl(AnimControl.class);
control.addListener(this);
channel = control.createChannel();
channel.setAnim("ArmatureAction");
It fails at the setAnim method with the message it can’t find the animation.