NPE in AnimControl.resetToBind

I wonder what can cause such error when loading an Ogre xml model with skeleton (but with no animations added):

[java]java.lang.NullPointerException

at com.jme3.animation.AnimControl.resetToBind(AnimControl.java:326)

at com.jme3.animation.AnimControl.reset(AnimControl.java:315)

at com.jme3.animation.AnimControl.<init>(AnimControl.java:122)

at com.jme3.scene.plugins.ogre.MeshLoader.compileModel(MeshLoader.java:730)

at com.jme3.scene.plugins.ogre.MeshLoader.load(MeshLoader.java:776)

at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:224)

at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:346)

at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:356)[/java]



I have a tool that created for me some models in xml format and 3 of them load correctly and 1 does not, and this is not only in JMonkeyEngine but also in Ogre viewers. Checking files against DTD doesn’t reveal any errors in file structure so it must be something with data, but I don’t get a clue what? A bad reference between bones and vertices?

Apparently the bone index buffer is null, have you got a skeleton file with the mesh file?



If the model can’t be loaded by OgreViewer, there is very little chance it can be loaded by JME.

Maybe you should post on the ogre forum, or on a forum related to the tool that generated the xml, you are talking about.

Yes, I have the skeleton file. 3 other models created with my tool load properly. This, 4th one, loads only if I remove skeleton information from it (so the meshes themselves are correct).



I see there is one submesh with no bone assignments at all. Maybe this causes the bug?

maybe…it’s hard to figure out the issue just by reading a NPE stack trace :stuck_out_tongue:



Could you upload the file, maybe that can help.

Should be fixed now