CGTalk > Software > Autodesk Maya > Maya Programming
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 05-22-2012, 02:40 AM   #1
PozestStar
Your Majesty
portfolio
Melissa Starks
Cloth Sim Queen! Kinda...
Starving Artist ><
USA
 
Join Date: May 2007
Posts: 185
Send a message via AIM to PozestStar
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-22-2012, 08:02 AM   #2
ntashev
apiApe
 
ntashev's Avatar
portfolio
Nikolay Tashev
Lighting/Rendering Artist
www.cinemotion.bg
Sofia, Bulgaria
 
Join Date: Nov 2005
Posts: 326
Send a message via ICQ to ntashev
You should specify where to parent the new menu item:
Code:
menuItem -l $cams -p camList;
__________________
..aut inveniam viam aut faciam..

 
Old 05-22-2012, 12:49 PM   #3
PozestStar
Your Majesty
portfolio
Melissa Starks
Cloth Sim Queen! Kinda...
Starving Artist ><
USA
 
Join Date: May 2007
Posts: 185
Send a message via AIM to PozestStar
Thanks. I did what you said, but it's still giving me the same error. Boy, this one is really confusing me.
 
Old 05-22-2012, 04:09 PM   #4
NaughtyNathan
HighEnd3D deserter
 
NaughtyNathan's Avatar
Naughty Nathan
Technical Artist
Sony SCEE Liverpool
Manchester, United Kingdom
 
Join Date: May 2008
Posts: 2,608
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-22-2012, 04:09 PM   #5
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,480
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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 10:29 AM.


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