I was wondering if there was a way so when you change a material file, the meshes assigned with the particular file are updated so you dont have to reassign it. Currently, if I want to make a change, I have to go through every object and reassign the material file.
You can change the parameters of a material at runtime… but not with a file, I think.
At this point you might want to examine if files is even what you want.
You can create a material manually. It doesn’t have to be from a j3m. Of course, I’m assuming about a dozen things trying to read between the lines of your post.
But you can reset a materials parameters at runtime no problem, if that’s what you want.
Maybe you can explain more about what you are trying to accomplish. Otherwise, just based on the information provide the answer is pretty simple: “No, you can’t.”
Yeah I really don’t get your question as pspeed, but I would have given the opposite answer.
in the SDK : When you change a parameter in a j3m file in the SDK, it’s automatically updated if you have a scene composer opened with a model with this material.
in code : if you have the same instance of a material on several geometries, changing a parameter on this material has effect on all geometries with this material.
but…again…what do you mean exactly?
I think he means he created a few models with assetManager.loadModel() or whatever, he changed a property of 1 of the materials and wants all of the other models to look the same. This doesn’t work like u think because all models are given a brand new material. You should probably use the .clone (false) method after loading the first one, which should share the same material between them all.
I’m just going from all of the mentions of “material file”. So I look forward to lots of clarification.
@nehon yes, that is what I was asking. When I change the material file, it only affects the particular instance of the geometry in which I am clicked on the material. It is not changing all the instances, I do not know why.
@wezrule you are completely wrong. I am linking models in the scene composer and clicking through their sub parts, accessing the material and creating a file and assigning it.