Blender Model Missing SkeletonControl in SceneExplorer

Hi!

I’m new with the monkey engine and I’m trying to import a blender model I’ve created which is a really simple “tower defence gun”, basically just a cube and a sphere with a cylinder as the gun. I have attached an armature bone to be able to rotate the sphere/gun. In blender this works fine, and I have created an animation as well (rotate the gun 360 degrees).

However, when I’m converting the blend file into the j3o format and edit the model in the scene editor, I’m missing the Skeleton Control node in the SceneExplorer. I have read tutorials about blender importing, and the center pivot and the base of my single bone is at 0,0,0 in blender. My Ogre3D exporter fails though, so I haven’t really tried that way. But shouldn’t the blender importer support just simple objects like this? Also there are no materials/uv’s defined yet, just two objects and one armature bone and one animation.

Best Regards,
Mats

Make sure the animations are actually packed in the file (“F” button)
https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:external:blender

Thanks for the quick reply, normen! Pressing the F button didn’t do anything I could notice - I already had the AnimControl in SceneExplorer. However, I’m not really going to use the animation - I want to rotate the bone by code. My challenge is that there is no SkeletonControl present, so when I call the getSkeleton method on the AnimControl object I obsiously get a null pointer exception. Any other tips will be greatly appreciated!

Could it be you get the wrong AnimControl? Check further down the model hierarchy.

[java]
SceneGraphVisitor visitor = new SceneGraphVisitor() {
public void visit(Spatial s) {
if (s.getControl(AnimControl.class) != null) {
animControl = s.getControl(AnimControl.class);
Skeleton skeleton = animControl.getSkeleton();
System.out.println("Skeleton is null: " + (skeleton == null));
}
}
};
towerSpatial.breadthFirstTraversal(visitor);
[/java]
Output: Skeleton is null: true

I think I’m doing something wrong in blender, since I can see the SkeletonControl if I open the Sinbad model in the SceneComposer. Don’t know if it’s relevant, but I can play the animation in blender, but it won’t play in the SceneComposer.

Finally solved! 8) When I made the armature parent to the mesh, I picked the wrong option. Use set parent to armature deform and not to bone. I first used bone because I couldn’t get the gun to rotate in pose mode otherwise. Thanks again for helping out normen.

1 Like