Can't find animation?

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.

Doe it work if you start it via the SceneExplorer? That should give you an idea what you’re doing wrong. Probably the AnimControl is on a sub-spatial and not the root node of the player.

Yes , it works in scene explorer and yes the animation control is buried a few nodes deep with the bones. The object seems to have to animation controls as well. One that plays and the other does nothing.

The one that plays is located root > bricky > cube > AnimControl

So theres your answer. You need to do player.getChild(“NameOfTheNodeThatContainsTheAnimControl”) somewhere

You’re my hero Norm. I overlooked that.