my issue is pretty simple.
I try to save a scene with the BinaryExporter, which works.
However, when I load it again next time, it doesn’t have the right textures.
I figured the flaw lies in this line:
[java]
mat = assetManager.loadMaterial(“Materials/exampleMat.j3m”);
mat.setTexture(“DiffuseMap”, assetManager.loadTexture(“Textures/exampleTex.png”));
[/java]
Whenever I apply custom textures during runtime, they do not get saved with the scene.
When I load the scene, the default texture of exampleMat.j3m is loaded, not exampleTex.png…
Do I have to create a different material file for every texture I wanna use or is there a simple way to save the texture as well?
If you load a texture from blah/foo/bar/texture.jpg and then apply it to the model, then save the model as a j3o the texture has to be in the exact same place when you load the j3o again.
@sgold said:
Textures which are part of materials applied to the scene graph should be automatically saved when you save the scene graph.
A couple questions:
Is your material ever applied to a spatial in the scene graph?
Are you saving the entire scene graph or just a subtree?
Yep, it’s applied to the scene graph. Thats how I know it’s missing
@normen said:
If you load a texture from blah/foo/bar/texture.jpg and then apply it to the model, then save the model as a j3o the texture has to be in the exact same place when you load the j3o again.
Well… I don’t move or rename the texture or anything.
If the path of the texture is saved with every spatial I apply it to, shouldn’t I be able to see it in the Properties view?
Because I see that the material is saved, but I don’t see the path of the texture.