""Convert To JME Binary"" in Eclipse

Hello to all,

i recently started using jMonkey engine for 3D game development and found it pretty handy…

i am unable to run SDK on my laptop due to some opengl exception [invalid enum] causing sdk to freeze… [my laptop drivers are up to date]

so i started using engine on eclipse …

recently i followed the tutorials to import a model from blender to jmonkey using OGRE .xml format but the tutorial states that u need to convert mesh.xml to jm3o using a tool in SDK …

now how can i achieve this in normal eclipse IDE …

Simple actually, you have an example here → jme3test.export.TestOgreConvert.java

As you can see there, it saves and loads.



BinaryExporter exp = new BinaryExporter();

exp.save(ogreModel, baos);




BinaryImporter imp = new BinaryImporter();


Node ogreModelReloaded = (Node) imp.load(bais, null, null);


You can basically add all types of I/O Streams. To save an object(level, model, node) into a file just specify to the save method a FileOutputStream.



FileOutputStream fos = new FileOutputStream(new File("./etc/someplace", "file-name.j3o"));

BinaryExporter exp = new BinaryExporter();

exp.save(spatialYouWantToSave, fos);



thanks for so quick reply Setekh…

but in eclipse how can i convert .xml [exported from blender] to .jm30

as it can only be done in sdk

is there any way to load mesh.xml file directly

Dude u are a life saver finally able to do it without converting to .jm3o binary…

followed the code example here …


thanks …

Glad i could helped :stuck_out_tongue:

hello Setekh sorry to disturb you again

but this code is only for loading one mesh

if in my model there are multiple meshes then one solution is copy pasting this code for every mesh … [or may be DYNAMIC MEMORY]

IS there some other solution for such a case


I said you can put spatials, those meshes are inside a node aren’t they? You can add them to a node then write them in output stream via the save method.

basically you can load w/e u want with assetManager.loadModel("") and with it’s returned object:


Spatial model = assetManager.loadModel(“blabla.xml or .blend/whatevs”) ;

//- save it with the binary exporter

exp.save(model, fos);


Note that when converting models the paths to textures etc. have to be absolute when converting them. So if your textures are supposed to be at Textures/Blah/MyTexture.jpg later it has to be in that relative path already when you load the mesh.xml or other external format.

Either care for that or just use the SDK to convert your models.