Need script to replace all instances of a metrial with another material

Hi all

I have some objects that has material assigned with name “matA” this material has been copied few times and applied to different objects including some subobject. I want to replace all the “matA” in the scene with one new instanced “matB”

how can I script this?

Don’t need to script it, in the material editor at the bottom of the shader balls there is a button to replace scene materials with a different one. Otherwise there are material instancer scripts on scriptspot.

hmmm I dont see the button you’re referring to. If I mouse hover on it, what is it suppose to say?

you don’t need a script. :slight_smile: like colin said.

I’ve made a little tut for you.

http://www.pixelschmiede.ch/download/chaos/instance\_mat.swf

hope it helps.

best regards
themaxxer

I don’t know if I really know what all went on in that little video, but that was a different trick I haven’t seen before.

:slight_smile: this saved my a… many times. especially on big scenes when you merge a lot of objects into it and all materials are messed up. max does not always merge materials the right way, although the names are the same.

best regards
themaxxer

Cant count the number of times I look in my material list to see:
‘concrete’
‘concrete’
‘concrete’
‘concrete’
‘concrete’
‘concrete’

all with different maps and shades!

But does this work for materials\maps that also are part of complex multisubs as well?

There is a scrpit in there that will replace all the materials with the same name, and make them instances. Works great for revit imported stuff.