I saw many topics saying we must create a j3m file to use with j3o ones, but most are too old topics, about 2011.
So now, is there some way to configure the blender material so it is auto loaded at JME?
Or at least some way to properly configure it so it can be extracted from blender file and we can create the j3m one? as easy it is to create the j3o one (new BinaryExporter().save(loadedSpatial, new File(fileNamedJ3o)))?
Or may be, should I export the blender file to some other format that could be recognized and auto-loaded by JME? or at least is usable on reading and exporting (j3m).
I want to make everything automatic. I just prepare the blend file (or exported format) and all other steps (j3o, j3m), I will code to be automatic.
the textures assignment seem dynamic based on the j3m filename?
as there is no link to them at the j3m file, or such link is only at j3o file?
And at the JME-j3m-editor, there is no reference to the textures extracted either.
Anyway, it only worked for one model:
The way its texturized material is configured seems to work very well on being autoloaded at JME engine. So I dont have to extract them, but to use the much smaller j3o/j3m+textures format, I am sure it will work (I still just need to know how to extract j3m from it dynamically in my code).
The other models I got, lose their material/texture, resulting in a simple white model. Such models also dont have their textures extracted at JME SDK the way you showed.
Of course you can do it at run time in code
here is some sloppy code I wrote for testing a week a go.
Spatial G4 = assetManager.loadModel("Models/Rin Dae Normal Correct/Rin.j3o");
Node g4 =(Node)G4;
Node c4=(Node) g4.getChild("DrawCall_0569");
//you can set texture to material
I am starting to love JME3.1 blender importer … It works really great for me !
I do not know about blender Cycle .
I exported a .max file to OpenCollada (not Autodesk Collada) then imported to blender and saved as .blend then converted to .j3o . it worked well !
How to prepare a blender model to have its material ready to be loaded on JME engine.
The most probable reason for it not be working is that in blender, your model is set to “Blender Cycles Render” mode, and so, its materials are using Cycles Nodes Materials.
What you have to do is:
1 - Change the render to: Blender Render (BI Blender Internal Render) (see here)
2 - Make sure the “use nodes” on material is DISABLED (see item 4 here).
3 - If (most probably), at model Textures, the textures are not already set:
3.1 - click on an empty texture slot, and + (add new)
3.2 - At “image” sector, “browse image to be linked” (simply select one of the available images)
3.3 - repeat step 3 to all available textures.
JME engine, seems to recognize it all kinds of textures (bump map, gloss…).
JME SDK wasnt able to extract all the available kinds of textures on the model, only diffuse was extracted, so at the SDK the model visualization was only with diffuse. But the JME engine, used them all and the colored textures looked very good!
A tip to convert all material at once, from cycles to blender internal BI, using python (in blender) is here.
Obs.: in blender internal render mode, you may have to create a high intensity point light to see the model textures.
PS.: improvements on this tip details are welcome.
I am using the blender file format to load direcly on the JME game engine.
I use the textures packed into the blender file.
Well, I use decimate to lower the poly count on all models, and I extract and resize (down) all textures, and pack back again, so I have a lightweight blender file, but still, j3o+j3m+texture files are surely the best/fastest way to load the models. Because of that, to have the least trouble/work, I will dynamically decompose blend files into j3o/j3m/textures, to make a kind of cache for fast loading on the second game play. This could even be optinally automatic by the engine I guess. Could be called “JME3-models cache” or something like that.