PDA

View Full Version : close menu items? (mel)


swag
11-27-2002, 11:25 PM
how i close a menu item - i make some shelf item to add some nice scripts to the maya menu (MJpolyTools, goomoo...) but how
i can kill them from the menu - the best is to make a toggle but how?

meloncully
11-27-2002, 11:40 PM
i am sorry, but can you phraise your question a little better? because its kinda hard to understand.

swag
11-27-2002, 11:47 PM
ok - i try - u have the maya main menubar some scripts like MJpolyTools goes in there after they called by userSetup.mel
what i will do is kill them from the main menubar after they load
- the best is a toggle so i can turn them on/off

meloncully
11-28-2002, 12:20 AM
you might could edit the usersetup.mel or make a mel script that would be stored in shelf(to make a shelf button from mel in the script editor easily, you just highlight the text and middle-click drag to the shelf you want) and have it set to hide/display the menu.


i dont know the mel for this, i just know a kinda psuedo code :p. but you could look in the mel ref manual that came with maya.

swag
11-28-2002, 01:16 AM
hehehe - i read the mel ref ... here is what i try

menu -en false -label "MJ Poly Tools 1.3";

and maya says

// Result: MayaWindow|menu36 //

but the menu dont disables!

so - and know iam here and hope someone can help me

artifish
11-28-2002, 10:14 AM
hi. what your mel does is: you create a menu that is not enabled and has the label "MJ Poly Tools 1.3". you don't attach it to anything, so it is not visible.
what you want is to edit the state of an existing menu, so you've got to use the edit flag
eg. to disable it: menu - e -en false [nameOfMenuHere];
to kill the menu use this: deleteUI [nameOfMenuHere];

to get the name of the menu (don't use mjPolyTools so I can't help you directly) read the mels that come with it, somewhere in it should be the mel that build the menu and attaches itself to the menu bar (search for something like: menu -label "MJ Poly Tools 1.3" [nameOfMenu]; )

swag
11-28-2002, 03:25 PM
Thanks it works :)

CGTalk Moderation
01-13-2006, 09: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.