PDA

View Full Version : Killing my procedure...


Haider of Sweden
05-15-2007, 08:21 AM
Hey there!


I am sourcing Makaroni's script, zooShelveIt.mel (please see attached ZIP file)
After that, I am running this code:

string $buttons[] = `zooGetShelfButtonAll buttonTag1`;
for( $a in $buttons ) {
string $menu = `popupMenu -p $a -aob 1 buttonPopMenu`;
menuItem -l "hullo!" -c( "print \"hullo!\n\"" );
}

Where buttonTag1 is a docTag name used on a shelf button.

I want to kill the proc that creates the menuItems when exiting Maya 8.
Question is, can I kill the code above = overwrite the code above, or shall I kill the zooGetShelfButtonAll proc loaded from the MEL file?

I hope to hear from you.

Haider of Sweden
05-15-2007, 11:16 AM
I tried to do this to "empty" the menu-items, but with no luck:


string $buttons[] = `zooGetShelfButtonAll buttonTag1`;
for( $a in $buttons ) { }


Is there a special way to erase menuItems?


EDIT: OK, I found this way to delete menuItems

popupMenu -e -deleteAllItems buttonTag1

Where buttonTag1 is the name of the menu.
Now I wonder if I can make a proc whith a system that erases all the menuItems I created. I could make a list of menuItems I created and erase them manually, but thats not nice.
Should I name them in a particular way, so I can find them easily and erase them all with a script?

I used the string $menu when creating the menus, but maybe it is out of reach after I run my script the first time?

CGTalk Moderation
05-15-2007, 11:16 AM
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.