I am getting an error when I try to use an animation that I created in blender and exported using blender2ogre. If I read correctly, JME was made to use ogre files so that’s why I went this route.
I export my model and I get the mesh and material files as always. I also get a two skeleton files, one being an xml. I open the file and I see this.
<animation name = "my_animation" blah blah>
So I am assuming that the animation was exported correctly. I am getting an error though when I try to load the animation.
channel.setAnim("my_animation", 0.5f);
channel.setLoopMode(LoopMode.Loop);
The error being: Cannot find animation “my_animation”. All of my files are in a folder and the model and texture load correctly. I am wondering if I am using the animation class wrong or loading it wrong?
Spatial mushroom = assetManager.loadModel("Models/MushroomAnim2/mushroom.mesh.xml");
Then I use this spatial within my PlayerNode class.
control = new AnimControl();
control.addListener(this);
channel = control.createChannel();
The player node class extends Node and implements AnimEventListener. The above code is in the Initialize method. Am I loading the animation listener wrong? Or is it an error in my exported files somewhere?
Edit: I’ve noticed in the tutorials when creating an AnimControl, they use player = this.getClass(AnimControl.class); I don’t know if creating a new AnimControl has anything to do with it, but its just a thought.