# input node random expression not used

Following on from Is it possible to get a random number in the node editor?

I changed my node setup from

Object-Info -> Random -> Color-Ramp -> Diffuse-BSDF


to

Value(*) -> Color-Ramp -> Diffuse-BSDF


(*) When I entered the value as the Python expression "#noise.random()" the input field went pink but retained the value 0.500 and the colour generated reflected the middle colour in the colour ramp.

Hovering over the input field for the value node shows the python expression.

Rendering or saving first makes no difference, it always acts as if the factor to the colour ramp is a static value of 0.500

Also tried the expression as just "noise.random()" with the same result.

What I find really strange is I can use the arrows on the input field of the value node and change the visible value of 0.500 up and down and it affects value accordingly as if the python expression is being completely ignored.

• In both cases, you will have only one random value per rendering – lemon Jul 12 '16 at 12:27
• so why am I getting the value as 0.500 i.e. the middle most colour in the colour ramp? – rob Jul 12 '16 at 13:00
• you have 0.5 in the Python expression, but this is not the case with object info. Try to set object info as input and duplicate your object – lemon Jul 12 '16 at 13:35