View Full Version : Mel_ui

05-11-2006, 07:14 AM

I have a problem in icontextbutton.

if i click the icontextbutton, i want it to "allow the selection of joints" and if i click the same button again, i want it "not to allow the selection of joints".

for eg. if you see the status bar in maya in object mode, you can see icons

1)select by object type joints
2)select by object type curves
3)select by object type surfaces

if any one knows reply


05-11-2006, 03:00 PM
Well to toggle joints for example you could do:

char $jnts[] = `ls -type joint`;

for($joint in $jnts)
setAttr ($joint + ".v") (!`getAttr ($joint + ".v")`);

should work... can't test it right now.

05-12-2006, 10:57 PM
i think what you are looking for is
* setObjectPickMask "Joint" false;
* setObjectPickMask "Joint" true;
this calls a script located in your "..\Alias\Maya7.0\scripts\others" folder called by the same name. it again calls the mel-command "selectType". so that's your friend!

by adding this to your button you'll get what you desired:
int $state = !`selectType -q -joint`;
selectType -joint $state;

i hope it helps!

CGTalk Moderation
05-12-2006, 10:57 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.