[Solved] Can't import animations (blender->ogre exporter->jme sdk)

i checked skeleton.xml file, animation data is present there, but when try to use it my code i get this exception:
java.lang.ArrayIndexOutOfBoundsException: -3
at com.jme3.animation.CompactVector3Array.deserialize(CompactVector3Array.java:95)
at com.jme3.animation.CompactVector3Array.deserialize(CompactVector3Array.java:42)
at com.jme3.animation.CompactArray.get(CompactArray.java:132)
at com.jme3.animation.BoneTrack.setTime(BoneTrack.java:232)
at com.jme3.animation.Animation.setTime(Animation.java:110)
at com.jme3.animation.AnimChannel.update(AnimChannel.java:403)
at com.jme3.animation.AnimControl.controlUpdate(AnimControl.java:332)
at com.jme3.scene.control.AbstractControl.update(AbstractControl.java:112)
at com.jme3.scene.Spatial.runControlUpdate(Spatial.java:570)
at com.jme3.scene.Spatial.updateLogicalState(Spatial.java:688)
at com.jme3.scene.Node.updateLogicalState(Node.java:145)
at com.jme3.scene.Node.updateLogicalState(Node.java:152)
at com.jme3.scene.Node.updateLogicalState(Node.java:152)
at com.jme3.scene.Node.updateLogicalState(Node.java:152)
at com.jme3.scene.Node.updateLogicalState(Node.java:152)
at com.jme3.scene.Node.updateLogicalState(Node.java:152)
at com.jme3.app.SimpleApplication.update(SimpleApplication.java:244)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:151)
at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:185)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:228)
at java.lang.Thread.run(Thread.java:744)

Try to import the .blend directly?

yes, when i import .blend file animation works, but AnimControl object has no skeleton (is null). With ogre exporter AnimControl has skeleton (it also has animationMap HashMap loaded correctly), but activating animation causes exception

i need skeleton, because i want to attach extra bits to my model at runtime

I think you’re grabbing the wrong AnimControl then.

don’t think so, there is only one animation
I also get “Exception in control, scene content removed: java.lang.ArrayIndexOutOfBoundsException” when i open imported scene with scene composer

Well thats the same exception you get in your app… I’d still try and import the blend directly and open all nodes in the SceneExplorer, maybe you find another AnimControl as the 3.0 blender importer always creates an empty one for Spatial animations as well (which is mostly closer to the root node of the model so many people grab that first).

my blend file:

imported from blend file, animation works, no skeleton:

imported from ogre, animation causes exception, skeleton present:

blender version 2.69
jme sdk 3.0

What is the animation?

If it works from that imported blend then that indicates that it is not skeleton-based animation at all.

Ah yes, solved it. The problem was me not knowing wtf is happening in blender. After adding armature modifier I clicked “Apply”, it applies deformation from current animation frame to mesh and removes the modifier, thus no skeleton.

It’s funny though how blend and ogre files yield opposite results, as if it was intentionally made that way to fuck with noobs like me :smiley: