Using a color ramp and color stops for thresholds in a set of math nodes

I have a set of math nodes linked to value nodes which act as thresholds for other things in my node group. Things get messed up when the values aren’t in order from low to high. Sure, I could be careful, but where’s the fun in that? With a few thresholds it isn’t a big deal. For many it can be troublesome.

Color ramps have color stops with three attributes: index, position, and color value. A cool thing happens when you move a stop past another: the index changes. Drag the stop with index one to the left of the stop with index zero, and the index changes. The left most stop is ALWAYS index zero.

In this example, the color stop position would be the driver for the value nodes.
Any idea for how to code a driver to reference these values?

Right click the position value in the colour ramp node and choose copy as new driver.
Right click the value of the value node and choose paste driver.

1 Like

Brilliant. I was trying that with the handle, no surprise that didn’t work. Using the field it worked beautifully, wish I had thought of using the field instead

1 Like