JME binary file format

Hello!



I've been looking through the documentation a bit and I can't seem to find a specification on the JME binary file format. Can someone point me in the right direction? I see the javadoc here: http://www.jmonkeyengine.com/doc/com/jme/util/export/binary/BinaryExporter.html , but I was wondering if there was a more thorough explanation elsewhere. Apologies in advance if I've overlooked something, I tried to be as thorough as I could with forum searching…



thanks!

jW

Why do you want to modify it outside of jme? I suggest exporting to jme xml instead, its easier to modify outside jme.

Cheers,

Normen

Normen,



I certainly don't want to modify it outside of JME. Mostlly I'm just looking for more information about it and its use. I currently use an xml schema already but looking to see if the binary format is more efficient.



thanks!

jW

Anything that implements Savable can be stored inside such a file. You can store a root Node and all children including their settings etc. are saved in the file. That could be effects, models, animations, you name it. The xml format is the same and just requires using the xml im/exporter instead of the binary one.

Cheers,

Normen

@jagwire said:I currently use an xml schema already but looking to see if the binary format is more efficient.


In terms of storage requirements, the jme binary files are certainly more efficient.. If you're talking about the speed of loading vs. something like the COLLADA files that OWL is loading, then you're going to see a significant speed improvement by using the engine's format (you save yourself the time it takes to re-parse the .dae on each run, this can be lengthy).

Skye, just what I wanted to know!



Just to be thorough, if I have the root node of a lengthy scene graph and I issue a save() call, I’m assuming the scenegraph get’s all packaged up, but where is it saved?



thanks so much!

jW

You would just issue the exporter a FileOutputStream like:

BinaryExporter.getInstance().save(mySpatial, myFOS);

So node.save() is never used explicity?

jagwire said:
So node.save() is never used explicity?


Are you sure its save()? I only know of the read and write methods described by the Savable interface.. The only thing you would need to do it push the node through the BinaryExporter.

BTW, if you want to save the textures into the same file, you'll need to set each TextureState to store the image data.

Betaville code snippets to the rescue again!

Edit: ouch, that code formatting is kind of grimey :/
Edit 2: I got rid of the code snippet from this post and put it in the snippet bin, so cool! http://hub.jmonkeyengine.org/groups/development-discussion-jme2/snippets/single/7/

Ah, looking at the javadoc now, I can’t find it either. I’m sure you’re right in your description with BinaryExporter.



thanks again, Skye!

jW