AntonicelliVittorio / jmonkeyengine

Automatically exported from code.google.com/p/jmonkeyengine
0 stars 0 forks source link

Modifying material of a model that uses J3M does not save modifications #555

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a model that uses a J3M file. E.g. in jME SDK.
2. Load the model, then modify the material file of that model and export it 
into a J3O file.
3. Load the newly exported model, 

What is the expected output? What do you see instead?
Notice that your modifications were not saved into the new J3O file, I expect 
models saved with modifications to be properly saved.

Original issue reported on code.google.com by ShadowIs...@gmail.com on 23 Nov 2012 at 10:12

GoogleCodeExporter commented 9 years ago
Actually they are saved, its just that the j3m will overwrite the values on 
load if its available through the assetmanager. So only the reference to the 
j3m file should be removed when its cloned or otherwise changed.

Original comment by normen667 on 23 Nov 2012 at 10:14

GoogleCodeExporter commented 9 years ago
@normen667: Yeah, that seems like the proper solution

Original comment by ShadowIs...@gmail.com on 23 Nov 2012 at 10:15

GoogleCodeExporter commented 9 years ago
There's no way of fixing it reliably. Changes to RenderState or Textures 
themselves cannot clear the key on the material. The user must call 
Material.setKey(null) prior to exporting the model in order for material 
changes to be serialized properly.

Original comment by ShadowIs...@gmail.com on 26 Nov 2012 at 3:08