Creating gradient contours

Hello All,

I’m drawing a huge blank on something I’ve done before, hoping someone can help me with what I feel is actually pretty simple.

What I’m trying to streamline is a process that will contour an object but perform a gradient across the contour lines… so for example the lowest lines might be white then fade to black at the highest contour. or white through shades of blue to black, or some other variation of gradients across the color spectrum.

Simultaneously I’d like to create a new layer with the corresponding color that would be populated with each contour level…

What I’ve just done is built a def that creates as many layers as contours, what I’d like to do is find a way to easily dispatch each contour level to the desired layer and to control the layer’s colors in a gradient fashion. And at the same time do custom color preview that draws what the colors/ contours will look like after baking.

I hope this is clear,
thanks for any direction/ help you can give me.

Hello, one little hint, as RGB color is a coordinate you can draw curves between {0 to 1} or {0 to 255} and interpolate these values to get color. (11.8 KB)


Have a look at this. You don’t need to name the layer like the color. C#'s aren’t by me.

Colorgradient createlayer (12.1 KB)



Oh My!

At a glance this looks pretty spot on.
Thanks so much.