Assign different color to groups

   13142   5   0
User Avatar
Member
23 posts
Joined: Feb. 2008
Offline
I created 60 copies with out $CY groups, now I want to assign a different color to each one of them. How can I do that ?

I don't want to create a color node for every single group.

Thank you.
User Avatar
Member
257 posts
Joined: Nov. 2007
Offline
check out the foreach sop.
Inside of it you can assign a color and randomize it based on the FORVALUE.
Cg Supervisor | Effects Supervisor | Expert Technical Artist at Infinity Ward
https://www.linkedin.com/in/peter-claes-10a4854/ [www.linkedin.com]
User Avatar
Member
253 posts
Joined: Jan. 2008
Offline
worldcmt
I created 60 copies with out $CY groups, now I want to assign a different color to each one of them. How can I do that ?

I don't want to create a color node for every single group.

Thank you.

Cant you just stamp a color to each copy, or set color on your points and check Use Template Point Attributes on your copy SOP?
User Avatar
Member
23 posts
Joined: Feb. 2008
Offline
Thank you guys I tried all that , but I am obviously doing something wrong.

I am frustrated, I can't make it work. I know it's something stupid and that's making it worst.:evil:

Here is the file :

Sphere
Copy SOP
5 Copies (Out put Groups ,color Stamp $CY)
Until here everything looks fine
For-each copyGroup*
Inside
Color SOP (If i use copyGroup* all the spheres will get the same color)
(If I use my stamp function All the spheres will get one point with the color in Color SOP).

I just need one different random color for every sphere (Group).



Thank you.

Attachments:
color_groups.hipnc (48.4 KB)

User Avatar
Member
9380 posts
Joined: July 2007
Offline
for copystamping you need to use stamp variable in the left input graph using stamp() expression for example on color SOP to change color each time the object is copied

for foreach method you need to change color inside foreach SOP to be different for each group. you can get the name of the current group by stamps(“..”, chs(“../forstamp”), “”) and then you can extract number from that group by opdigits() expression to get different number for each group which you can use as seed to randomize your color

here file with both methods working

Attachments:
color_groups_fix.hipnc (67.5 KB)

Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
23 posts
Joined: Feb. 2008
Offline
tamte
for copystamping you need to use stamp variable in the left input graph using stamp() expression for example on color SOP to change color each time the object is copied

for foreach method you need to change color inside foreach SOP to be different for each group. you can get the name of the current group by stamps(“..”, chs(“../forstamp”), “”) and then you can extract number from that group by opdigits() expression to get different number for each group which you can use as seed to randomize your color

here file with both methods working

Thank you I owe you my life.
  • Quick Links