Trouble with Blender Export to JME3

Hi there,



i tried now for several hours to get this to work.

I got it almost to work, but it still won’t do what i want it to.



Here is what i wanted (very simple in deed):

1.) Create a model (of a space ship) in Blender.

2.) Export it.

3.) Import/convert it so it can be loaded in JME3 (with textures, colors, etc.)



Here is what i got so far:

Installed Blender 2.49b (2.5x was not compatible with the export plugins).

Created a model (consisting of two spheres - one squashed together and on in the center - a typical UFO).

Added colors, emit and alpha channel.



Now i have two/three export plugins:

1.) HottBJ Exporter (JMonkeyEngine). The file is *-jme.xml.

2.) OGRE Meshes. The file is .xml and .material.

3.) Built in .obj exporter.



1.) I can export the xml file. But i can’t load it anywhere. I tried loading it like #3 (see below) but i get an error xml not supported.

Same in jMonkeyEngine 3 Platform - when i put it in the assets folder i can’t do anything useful with it.

And the import model function says “Cannot import this file.”



2.) I can export the model. But it creates a separate file for each mesh. Plus one for the materials.

When naming the material and mesh file the same (prefix) i can load it and compile it in jMonkeyEngine 3 Platform.

But this works only for one mesh at a time. But i want the 2 meshes (for now) to be one model with different materials.

What’s the point when every part is separate … grrr.



I also tried to combine/join the meshes in Blender. That works to some degree, but after export/import it looses its material assignments and all looks the same (material). Also i cannot modify the materials separately after joining. And i don’t think that’s the solution either.



3.) I can export them as .obj. And i can load them with assetManager.loadModel(“Blender/XXX.obj”), but it won’t show correctly.

At best i get some artifacts of the inner sphere. Or some alpha transparency effects. But it does not work properly at all.





So what is the missing piece of the puzzle???

What am i doing wrong?

I thought it would be easy! To some degree at least!

Handling Blender would probably be the hardest part (since i am not a designer).



Please help me!

You have 3 options :

  1. Use the “OGRE Meshes exporter”, and export as multiple parts, call set material for each part.
  2. in blender combine all meshes into 1. then export with Ogre meshes exporter.
  3. use 3d studio max with ogremax.

You can post your problem to @Kaelthas (the blender plugin developper) to: http://hub.jmonkeyengine.org/groups/import-assets/forum/topic/blender-loader-feedback/

I tried number 2. And it work pretty much. Just the colors look very washed out now.

But i guess it’s because of my light settings in the JME3 scene - i’ll have to tune that some more.



But thanks otherwise.

You don’t need to use the OgreMeshExporter plugin anymore, just import the .blend file to jmp with the new blender importer. It works fine with blender 2.4x and 2.5x.



But if you like using OgreMeshesExporter:


tralala said:
You have 3 options :
1) Use the "OGRE Meshes exporter", and export as multiple parts, call set material for each part.
2) in blender combine all meshes into 1. then export with Ogre meshes exporter.
3) use 3d studio max with ogremax.


Do you know the "OgreSceneExporter" :)? First you have to export the .mesh.xml files with OgreMeshExporter so you can export the .scene file with OgreSceneExporter. The OgreSceneExporter comes together with OgreMeshExporter, them are located via file---->export. Also, if you like, As @tralala said you can join all meshes together and assign vertex group to them. Then if you have 3 meshes, create 3 vertex groups. Assign materials for each vertex group. When you load it in jmp the vertex groups will be a geometries. Ex.: a mesh with 3 vertex groups in blender.....a model with 3 geometries in jmp.
1.) HottBJ Exporter (JMonkeyEngine). The file is *-jme.xml.

That exporter is very old and is not compatible with jME3.

I also tried to combine/join the meshes in Blender. That works to some degree, but after export/import it looses its material assignments and all looks the same (material). Also i cannot modify the materials separately after joining. And i don’t think that’s the solution either.

This should work. I expect you're doing something wrong. Combining two objects with different materials and then exporting will give you one mesh file and one material file and that will import correctly.

I can export them as .obj. And i can load them with assetManager.loadModel(“Blender/XXX.obj”), but it won’t show correctly.
At best i get some artifacts of the inner sphere. Or some alpha transparency effects. But it does not work properly at all.

Make sure that "Export Normals" and "Triangulate" is selected in the OBJ exporter.

Ok, that sounds great.

I got it to work with joining the meshes and using Ogre Meshes Exporter.

But i had to rebuild/reassign the materials, because they were not imported correctly (i lost my emit somehow).



I will try importing the .blend files as @glaucomardano said. Thanks for the tip.

I like Blender 2.5x much better than the older one.

I never used Blender before but i started to understand Blender 2.5x, but then going back to 2.4 … it was terrible!!!


You don’t need to use the OgreMeshExporter plugin anymore, just import the .blend file to jmp with the new blender importer. It works fine with blender 2.4x and 2.5x.

So that's good news.

Thanks.
finomosec said:
But i had to rebuild/reassign the materials, because they were not imported correctly (i lost my emit somehow).


Yeah, the exported ogre material doesn't support many jme features, then we have to create j3m materials based on blender materials.
What do you mean about "(i lost my emit somehow)"?
What do you mean about “(i lost my emit somehow)”?

In Blender i made the material to have emit colors.
But in JME it did not emit anymore. I finally created a new material in JME and then newly added the GlowColor there.
I also could not change the imported material (it was somehow internally linked/stored - no way to modify it), i suppose that is what you meant with "then we have to create j3m materials based on blender materials".

Greets Fino

Yeah, just discard the exported material and create a new one :D.

You can open a model and select a geometry of it, then select “create j3m file” in the “Material” property, this way you will get an editable material file for that specific geometry.