Color output values of ColorRamp


I have whole bunch of objects with the same material:

I want the geometry of each object be dependent on the color output,
so i would like to ‘intercept’ the color output value of the ColorRamp
and then update the geometry of the object depending on the value of color.

The objects and the material nodes are created with a python script.
The value of color always seems to be (0.0,0.0,0.0 ) at runtime although the colors differ.

So I fail to understand something.

How can I get the correct value of color output for each object separately through python ?

Thanks for any help

First, unless for displacement purposes, it’s the geometry that drives the color and not the way around.

Second, socket colors mean the type of value being used. And thought you can plug a vector (purple) into a float (light gray), you need to understand that some convertion is going to happen (it if you don’t know how the conversion is done, it’s better not to use it).

Third, you are applying a very big vector transformation to the location vector, wich will result in some big vector, wich is going to be converted into a big float… As the color ramp only uses a value between 0 and 1, and you’re inputing a value way bigger, the output color should be the right most key on the ramp.

Perhaps you may want to plug the random socket directly to the color ramp, getting rid of the vector stuff…

My guess is that the value you receive through Python is returned before evaluating the actual node value for color. Do you get proper values from other (simpler) setups? Can you post the relevant part of your code?

Also, as you are basically driving the color with object location, you can use the location itself to change the geometry as you want, why do you need to query the color for this?


Thanks for your answers.

I can’t seem to get any information out of these nodes,
not at runtime nor afterwards.
I realize my approach was rather naive.

I’ll move on to the next experiment.