Page MenuHome

Driver on NodeGroup input slot breaks when changing slots.
Closed, DuplicatePublic

Description

System Information
Operating system: Linux-5.4.14-arch1-1-x86_64-with-arch 64 Bits
Graphics card: GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 440.44

Blender Version
Broken: version: 2.81 (sub 16), branch: master, commit date: 2019-12-04 11:32, hash: rBf1aa4d18d49d
Worked: (optional)

Short description of error
Adding a driver onto the input node of a shader group uses slot index instead of name or ID. If user changes the order or number of slots, the driver will apply to the wrong input for all materials in which the group is used.

Exact steps for others to reproduce the error
Create two materials.
Make a NodeGroup with a BSDF output and two inputs (e.g. base color and specular strength)
Use this node group in both materials.
Create a property on the object (e.g. "global specular").
Add a driver from "global specular" property value to the specular strength in both materials.
Modify the node group to also include "bump map" input.
Move bump map input up to be between base color and specular strength.

Result: "global specular" property value now applies to "bump map" rather than to "specular strength." Driver must now be manually pasted to its new home in every material which uses it.

Consequences/affected users
While this may not apply to the majority of users who are not making their own shader setups using NodeGroups among many materials, it is a very annoying problem for those who are. In my case, I have been developing a shader group to apply to a generic base mesh across multiple models, scenes, and files. Everytime I tweak the group, I have unexpected rendering results in every other scene and file to which that group applied and which are using drivers.

Event Timeline

Just wanted to add that a workaround is to apply the driver to a Value node in each material and use that to drive the slot. The connection appears to follow the name as expected.