2

I'm trying to figure out how to create a material node group that only affects certain Principled BSDF values.

As a simple example I have a cube in which each of the 6 planes have a different Base Color. Let's say I want to create a group and leave the Base Color alone but only be able to change the roughness together on all the 6 sides.

I'm doing something wrong in my testing. When I create a group from one single side, and use that across the remaining sides, it is setting the Base Color to all the sides to the first selection when I want to leave all the Base Colors alone.

More Information: Photo included below. Maybe another way of asking is let's say I have an object with lots of surfaces all a different color and I want to change all the roughness, IOR, transmission simultaneously. I can then change each of the 3 properties until I get the desired look around the whole object without having to go into each surface individually. Is there another way to do it without using a node tree group.

Simple Cube example with node tree

Still having problems. See animated GIF link below for attempt 2 using Markus von Broady tips:

Test 001 animated GIF steps

Thanks!

PPL
  • 175
  • 7

1 Answers1

3

Shared Custom Group

You can use a shared group that exposes sockets that are supposed to be material specific, while using its own values for shared stuff.

  1. To easily isolate some sockets from the Principled BSDF, connect the sockets you want to isolate to some nodes (here: only base color). Then select the Principled BSDF together with one more node (it can be any temporary node; it doesn't have to be connected, but I did connect it as it will be useful when I hide sockets). Then select the Principled and the one additional node (here Value node), and press ✲ CtrlG:

  1. Optional step: Now in the Custom Group, you can hide some sockets, by connecting everything to the sockets you don't want to hide, and with the Principled BSDF node selected, pressing ✲ CtrlH. You can also right-click the node and choose "Toggle Node Options":

Those aren't really things you want to do for your own projects, I do these steps for educational purposes to get rid of irrelevant parts…

  1. Remove the temporary node and press ⭾ Tab to exit the custom group; there you can also remove another temporary node:

  1. You can now also "Toggle Node Options" for the custom group, copy-paste it to other materials, and everything inside the custom group will stay synchronized:

Of course you can expose all values and just disconnect some when you decide you want them all to be shared.

Using this technique will make the shared values (here: metaliness) shared among all polygons using the material. This means that if you want to share only within a single object, you need to use a different Custom Groups for other objects.

Driver

You can copy one of the material's values as a new driver, and paste that driver to other material's values. It can be hard, however, to remember which material you're supposed to modify, so you may consider creating a new custom property instead:

It's a little misleading I used an object's custom property, even though (as you see on the GIF) a driver points to a unique place that isn't updated when you duplicate an object - how could it be updated, if new materials are not created? Unfortunately a node tree doesn't have a way to know what is using it when it's evaluated.

Geometry Nodes

Unlike in shading, geometry node trees have modifier wrappers. This means that you can send data from the modifier to the node tree, and since modifiers get duplicated when objects are duplicated (modifiers actually can't be reused, they have only a single user), the drivers are also duplicated and updated to new targets:

Markus von Broady
  • 36,563
  • 3
  • 30
  • 99
  • Shared Custom Group. That might be exactly what I'm looking for. There are so many instructions on Node Groups but I don't recall seeing anything like you have done with "Shared" Custom Groups. Is there a video anywhere to get to that step you have in that first animation you posted here? I did try Google but to no avail. – PPL Oct 25 '22 at 18:53
  • @PPL select the Principled BSDF node, and press CTRL+G – Markus von Broady Oct 25 '22 at 19:19
  • you sliced/split that blender screen nice for your examples. I can't say how many times I tried Ctrl+G on Principle BSDF which is the easy part to get a saved group but it's what comes after that which you demo in example 1 which allows the node group metallic slider to affect all the sides while not affecting the color. You can see one attempt I made in the new above linked video. – PPL Oct 25 '22 at 20:36
  • @PPL see answer edit. – Markus von Broady Oct 25 '22 at 21:14
  • Thanks again. Glad you made that initial step clear, I got lost in my attempts but one of my first couple dozen tries I set up something similar. That was a great gif addition to the instructions and I followed along! Though this can help at times, is there another alternative that I don't have to re-enter the color after I add the group to each surface? I have a sphere with a few dozen colored planes. I was hoping to not have to re-select the colors each time I attach the node group to each surface. Make sense? – PPL Oct 25 '22 at 22:33
  • @PPL you can hover over one color, ctrl+c, hover over another, ctrl+v. – Markus von Broady Oct 25 '22 at 22:45
  • Great tips getting me closer. Not quite solved yet but it was nice to get the consolidated steps very neatly laid out. I am going refresh my rough python skills and see if I can select the active object, all the surfaces on that object (seen that done in samples) and see how to enumerate and set the material values. With that if I need it more flexible I'll see if I can add a simple UI value slider for the 3 properties I want to set. – PPL Oct 25 '22 at 22:52
  • 1
    Great answer! Well illustrated and written very understandable even for me! +1 – quellenform Oct 25 '22 at 23:30
  • @quellenform if I know you, you liked the lightbulbs - you're into typography and small touches like that. – Markus von Broady Oct 26 '22 at 08:27
  • 1
    @MarkusvonBroady Even though I love such small details, I meant more the way you wrote, structured and illustrated it ;-) – quellenform Oct 26 '22 at 09:20