I have been thinking the last weeks about an idea for node trees (shader/geonodes/compositing/whatever) which occurred to me a while ago.
I shy away from calling this a proposal because it’s not thought through enough and I didn’t look into the code enough to know if it’s even feasible. But I just want to bounce this idea around.
First a description of the problem I’m trying to solve.
Lots of nodes have settings or data inside them which are not exposed as a socket. For example the texture image in a texture node is not settable via a socket. The same goes for the curve in a curve node or a colorramp. This is often a problem when you try to create general purpose materials or geonodes.
We could solve this by creating datablocks for image data or float curves and exposing them as sockets. But there’s also another way. I have before created a ‘proof of concept’ for the image texture
node and the way I implemented that was that I just added an extra socket to the image texture node where you could connect another image texture node to. Then when evaluating the image texture node it would take the image data from the linked node, while using it’s local settings and texture
input for the texture mapping.
This gave me the idea for a generalized system to do this which I think can be very useful:
Give every node a ‘defaults’ input socket and a ‘reference’ output socket.
In the below screenshot I created a mock up of how this would look ,by (ab)using reroute nodes, where I put the defaults socket at the top of the node, and the ‘reference’ at the bottom.
The idea is that a node would get all it’s values/inputs which don’t come from an input socket on the left from it’s reference node
(I clumsily tried to look the overridden values look grayed out).
Every node would get such a ‘defaults’ and ‘reference’ node. And every node would always first check if there is something connected to it’s defaults node and copy all it’s data/inputs from there before looking at the connected inputs on itself.
If this is feasible it would solve the problem of setting these kind of data for all nodes in one go. It also would give a nice way to export all inputs of a certain kind from within a nodegroup in one socket.
You could make certain nodes in a nodegroup overridable.
Just a wild idea…