PDA

View Full Version : menuItem query checkbox ??


Tranimatronic
11-19-2008, 07:50 PM
hi guys,
Im having problems with a menu I have created.
One of the menuItems is a checkbox cmds.menuItem checkBox=True and for the command of the menuItem I am calling a function and sending the parent menu (ie function(parentMenu))
Once in the function I am getting the array of menuItems that the parent menu has and querying the state of the checkbox menuItem:-
menuItems= cmds.menu(parentMenu, query=True, itemArray=True)
Gives all of the menu Items
if (cmds.menuItem(menuItems[4], query=True, checkBox=True)):
(menuItems[4] is the checkBox) querys wether the checkbox is on or not.

The problem I am having is that this code ALWAYS returns the INITIAL state of the checkbox and NOT what the checkbox is currently.
I dont see a (menuItem changeCommand) to be able to act upon the change.

Am I using this correctly ?
Thanks for any pointers
T

Tranimatronic
11-19-2008, 08:00 PM
Sorry to waste your time - found the answer.
The object does exist as menuItem[4] and will return a value if the isCheckBox command is used, but to query the value, the long name of the control MUST be used, so in the above instance it should be
if (cmds.menuItem(parentMenu +"|"+menuItems[4], query=True, checkBox=True)):

cheers
T

CGTalk Moderation
11-19-2008, 08:00 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.