mmSolver.ui.shelfutils#

Functions to create Maya shelves and buttons.

mmSolver.ui.shelfutils.get_shelves_parent()#

Get Maya UI path to the parent of all shelves in Maya.

Returns:

Maya UI path of shelf parent layout.

Return type:

str

mmSolver.ui.shelfutils.create_shelf(parent=None, name=None)#

(Re-)Create a shelf.

If a shelf with ‘name’ is already exists, the exising shelf will be deleted, and re-created under the ‘parent’ argument given.

Parameters:
  • parent (str) – What layout will this shelf be placed under?

  • name (str) – Name (label) of the shelf displayed to the user. The value should only contain characters A-Z (or a-z) and underscores ‘_’.

Returns:

Shelf UI path, or None if cannot be found.

Return type:

str or None

mmSolver.ui.shelfutils.create_shelf_button(parent=None, name=None, tooltip=None, icon=None, cmd=None, cmdLanguage=None)#

Create a shelf button.

Parameters:
  • parent (str) – What should this control be placed under?

  • name (str) – Name (label) of the shelf button. Should be under seven characters long.

  • tooltip (str) – The text shown to the user when hovering the mouse over the shelf button.

  • icon (str) – Choose the image to display on the shelf button. Should be 32x32 pixels.

  • cmd (str) – The command text to run when the shelf button is pressed.

  • cmdLanguage (str) – What language is ‘cmd’ argument in? ‘python’ or ‘mel’?

Returns:

Maya button UI control path.

Return type:

str

mmSolver.ui.shelfutils.create_shelf_separator(parent=None)#

Create a shelf button separator.

Parameters:

parent (str) – What should this control be placed under?

Returns:

Maya separator UI control path.

Return type:

str

mmSolver.ui.shelfutils.create_popup_menu(*args, **kwargs)#
mmSolver.ui.shelfutils.create_menu_item(*args, **kwargs)#