Control a color ramp inside of node group, is red line in node editor bad?

hello!

I just tried to control a ColorRamp inside a node group.
For this I made the input value for the ColorRamp go into one output of the nodegroup.
Then I added the ColorRamp outside of the nodegroup, plugged the output of the node group into the input of the ColorRamp and the output of the ColorRamp into the input of the node group.
Now i plugged the input of the nodegroup into the value i want the output of the ColorRamp to go to.
This works just fine apparently but blender shows me a red line (to indicate a feedback loop i think).
Is this something I should worry about?
Is it bad practice?
Is there a better solution?
image
Thanks for your answers!

1 Like

Hey, Iā€™ve been looking for a solution to control a color ramp from outside a node group for a while. I never tried this because obviously it doesnā€™t work. But it works. Cool. :smiley:

Perhaps file a bug report because of the red line.

Controlling a ColorRamp means changing the function (which color outputs for a value x); not just to change x with that function (thatā€™s using the function).
This implies that you need to access to the rampā€™s control points, which nodes alone wonā€™t let you.
Iā€™ll leave that for the end.

You created a paradox. Function A and B are ā€œa color for a xā€, and since the output is connected to the input for both functions, this became an Egg-Chicken problem. The value x for each function depends on the result of the other, which depends on the result of itself.

It works, because the ā€˜red linkā€™ is not even being calculated (as if itā€™s not even there).

Which comes to the root of the problem. A nodegroup is a tree, and a nodegroup_node is a node that reads the tree, and creates the interface (based on the stuff connected to the GroupInput and GroupOutput nodes). The current nodegroup_node doesnā€™t have any implementation for drawing referenced interfaces, except the socketā€™s for the group_IO nodes.
So the only way to do it is with python, and create your own ā€˜nodegroup_nodeā€™ with your own drawing call.
I posted some examples with exactly this as an example here, in the file ā€˜Testing_nodes.pyā€™.

Sorry to interrupt, but I donā€™t understand somethingā€¦

I thought red links never work, but then I get this:


And it works :face_with_raised_eyebrow: Am I reading it wrong or is Red Line nothing more than a mere suspicion that it might not work in this case?

In that particular situation (nodegroup outputs have independent inputs), the tree walker from the engine might figure that the process tree is actually valid, but the node editor is configured to alert looping connections between nodes; it doesnā€™t check too deeply by unwrapping of the nodetree into a callable function.

1 Like