I made a model by myself in Blender and it does not include the AnimControl in the JME.
I did not use IK or something weird. It is a simple animation with a simple model.
Well, in Blender at the NLA tracks, when I clicked in that symbol that looked like a snow icon, i saved it and opened in JME, and it worked. The animation was a little messed up, but It was playing. And, in this second time, there was a SkeletonControl. So, I don’t know what is happening…
You can right click the model in the Projetcs tab and select “View model” to view the model instead of running the game. You can also see how is your model structured.
Your SDK crashes when you try to open the SceneComposer? The SDK is probably corrupted. I suggest you to reinstall the SDK, since the SceneComposer is a REALLY HUGE help to create a game.
the problem is in your code when getting AnimControl
Try to do something like this to get the anim controller.
The code is a bit messy . but is understandable.
player = (Node) assetManager.loadModel("Models/Test.j3o");
// player.rotate(0, FastMath.DEG_TO_RAD * 180, 0);
rootNode.attachChild(player);
List<Spatial> sp =player.getChildren();
int i=0;
for(Spatial s : sp)
{
i++;
System.out.println(" Main for.. round: "+i );
addLodControl(s);
}
}
public void addLodControl( Spatial parent) {
if (parent instanceof Node) {
System.out.println("I AM Node .... Name:"+ parent.getName() );
control = parent.getControl(AnimControl.class);
if(control != null)
{
System.out.println("Control Not Null ....");
control.addListener(this);
for (String anim : control.getAnimationNames()) {
System.out.println("Anim name :"+anim);
}
channel = control.createChannel();
channel.setAnim("Hi");
}
for ( Spatial s : ((Node) parent).getChildren()) {
addLodControl(s);
}
}
Problem fixed, and I understood something important.
With the System.out.println in your code Ali_RS, I understood, how to fix that problem easier, because the names inside of blender are the same as the nodes inside of the JME.