# Change the Color of two materials with One group-node

I want to change the color of two Materials with one group node.

That's my setup:

## First material (Car paint)

just a Glossy BSDF for the color inside a group.

## Second material (Black strips - mask)

A Black & White mask in the fac of the mix shader. In the mix shader the Color group from first material and a glossy BSDF to change the strip color.

I assigned the first material (Car paint) to those parts where I don't want the strips to be.

## My issue

And my problem is that the color I change on the input of that group don't sync with each other:

Only when go inside the group and disconnect the inputs and change the color there it is working. But then I'm not able to change the color on the right side in the materials tab inside the properties window.

It is not quite that of a problem but I just don't understand why the group inputs don't sync with each other like when I'm inside the group. What makes changing the Color for both materials at same time impossible in side the properties window in the materials tab. Maybe my setup is just wrong for the kind of result I'm looking for.

So my question is why the Group Inputs don't sync with each other? And would there be a other way to achieve the result I'm looking for?

• Hi :). This is intentional - so you can reuse one nodegroup with different values in multiple materials. You can use another nodegroup/custom property/object color to drive color for all groups at once :)) May 15 at 14:29

Node Group (Color Sync) - to changing color in all instances - open node group and change color inside the group. It is designed in that way and that is how you benefit from it ... so you are using it correctly.

Changing color outside (on income socket) of node group sets color just for specific instance (node group).

Version Strips Color Ramp - here another option to create strips for a single material :)
Upper ColorRamp masks strips on roof.
Lower ColorRamp are strips.

Or you can mask strips on Z axis, that is even better to cut strips at bottom part :)

Version Strips Math ... to easier control strip setup (without Color Ramp), you can use something like this ... the upper three nodes are strips, the lower three nodes are strip mask (it prevent side strip repetition).

When closed into Node Group can be controlled by two values ...

• I like this. but I noticed some weird shading in the material preview. There are like one extra strip a little bit brighter and if I swap the colors one of them becomes blue. In rendered view everything looks fine. here is a screenshot of what i mean: link May 15 at 20:09
• Hm ... I can't replicate your issue. Try to enable "Clamp" on Subtract node (inside the node group) ... or share a plane with your material to let us see. May 16 at 7:24
• I thought I tried that on every note. But that fixed the issue. Thanks! :) May 16 at 8:26

You can create this effect a million times easier if you do something like this.

A wave texture can be used to create sine waves (basically infinite repeating stripes).

Compare node allows you to select a certain slice of those sine waves.

Then create a vertex color mask to subtract the parts we don't want from the stripe mask. If you select certain faces in edit mode, then click this button in Vertex Paint mode:

... it will allow you to fill (Shift+K) only the selected faces. Then Ctrl+I to invert, X to invert the color and fill with black.

Then you use this as the Fac for your two shader colors and voila!

This way you can keep it all in one material. And the stripes are way more procedural and easy to modify, much better than that crazy setup you got right now.

To answer "why the Group Inputs don't sync with each other?": It is because each material has its own instance (copy) of the group, and each instance has its own unique input. That's how node groups are designed to work.

To answer "would there be a other way to achieve the result I'm looking for?": There are many. Jachym Michal suggested several in a comment on your question

use another nodegroup/custom property/object color to drive color for all groups at once

Jakemoyo suggested a different approach in this answer.

I'll describe the "another neodegroup" approach because it is closest to your workflow.

When you copy a nodegroup to a material, the inputs are unique, but the interior remains the same. So, create a second nodegroup that has no input, consists only of an RGB Input node, and outputs the value of that node:

Give that nodegroup a name, perhaps "Base Color".

Hook it to the Color input of your existing node group, in both materials. I didn't duplicate your setup, but here's an example using the node group directly as color input.

Here's an example similar to the stripe material

Note that I'm just plugging the new nodegroup directly into the color slots of the shaders, but you would plug it in to your existing nodegroup; not changing anything else.

Now, when you want to change the shared color, select either material, open the nodegroup, and change the color in the RGB Input.