Refresh optionMenuGrp - not working

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 05 May 2012   #1
Refresh optionMenuGrp - not working

I've seen this topic before, but when I use the solution that other people used, my script fails. When I test this by creating another camera and running the procedure to refresh my menu, it deletes everything in the menu (which it should) then it gives me an error:

Menu Item's menu not found. (the line that produces this error is highlighted below).

Can anyone see what I did wrong?

Thanks for your help!


Code:
global proc refreshCamList(){ //get the active camera string $getPanel = `getPanel -wf`; string $activeCam = `modelPanel -q -camera $getPanel`; //get all of the cameras in the scene string $camSelection[] = `listCameras`; //delete everything in the camera menu string $oldCamList[] = `optionMenuGrp -q -ill camList`; for ($obj in $oldCamList){ deleteUI -mi $obj; } //repopulate camera menu for ($cams in $camSelection){ menuItem -label $cams; } //make the default menu item the active camera optionMenuGrp -e -v $activeCam camList; }
 
Old 05 May 2012   #2
You should specify where to parent the new menu item:
Code:
menuItem -l $cams -p camList;
__________________
..aut inveniam viam aut faciam..
::Copy SOP 4 Maya::
 
Old 05 May 2012   #3
Thanks. I did what you said, but it's still giving me the same error. Boy, this one is really confusing me.
 
Old 05 May 2012   #4
haven't we had this conversation before...?

$camList is not the name of the menu, it's the name of the parent layout (any control named "Grp" is actually a layout, with child controls).

Find out the name of the menu by using `layout -q -ca $camList` to get a list of it's children, then use that name as the -parent.
 
Old 05 May 2012   #5
Thread automatically closed

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.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 07:27 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.