MECO™ API Reference
Functions
mMayaGUI.menuLib Namespace Reference

[ FILE ] - Operate on menus in Maya. More...

Functions

def createMenu (path, command, icon=None, mainTearOff=True, mainAllowOptionBoxes=True, mainDeleteFirst=False, tearOff=True, allowOptionBoxes=True, deleteFirst=False, addSeparator=False)
 Create a main menu. More...
 
def initializeMenus ()
 This function creates menus in Maya based on the application info classes available in PYTHONPATH. More...
 

Detailed Description

[ FILE ] - Operate on menus in Maya.

Function Documentation

◆ createMenu()

def mMayaGUI.menuLib.createMenu (   path,
  command,
  icon = None,
  mainTearOff = True,
  mainAllowOptionBoxes = True,
  mainDeleteFirst = False,
  tearOff = True,
  allowOptionBoxes = True,
  deleteFirst = False,
  addSeparator = False 
)

Create a main menu.

Parameters
path[ str | None | in ] - Path of the menu.
command[ str | None | in ] - Command of the menu item.
icon[ str | None | in ] - Absolute path of an icon.
mainTearOff[ bool | True | in ] - Enable tear-off feature of the main menu.
mainAllowOptionBoxes[ bool | True | in ] - Allow option boxes for main menu items.
mainDeleteFirst[ bool | False | in ] - Delete main menu first.
tearOff[ bool | True | in ] - Enable tear-off feature of the sub menu(s).
allowOptionBoxes[ bool | True | in ] - Allow option boxes for sub menu items.
deleteFirst[ bool | False | in ] - Delete sub menu(s) first.
addSeparator[ bool | False | in ] - Add a separator before the menu item.
Exceptions
N/A
Returns
str list - String list which contains the name of the created menus and menu item.

◆ initializeMenus()

def mMayaGUI.menuLib.initializeMenus ( )

This function creates menus in Maya based on the application info classes available in PYTHONPATH.

Function do not initialize menus and returns False if Maya is not running in OpenMaya.MGlobal.kInteractive mode.

See also
mApplication.applicationInfoAbs.ApplicationInfo
Exceptions
N/A
Returns
bool - Result