0
$\begingroup$

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.

$\endgroup$
  • $\begingroup$ In both cases, you will have only one random value per rendering $\endgroup$ – lemon Jul 12 '16 at 12:27
  • $\begingroup$ so why am I getting the value as 0.500 i.e. the middle most colour in the colour ramp? $\endgroup$ – rob Jul 12 '16 at 13:00
  • $\begingroup$ 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 $\endgroup$ – lemon Jul 12 '16 at 13:35
2
$\begingroup$

In the second comment to my answer to the question you refer to, I mentioned having to update dependencies for the driver. This seems to be a manual step we need to perform when adding drivers to nodes.

You can find the driver details in the graph editor in driver display mode. With the driven value selected you need to click the Update Dependencies button and you should then find the node value will be updated properly.

driver info

Also ensure that you have enabled auto-run python scripts.

While work is being done on the new dependency graph it may be a good time to report this as a bug so that the developers can look into improving this.

$\endgroup$
  • $\begingroup$ There was a "reload trusted" or "ignore" box in the top menu bar that I had to use else it would not work and every time I reloaded the file the Auto run setting would be lost. But this does work, so thanks for explaining this in more detail. $\endgroup$ – rob Jul 14 '16 at 12:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.