Animations aren’t working at all

It doesn’t matter if I import a .blend file or an ogre file to jmp, after converted to .j3o, when I try to open them in SceneComposer it gives me an error. I’ve tried to load the .mesh.xml in source code too, but the animation can’t work.





java.lang.ClassCastException: [Lcom.jme3.export.Savable; cannot be cast to [Lcom.jme3.animation.Track;

at com.jme3.animation.Animation.read(Animation.java:202)

at com.jme3.export.binary.BinaryImporter.readObject(BinaryImporter.java:357)

at com.jme3.export.binary.BinaryInputCapsule.resolveIDs(BinaryInputCapsule.java:484)

at com.jme3.export.binary.BinaryInputCapsule.readStringSavableMap(BinaryInputCapsule.java:668)

at com.jme3.animation.AnimControl.read(AnimControl.java:359)

at com.jme3.export.binary.BinaryImporter.readObject(BinaryImporter.java:357)

at com.jme3.export.binary.BinaryInputCapsule.resolveIDs(BinaryInputCapsule.java:484)

at com.jme3.export.binary.BinaryInputCapsule.readSavableArray(BinaryInputCapsule.java:472)

at com.jme3.export.binary.BinaryInputCapsule.readSavableArrayList(BinaryInputCapsule.java:588)

at com.jme3.scene.Spatial.read(Spatial.java:1283)

at com.jme3.scene.Node.read(Node.java:609)

at com.jme3.export.binary.BinaryImporter.readObject(BinaryImporter.java:357)

at com.jme3.export.binary.BinaryInputCapsule.resolveIDs(BinaryInputCapsule.java:484)

at com.jme3.export.binary.BinaryInputCapsule.readSavableArray(BinaryInputCapsule.java:472)

at com.jme3.export.binary.BinaryInputCapsule.readSavableArrayList(BinaryInputCapsule.java:588)

at com.jme3.scene.Node.read(Node.java:599)

at com.jme3.export.binary.BinaryImporter.readObject(BinaryImporter.java:357)

at com.jme3.export.binary.BinaryImporter.load(BinaryImporter.java:264)

at com.jme3.export.binary.BinaryImporter.load(BinaryImporter.java:147)

at com.jme3.export.binary.BinaryImporter.load(BinaryImporter.java:131)

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

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

[catch] at com.jme3.gde.core.assets.SpatialAssetDataObject.loadAsset(SpatialAssetDataObject.java:86)

at com.jme3.gde.scenecomposer.OpenSceneComposer$1.run(OpenSceneComposer.java:44)

at java.lang.Thread.run(Thread.java:662)







WTF is this xD?

I’ve uploaded the file http://www.2shared.com/file/l1lMXvdC/Armature.html.

I’m using the lastest builds. For the ogre exporter, I’m using the lastest one http://code.google.com/p/blender2ogre/downloads/detail?name=b2ogre-0.5.5-preview6.zip&can=2&q= because the provided by the OgreXmlTools isn’t working, when I install it in blender 2.59, and try to export a model, an error happens.

It looks like you’re saving the j3o with another version of jme3 than you load it with… Tho thats not really possible if you say you convert and then try to view it…? Is this the latest nightly?

No, it doesn’t. It’s the lastest nightly. I’ve created the model 1 hour ago.

Theses are the files I’ve uploaded at my second post:

Armature.blend

Armature.scene

Cube.material

Cube.mesh.xml

Cube.skeleton.xml



It’s a simple animated cube. I’m trying to understand how bones works internally in jme.

I’ve made several tests, and imported animated models doesn’t work .

@Kaelthas: Arrays cannot be cast like this, you should use an ArrayList instead of an Array in the Track class.

@Kaelthas: You don’t have to use ArrayList. Just copy the savables to the other array using System.arraycopy()

Fixed that in svn using arraycopy… Doesn’t feel very good I have to say though :wink:

Thank u. I’ll take a look at that ;).

Thanks Normen for fixing that.



Sorry I didn’t do it but I barely have any time this week to look into loader :frowning:

@Momoko_Fan further fixed the animation system, especially the serialization. “Old” models should load properly again, models imported after the changes made by @Kaelthas might still be broken though, reconvert if thats the case.

Wow. Thank u, I’ll take a look at that.



-regards.

normen said:
@Momoko_Fan further fixed the animation system, especially the serialization. "Old" models should load properly again, models imported after the changes made by @Kaelthas might still be broken though, reconvert if thats the case.


Did u mean the @Momoko_Fan fixed the problematic serialization for 2.59 ogre models in animation system? Is it already in SVN? Just tested it now, and didn't work for me(my jmp is up to date).

If you’re having issues importing Blender 2.6 animated models into jME3 beta, please provide the .blend file and the exported Ogre3D model. If there’s really an issue, then a stable fix will be pushed into the jME3 SDK

@Momoko_Fan : Done. I did a test and only animations for .blend files are apparently working, for .mesh.xml / .scene aren’t. For blender, I could play the animation in source code and in SceneComposer before and after converted the model to j3o. For .mesh.xml / .scene, I couldn’t, if I set the animation the model keeps static. Then it’s not a serialization issue I think, because loading .mesh.xml / .scene in source code the animation doesn’t work.

I used jmp BETA with the lastest builds and blender 2.6 and the dotscene provided by OgreXmlTools.



Here are the files : http://www.2shared.com/file/veUqxTTv/Cube.html



btw at least blend files are working :D.



-Regards

Have a try my blend model. Animations work incorrectly: http://dl.dropbox.com/u/26887202/123/jme_blender/character.zip

And a remark about blend models - when you use normal map textures you have such a problem with blender models: http://hub.jmonkeyengine.org/groups/graphics/forum/topic/bug-symmetrical-blender-model-with-tangentgenerator-and-normalmap/?topic_page=2&num=15



We need ogre+blender2.6 animation support. This is a vital thing.

hi screamer :slight_smile: , 2.5x / 2.6 ogre animations aren’t working yet. I checked your models, it looks complex animations aren’t working for .blend models, btw my simple animated cube I’ve uploaded is working. And about your last model, I couldn’t see any textures, it’s not useful for testing.



Edit: Also, did u use 2.59x+?

OK I commited fixes to both stable and nightly. The stable fixes won’t go in until the stable build is released though

1 Like

@Momoko_Fan , thanks for trying to fix ogre animations for 2.5+.



I tested the nightly build. Animations now work for OgreExporter 2.5+, but bone rotations are not correct.



Here is my test files for 2.49 and 2.6: http://dl.dropbox.com/u/26887202/123/jme_blender/ogre_animation/test_animation_model.zip



Here is a screenshot:

http://dl.dropbox.com/u/26887202/123/jme_blender/ogre_animation/ogre_animations.jpg