This command creates a popup menu and attaches it to the current control if no parent is specified. The popup menu is posted with the right mouse button by default. Popup menus can be added to any kind of control, however, on some widgets, only the standard menu button (3rd mouse button) can be used to trigger popup menus. This is to meet generally accepted UI guidelines that assign the 3rd mouse button and only this one to popup menus, and also to prevent unexpected behavior of controls like text fields, that expect 1st and 2nd button to be reserved for contextual operations like text or item selection...
Long name (short name) | Argument Types | Properties | |
---|---|---|---|
allowOptionBoxes (aob) | bool | ||
Indicate whether the menu will be able to support option box menu items. An error results if an option box item is added to a menu that doesn’t allow them. This flag may be queried and must be specified when the popup menu is created. The default value is false. |
|||
altModifier (alt) | bool | ||
|
|||
button (b) | int | ||
|
|||
ctrlModifier (ctl) | bool | ||
|
|||
defineTemplate (dt) | unicode | ||
deleteAllItems (dai) | bool | ||
|
|||
exists (ex) | bool | ||
itemArray (ia) | bool | ||
|
|||
markingMenu (mm) | bool | ||
|
|||
numberOfItems (ni) | bool | ||
|
|||
parent (p) | unicode | ||
postMenuCommand (pmc) | script | ||
|
|||
postMenuCommandOnce (pmo) | bool | ||
|
|||
shiftModifier (sh) | bool | ||
|
|||
useTemplate (ut) | unicode | ||
Derived from mel command maya.cmds.popupMenu
Example:
import pymel.core as pm
pm.window()
# Result: ui.Window('window1') #
pm.columnLayout()
# Result: ui.ColumnLayout('window1|columnLayout69') #
pm.button()
# Result: ui.Button('window1|columnLayout69|button66') #
pm.popupMenu()
# Result: ui.PopupMenu('window1|columnLayout69|button66|popupMenu90') #
pm.menuItem()
# Result: ui.CommandMenuItem('window1|columnLayout69|button66|popupMenu90|menuItem931') #
pm.menuItem()
# Result: ui.CommandMenuItem('window1|columnLayout69|button66|popupMenu90|menuItem932') #
pm.menuItem()
# Result: ui.CommandMenuItem('window1|columnLayout69|button66|popupMenu90|menuItem933') #
pm.text()
# Result: ui.Text('window1|columnLayout69|text5') #
pm.popupMenu( button=1 )
# Result: ui.PopupMenu('window1|columnLayout69|text5|popupMenu91') #
pm.menuItem()
# Result: ui.CommandMenuItem('window1|columnLayout69|text5|popupMenu91|menuItem934') #
pm.menuItem()
# Result: ui.CommandMenuItem('window1|columnLayout69|text5|popupMenu91|menuItem935') #
pm.menuItem()
# Result: ui.CommandMenuItem('window1|columnLayout69|text5|popupMenu91|menuItem936') #
pm.checkBox( 'aCheckBox' )
# Result: ui.CheckBox('window1|columnLayout69|aCheckBox') #
pm.popupMenu( parent='aCheckBox', alt=True, ctl=True )
# Result: ui.PopupMenu('window1|columnLayout69|aCheckBox|popupMenu92') #
pm.menuItem()
# Result: ui.CommandMenuItem('window1|columnLayout69|aCheckBox|popupMenu92|menuItem937') #
pm.menuItem()
# Result: ui.CommandMenuItem('window1|columnLayout69|aCheckBox|popupMenu92|menuItem938') #
pm.menuItem()
# Result: ui.CommandMenuItem('window1|columnLayout69|aCheckBox|popupMenu92|menuItem939') #
pm.showWindow()
pymel.core.windows.progressBar
Enter search terms or a module, class or function name.