Ogre XML converter

Hi Everyone, I recently exported my model into an Ogre XML file and tested it with the ogrexml.TestMesh demo - it seems to load just fine but I'd like to go ahead and convert the file into a jme file with a skeleton and animation. I have a few questions.

  1. I wrote a converter myself and exported it into jme just fine but when I load it, it gives me a class cast exception b/c the Ogre format doesn't cast easily to TriMesh. This is all beside the point - I'd be more interested if anyone has already done the legwork for this problem?

  2. If I do the legwork myself - how would I export the skeleton & animation into the jme? Does it support this? if so - what converters do this? Collada?

    Thanks for any help with regard to this topic.

Ok here is what I found… and its kind of disappointing.

the JME file format is literally a serialization of the Skin node. This means a few things - the JME file format is nonstandard. And what i mean by this is that when I do a BinaryExporter.save() - it is literally taking my OgreEntityNode and serializing. That isn't a big deal but if I want to save a skeleton in my OgreToJME class - then I have to do a separate .save() with the skeleton. This also isn't a big deal - this seems flexible but it also means that every jme file could have some different order so for instance - if it had a skeleton, a mesh and an animation, then it wouldn't know the order in which to unserialize. Plus the classes that come out of the unserialization are not standard. the Node that comes out of a JME that was converted from Collada is simply a Node while the one from Ogre is a OgreEntityNode. This isn't a true conversion - it is merely a way to save a class.

Is there a better solution here? It seems like I should create a JMEFileExporter that can serialize the mesh, skeleton, animations in a standard way. Then an Importer that can read that. This would standardize the jme file format and not make all jme files some hodgepodge of serialized Nodes.

What is the plan with regard to this strategy? I don't necessarily have time to implement this but it does seem kind of whack.

The BinaryImporter/Exporter classes are usually used to export a scene graph, all scene graph elements extent Spatial, so it's safe to cast the results of the BinaryExporter.load() to Spatial. If saving an Ogre3D node, you don't need to export the animations or anything else, just export the OgreEntityNode and everything should work.