Add random color to active object python blender -


basically want add random color active object in blender using python

i want use random.randrange , want rgb- scale start @ 0.00 , stop @ 1.0 difference of @ least 0.3.

this code somehow doesn't work

r, g, b = random.randrange(0.0, 1.0[, 0.3])  mat.diffuse_color = (r,g,b) 

im new blender , not sure how this. best solution?

thanks!

you can accomplish same use of random.uniform(stat, end), here won't option skipping 0.3.

so, better random.randrange() , here solution:

import random  rgb = () in range(3) :     rgb += ((random.randrange(1, 10, 3) /10),)  mat.diffuse_color = rgb 

Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -