Blender Animations

Hi,

I have a little problem with my animations…i use blender 2.69 and i’ve followed all the verifications from here : https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:external:blender
When i export my model and open it in the SDK i get a node with 2 children a geom (my model) and an animControl with my animation…so everything is ok…but when i try to play the anim i get an ArrayIndexOutOfboundException : -3…
An idea…from where is this problem could come from?

Which version of the jMonkeyEngine libraries are you using?

@sgold said: Which version of the jMonkeyEngine libraries are you using?

Hum, i currently use 3.1.0.1xxxx versions…a nightly version but not the latest nightly.

JME3 and SDK Documentation 3.1.0.10764
JME3 External Librairies 3.1.0.10976
JME3 Library 3.1.0.11051

So you’re running on JME’s trunk. @kaelthas has made many changes to blender imports lately, so that functionality has been a bit unstable.

I suggest you try again with the latest nightly, and if the problem persists, come back with a complete stack trace.

Same thing with nightly build.

Stack trace is :
[java]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:345)
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.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)[/java]

The animation appears to be missing some translation data. Beyond that I’m baffled. @kaelthas?

Arf, Let me re check if i’ve missed something…everything works fine in blender…maybe an option somewhere…

Hi @haze
Could you upload your blend file somewhere and post a link here ?
I will check it out :slight_smile:

@Kaelthas said: Hi @haze Could you upload your blend file somewhere and post a link here ? I will check it out :)

Of course, it’s my first animated model so, maybe i’ve just made something wrong… :s

EDIT : oups, forgot to add the link x) … http://db9919w7xi.1fichier.com/

@haze

I managed to open your model without errors. And animation was fine as well.
But jme sdk cannot open it and I have no idea why.
The only message that pops up is: Error opening radar.blend

No stacktrace or any other information about what went wrong.
I can see that the importer starts loading the model, but nothing more.

Do you open it using the jme sdk or your own code ?
If you use your own code please post it and I will try to figure out what is wrong.

@Kaelthas said: @haze

I managed to open your model without errors. And animation was fine as well.
But jme sdk cannot open it and I have no idea why.
The only message that pops up is: Error opening radar.blend

No stacktrace or any other information about what went wrong.
I can see that the importer starts loading the model, but nothing more.

Do you open it using the jme sdk or your own code ?
If you use your own code please post it and I will try to figure out what is wrong.

Ah, both ways are not working for me…

When i try to play the anim in the SDK i get a popup message saying ArrayOutOfBoundException : -3…then the model disappears…

And when i try to load it by code with that code ( just to preview the animation)

[java]Spatial radar = assetManager.loadModel(“Models/Asteroide/radar/Circle.mesh.j3o”);
rootNode.attachChild(radar);
AnimControl anim = radar.getControl(AnimControl.class);
System.out.println(anim.getAnimationNames());
AnimChannel channel = anim.createChannel();
channel.setAnim(“my_animation”); //or idle animation name[/java]

i get the same error with the stack trace i posted above.

I’ve tried to add the animation to a NLA Track but same thing
I can’t convert to .j3o directly from .blend in the SDK like other models…it seems animations are not supported so i use a OGRE exporter to convert in .mesh and .skeleton…maybe it’s the wrong importer…

Well even if the model is at fault, there should be a usefull error,

either the loader or the animation system should refuse to work with invalid data instead of crashing I would say.

HELLO!

I had to do this little dance before, so here are my findings:

the 2.69 ogre export is generated in a format that JME does not like, you can confirm this by comparing the exported xml info from something compatible like 2.63.

Someone fixed this by editing the xml and adding some sort transform data in a recent posting.

I personally just went the lazy way and kept a 2.63 installed on the side and doing my ogre exports out of that.

I can’t verify what you mean by unable to convert directly from .blend, as it works for me, but when you do it this way you’ll have to getChild your way into the correct node with AnimControl.

I can 2.63 ogre export your model and run it perfectly without the getChild lines.

You can also probably edit the .py for the 2.69 ogre exporter and make it write the correct format info for JME. That’s a bit of an overachieve though, rather than just download and install 2.63 and continue on your way.

Sometimes it seems like everyone else has a working 2.69 ogre exporter that we don’t know about… since mentioning 2.69 doesn’t bring about much reaction.

1 Like
@cardboardman said: HELLO!

I had to do this little dance before, so here are my findings:

the 2.69 ogre export is generated in a format that JME does not like, you can confirm this by comparing the exported xml info from something compatible like 2.63.

Someone fixed this by editing the xml and adding some sort transform data in a recent posting.

I personally just went the lazy way and kept a 2.63 installed on the side and doing my ogre exports out of that.

I can’t verify what you mean by unable to convert directly from .blend, as it works for me, but when you do it this way you’ll have to getChild your way into the correct node with AnimControl.

I can 2.63 ogre export your model and run it perfectly without the getChild lines.

You can also probably edit the .py for the 2.69 ogre exporter and make it write the correct format info for JME. That’s a bit of an overachieve though, rather than just download and install 2.63 and continue on your way.

Sometimes it seems like everyone else has a working 2.69 ogre exporter that we don’t know about… since mentioning 2.69 doesn’t bring about much reaction.

Thanks a lot, it works for me too with a blender 2.63 version and ogre exporter 0.58 (2.63)…so my model was ok…don’t understand what’s happened in the newer versions :cry:

I’ve noticed my uv textures have to be flipped in 2.66 but not in 2.63 :wink:

Thanks for your help monkeys :slight_smile: i’ll go with that…there really is a bug but i can’t spend too much time on it for now.

1 Like