BinaryExporter - not saving textures

I just want to confirm if this is intended, but if I do the following:-

  1. Load a model which has textures
  2. Export it as a .j3o file
  3. Delete the original model (including .mtl and texture images)
  4. Load the .j3o file

…then the textures are missing on the new model. Is there a way to store the textures in the .j30 file?

You probably don’t have the textures in the same path they were when you created the j3o.

That’s right, I’ve deleted all the other files. Is it possible to save the textures into the j3o file?

Thats not a good idea because then they will be separately loaded for every instance of the object. If the texture is a separate object in the asset loader it can be shared.

Ah, I see. I must admit I assumed everything was saved with the object. Thanks!

One more further question: what’s the best practise then for when releasing a game; do I just store the texture jpg’s inside the game’s jar, or is there a better way, like using BinaryExporter on all the textures?

You have your assets folder, you can put textures in assets/Textures. If you use jME SDK, your asset directory will be automatically converted to assets.jar

Is there any advantage in converting the textures to j3o files?

No, I don’t think so.

Thanks everyone.

Why j3o convert from blender can package image into j3o?

You can store an image in a j3o but thats not optimal for the mentioned reasons. It has to if the image is packed in the blend files because there is no image file available. As the documentation says you should unpack your images from blend files or even better use the blend file and textures right from the assets folder.