Create a menu set which is used to logically order menus for display in the main menu bar. Such menu sets can be edited and reordered dynamically.
Long name (short name) | Argument Types | Properties | |
---|---|---|---|
addMenu (am) | unicode | ||
|
|||
allMenuSets (ams) | bool | ||
|
|||
currentMenuSet (cms) | unicode | ||
|
|||
exists (ex) | unicode | ||
|
|||
hotBoxVisible (hbv) | bool | ||
|
|||
insertMenu (im) | unicode, int | ||
|
|||
label (l) | unicode | ||
|
|||
menuArray (ma) | string[...] | ||
|
|||
moveMenu (mm) | unicode, int | ||
|
|||
moveMenuSet (mms) | unicode, int | ||
|
|||
numberOfMenuSets (nms) | bool | ||
|
|||
numberOfMenus (nm) | bool | ||
|
|||
permanent (p) | bool | ||
|
|||
removeMenu (rm) | unicode | ||
|
|||
removeMenuSet (rms) | unicode | ||
|
Derived from mel command maya.cmds.menuSet
Example:
import pymel.core as pm
# creating a new menu set;
pm.menuSet( 'newMenuSetObjName', label='newMenuSet Label' )
# Result: u'newMenuSetObjName' #
# using commands on a current menu set
# first find the menu set if you don't know the name of it
animMS = maya.mel.eval('findMenuSetFromLabel("Animation")')
# menu sets can be queried like normal commands
animMenus = pm.menuSet(animMS, query=True, menuArray=True)
# but editing the set requires either setting the current menu set...
# (notice that the menu set comamnds following specify no specific menu set)
pm.menuSet( currentMenuSet=animMS )
# Result: u'animationMenuSet' #
pm.menuSet( removeMenu=animMenus[0] )
# Result: u'animationMenuSet' #
# : (other commands which pertain to the animation menu set)
# .. or temporarily setting the menu set to work on (does not affect current menu set)
# (notice that every command following specifies the specific set to apply operations to)
polyMS = maya.mel.eval('findMenuSetFromLabel("Polygons")')
polyMenus = pm.menuSet(polyMS, query=True, menuArray=True)
pm.menuSet( modelMS, removeMenu=polyMenus[0], insertMenu=(polyMenus[1], 0) )
# .. where the following commands still affect the animation menu set
animMenus = pm.menuSet(query=True, menuArray=True)
# if you need to find a specific menu...
deformMenu = maya.mel.eval( ('findMenuFromMenuSet(\"' + animMS + '\", "Deform")') )
# moving a menu from one spot to another
# (ie. moving the Deform Menu to the front of the list)
pm.menuSet( moveMenu=(deformMenu, 0) )
pymel.core.windows.menuSetPref
Enter search terms or a module, class or function name.