PDA

View Full Version : Adding a color chooser?


AmyScott-Murray
05-15-2006, 03:52 PM
Hi there :)

Can anybody tell me how to add an attribute to a shader so that the user can choose a color, over and above the built in ones? I've already added a vector type attribute, but apart from that I'd like it to have the colour sample box next to it, that will launch the colour chooser when clicked.

Any help much appreciated.
Thank you

Amy

ckas
05-15-2006, 09:58 PM
I would be interested too....

ephemeros
05-20-2006, 06:22 PM
if you have a shader named "lambert3" and want to add a color attribute named "color2" use these commands:

addAttr -uac -ln color2 -at float3 lambert3;
addAttr -ln color2X -at "float" -p color2 lambert3;
addAttr -ln color2Y -at "float" -p color2 lambert3;
addAttr -ln color2Z -at "float" -p color2 lambert3;

-uac means "use as color"
\m/

CGTalk Moderation
05-20-2006, 06:22 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.