Custom drop-down menus?

Custom drop-down menus?

Anonymous
Not applicable
1,439 Views
5 Replies
Message 1 of 6

Custom drop-down menus?

Anonymous
Not applicable
Hey

I found a tutorial online to help create my own drop-down menu for maya 2011, the idea is to increase screen space by removing the tool box and shelf. The tutorial can be found at http://www.technolumiere.com/vfx/tutorials/customMenus.html

So my question is how do I add commands that have option boxes ?(example extrude, move tool etc.) I have about 20 commands I use all the time and I can find out their process calls by checking the script editor but I am not sure how to include the option box in the drop down. Also the tutorial above does not say how to have the drop down tear off like the other ones. Anyone ?

Thanks.
0 Likes
1,440 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable
Here's an example

window -menuBar true -width 200;
menu -label "myMenu" -tearOff true;
menuItem -label "myOptions" -command "myTool";
menuItem -optionBox true -command "myToolOptions";
columnLayout;
showWindow;
0 Likes
Message 3 of 6

Anonymous
Not applicable
So I finished making my first drop-down menu in an effort to maximize screen space in maya. I might add another drop-down for camera views and stuff, I will make a list as I continue working now to see what commands and tools I use.

So how do I have this script run automatically at startup everytime ?

0 Likes
Message 4 of 6

Anonymous
Not applicable
put it (or something that calls it) into

userSetup.mel
or
userSetup.py

in your maya/scripts folder
0 Likes
Message 5 of 6

Anonymous
Not applicable
This is how far I got, so far I'm happy. I got full screen for maximum action :D. I am still vague about the startup part so for now I have a tab open in script editor that I run when I start maya. I could live with that. Thanks for the help guys.

0 Likes
Message 6 of 6

Anonymous
Not applicable
take what is in the tab and put it in a file named
userSetup.py
or
userSetup.mel
depending on the language

and then, the trick that you proabably need to do, since this is a UI thing and you want to wait for Maya to build its UI before you add in yours:


if you're in mel, use

evalDeferred myMELproc()




or in python...

import maya.utils as utils
myScript = """

put
your
script
in between
here

"""

utils.executeDeferred (myScript)



also, in the python one, you could execute the string as mel...

import maya.mel as mel

.
.
.

utils.executeDeferred('mel.eval(myScript)')
0 Likes