How to get the value of the output of a colorRamp node

Hi guys,

I’d like to know how to get the value of the color output of a color ramp node.

image
In the example above, the input value is 0.691 (random value based on a noise in the graph editor) but the output of the color ramp is .9.

Is there a way to know the output value of the node at any given time ?

Thanks.

The POsition gowa from 0 to 1. At Position 0.691 you have a white value.
So Fac-Input is the position and the value at this position goes out.

Yeah, I know how the node works.
The thing is that I want to be able to get the output value to let’s say write it down on a txt file.
In the end it’s to be able to write down all the values of all the frames on a txt file.

No, I can’t think of a easy way to get this values. You have to output the noise function, somehow.

Not sue if it is possible but animation nodes can read attributes and write to a text block. So you should be able to save all value after a run. Haven’t use them for a longt time.

If what you want to do is just to evaluate a specific color_ramp at some position, you can use the evaluate function of the color_ramp.

For example:

cr  = bpy.data.materials['Material'].node_tree.nodes['ColorRamp']
outputColor = cr.color_ramp.evaluate(0.691)

Oh I see, that’s a good way of doing it.
I’ll just have to use the value’s value instead of a fixed number but that should do the job.
Thanks.