for a costum tool i need to toogle attributes of objects with checkBoxes. If multiple objects are selected i want my checkBoxes to be greyed out, just like in other applications. anybody got a clue how this works in maya/mel?
Did you start learning melscript first? I just ask because what you are asking look easy...
Answering to you question, yes you can toggle attribute of lot of objects at the same time with mel script and about check-box this is usually a dark icon inside the empty space.
But you can also Disable the check-box and it will turn gray.
What kind of attribute do you want to change on a multi objects selection?
maybe i did not explain it good enough. i made a picture of my tool below:
As written in the picture and i want the mark be greyed out if not all the selected objects have the attribute. unfortunately the checkBox has just a disable state to grey the box. but then you can't click the box anymore.
i hope this explained it better...
the second idea with -dgc is something i can use. i still think it's a little complicated, as i have to set up rowLayouts for each checkBox(and we have quite some of them... ).
thanks a lot for your support and if you find another straightforward solution just post it.
of course i do build the menues with loops and arrays.
your solution works already in my script, just gotta fix some logic problems and i'm done. one more time thanks for your input. just sad there is no state or command in mel to get this behaviour automatic.
Replies
http://download.autodesk.com/us/maya/2009help/index.html
On the bottom you have the technical doc and you can do a research with "checkbox"
Maya is Maya then what is another application for you ? do you have any example?
Did you start learning melscript first? I just ask because what you are asking look easy...
Answering to you question, yes you can toggle attribute of lot of objects at the same time with mel script and about check-box this is usually a dark icon inside the empty space.
But you can also Disable the check-box and it will turn gray.
What kind of attribute do you want to change on a multi objects selection?
As written in the picture and i want the mark be greyed out if not all the selected objects have the attribute. unfortunately the checkBox has just a disable state to grey the box. but then you can't click the box anymore.
i hope this explained it better...
It doesn't resolve the problem... but if it can help you can use a menu item Like this :
If you right click on the RadioButton, you can activate it....
But yeah checking the documentation there is not really something for that O_o...
For the Popup menu I had to attach it to the rowlayout...
Because when you disable the RadioButton everything seems to be OFF under his hierarchy...
I will search more I can find a zone for click... it could be the solution.
You can use the dropCallBack thing.
And it will activate the RadioButton with a simple Middle mouse button :
Here is an example of the monster :
//======================================//
string $window = `window -width 100`;
columnLayout -adjustableColumn true;
rowLayout -en 1 -dgc ("TEST");
checkBox -label "Left" -en 0 -v 1 -align "left" -cc ("print \"a\";") checkBoxTest ;
showWindow $window;
global proc string[] TEST (string $dragControl, int $x, int $y, int $mods)
{
string $aaa[];
checkBox -e -en 1 checkBoxTest;
return $aaa;
}
//======================================//
thanks a lot for your support and if you find another straightforward solution just post it.
This is clean, optimized, fast and will create to you some holidays
your solution works already in my script, just gotta fix some logic problems and i'm done. one more time thanks for your input. just sad there is no state or command in mel to get this behaviour automatic.