Random color on checker

Random color on checker

Azerothh
Observer Observer
629 Views
2 Replies
Message 1 of 3

Random color on checker

Azerothh
Observer
Observer

Hi!

I need aply a random color in a color1 e color2 of a checker in a diffuse map with maxscript

like image...

any ideia?

 

Help me!!  : (

0 Likes
630 Views
2 Replies
Replies (2)
Message 2 of 3

leeminardi
Mentor
Mentor

The following will generate random colors for material number 2 that has a checker diffuse map (Map #3).

r = random 0 255
g = random 0 255
b = random 0 255
meditMaterials[2][#Maps][#Diffuse_Color__Map__3____Checker].color1 = color r g b
r = random 0 255
g = random 0 255
b = random 0 255
meditMaterials[2][#Maps][#Diffuse_Color__Map__3____Checker].color2 = color r g b
lee.minardi
0 Likes
Message 3 of 3

leeminardi
Mentor
Mentor

I experimented a bit with the script and think the following will yield better contrast between the two random colors.

r = (random 0 16) * 16
g =  (random 0 16) * 16
b =  (random 0 16) * 16
meditMaterials[2][#Maps][#Diffuse_Color__Map__3____Checker].color1 = color r g b
if r > 127 then r = r - 127 else r = r+127
if g > 127 then g = g - 127 else g = g+127
if b > 127 then b = b - 127 else b = b+127
meditMaterials[2][#Maps][#Diffuse_Color__Map__3____Checker].color2 = color r g b
lee.minardi
0 Likes