Thread: Color Switching
View Single Post
# 2 06-08-2012 , 02:10 AM
NextDesign's Avatar
Technical Director
Join Date: Feb 2004
Posts: 2,988
Hi Itzat, it would be simpler to switch the color of one shader, instead of switching between two full shaders.

One way you could do this would be to create a random number, and if it's greater than a certain value, turn green, and less than that value, turn red.

Code:
float $value = rand(0, 100);

if ($value >= 50)
    setAttr "material.color" -type double3 1 0 0 ;
else
    setAttr "material.color" -type double3 0 1 0 ;


Imagination is more important than knowledge.