Controlling a custom Master Material Node Group made Unique to many objects

Hi,

This IS a scripting question about materials.

I have a master material node group assigned to many objects that has been made unique to those objects with some changes, such as color, spec roughness etc.

The material node group has parameters that allow for adding dirt / grime.

Is it possible via some sort of scripting or Blender magic to be able to change parameters of one of the materials and have it effect all the other UNIQUE versions of that material? Essentially temporarily overriding the uniqueness. Much like the way it works if all the objects had the SAME material.

This would save sooo much time to add grime (or add water puddles) to all the objects in a scene at once rather than going into every object individually and making changes.

A script with something along the lines of…check every material for a particular prefix or suffix to see if it has these specific parameters and allow them to change.

Is this possible???

Thanks
Ivan.

You could take a look here:

Inside of the loop you can check the name of the material for a prefix/suffix etc. by checking mat.name and as in the example adjust your node setup.

2 Likes

Thanks Slartibart, I’ll check it out…seems to be along the lines of what’s needed.

Isn’t it possible to simply include the common parameters inside the node group itself?
For example, let’s assume you have an input to your node group for which you have given different values in all materials that are using this node group. You’d like this value to be the same for all materials now. Just remove the input socket, fix the value in the node group itself and you’re done, right?
If you’d rather like to apply the same mathematical transformations to all the inputs, you can add a math node in the node group right after the input socket.

1 Like

The materials are exactly the same…Here’s a better example of my setup.

I have two Buildings objects, they have the EXACT same “Wall MAT” material. The only difference is the prefix of the material name for each object.

Example: Object one is called “Bulding_1” the wall material assigned to it gets changed to “Wall MAT__Building_1” and the second building would be “Wall MAT__Building_2” etc.

It’s the same material through and through the only difference now is the name of the material to make it unique to the respective object, along with some minor changes such as the color of the wall for each object. Object one is Blue, object two is Red…all the other parameters are the same.

Now if I change a parameter on Building_1, such as adding puddles (the material has a puddles slider to make it look wet) it does not affect Building_2. If I wanted to add puddles to (let’s say 100 objects with 100 unique versions of the Wall MAT to make the scene look like it’s raining) I would have to do it manually for each.

I would like a way to TEMPORARALY override all the material suffixes on all the buildings “__Building_X”, so I can adjust the puddles parameters (eg: Puddle Amount, Puddle Scale) on all the objects at once.

Adjust a couple of material inputs and whole scene is wet.

Is it possible to do so???