material manipulation

Hi all,

I am experimenting with the diffusion, spectral and emissive characteristics of a material in a model. Finding the material and changing the values in the material works fine. The problem I have run into is that the material in all the objects that were loaded with loadModelCopy or loadModel are changed simultaneously. If I load the model 5 times, 5 models change. Is there a way to specify the material in a single model instance?

You can make a new copy of the Material, unique to the particular model:

new_m = Material(orig_m)
model.setMaterial(new_m, 1)

David

The model has multiple materials in it.

new_m = Material(orig_m)
model.setMaterial(new_m, 1)

Replaces all of the materials in the collection with the new material. Is there a way to change only the one material?

part = mode.find("**/namethatyouneed")

that is if your model has named parts. too see what the model has do you model.ls()
then you can run:

new_m = Material(orig_m)
part.setMaterial(new_m, 1)

finding parts can work for lots of other things too.