Using git-head (3.1-alpha-svn) code for importing blender model (or converting to j3o via context menu) causes an exception.
The exception stacktrace:
[java]
SEVERE [org.openide.util.Exceptions]
java.lang.NullPointerException
at com.jme3.animation.SkeletonControl.cloneForSpatial(SkeletonControl.java:378)
at com.jme3.scene.Spatial.clone(Spatial.java:1185)
at com.jme3.scene.Node.clone(Node.java:565)
at com.jme3.scene.Node.clone(Node.java:60)
at com.jme3.scene.Spatial.clone(Spatial.java:1172)
at com.jme3.scene.Node.clone(Node.java:565)
at com.jme3.scene.Node.clone(Node.java:60)
at com.jme3.scene.Spatial.clone(Spatial.java:1172)
at com.jme3.scene.Node.clone(Node.java:565)
at com.jme3.scene.Node.clone(Node.java:60)
at com.jme3.scene.Spatial.clone(Spatial.java:1214)
at com.jme3.scene.Spatial.clone(Spatial.java:66)
at com.jme3.asset.CloneableAssetProcessor.createClone(CloneableAssetProcessor.java:48)
at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:327)
at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:374)
[catch] at com.jme3.gde.core.assets.SpatialAssetDataObject.loadAsset(SpatialAssetDataObject.java:94)
at com.jme3.gde.core.assets.actions.ConvertModel$1.run(ConvertModel.java:60)
at java.lang.Thread.run(Thread.java:745)
[/java]
When using 3.0 stable (code from googlecode svn (branches/3.0final) import finishes successfully.
When using 3.x (code from googlecode svn trunk) -> the same error;
When using head from git -> the same error;
The blender file has to have an armature parented to mesh.
When looking at the SkeletonControl code the code is looking for an AnimControl object in cloned spatial, which has got none (none was cloned during clone spatial?). The code for Spatial (just above in callstack) iterates through spatial Controls (which are available) and run cloneForSpatial on new Spatial.
[java]
AnimControl ctrl = spatial.getControl(AnimControl.class);
SkeletonControl clone = new SkeletonControl();
clone.skeleton = ctrl.getSkeleton(); // !!!NPE!!!
[/java]
It seems that cloning does not copy the control classes or something other happened. I haven’t found simple and easy solution for this error and thus reporting it here. I still will try to find a fix.