pymel.core.windows.attributeMenu

attributeMenu(*args, **kwargs)

Action to generate popup connection menus for Hypershade. This command is used internally by the Hypershade panel.

Flags:
Long name (short name) Argument Types Properties
beginMenu (beg) bool ../../../_images/create.gif
 

If true the menu will be used to start a connection edit so it will list all available attributes for either inputs or outputs. If false the menu will be used to complete a connection so it will list only the attributes compatible with the attribute at the other end of the connection. A plug must be supplied in this case.

editor (edt) unicode ../../../_images/create.gif
 

Name of the Hypergraph, Hypershade or Visor editor for which this menu is being built. This argument is no longer mandatory. If it is omitted, the inputs flag and the node must be used to specify the search targets. This allows attributeMenu to be used in the absence of a hypershade editor.

finishMenu (fsh) bool ../../../_images/create.gif
 
finishes the menu
inputs (inp) bool ../../../_images/create.gif
 
If true only attributes which can be used as inputs will be listed. If false only attributes which can be used as outputs will be listed
plug (p) PyNode ../../../_images/create.gif
 
If inputs is false then we are completing a connection and the name of the plug at the other end of the connection must be supplied.
| .. |
rpm)** | unicode | .. image:: /images/create.gif |
 

This flag will register a callback that allows the user to define their own popup menu for a specific node type for use in the Hypershade and Hypergraph editor. The command signature should look like this: global proc int proc_name(string $editorName, string $nodeName, string $plug, string $mode, string $menuType)The method should return 0 if it does not recognize the node type and the default attributeMenu popup menu will be displayed. If the callback returns one then the menu is considered built and no other menuItems will be added to the popup. The return value from this flag will be the ID to use for the -unregPulldownMenuCommand flag.

| .. |
upm)** | int | .. image:: /images/create.gif |
 

This flag will unregister a callback procedure that was registered with the -regPulldownMenuCommand flag. The argument should be the integer identifier returned from the -regPulldownMenuCommand flag.Flag can appear in Create mode of commandFlag can have multiple arguments, passed either as a tuple or a list.

Derived from mel command maya.cmds.attributeMenu

Example:

import pymel.core as pm

import maya.cmds as cmds

pm.attributeMenu( 'nodeName', inputs=1, beginMenu=True, editor='editor' )
pm.attributeMenu( 'nodeName', inputs=0, beginMenu=True, editor='editor' )

Previous topic

pymel.core.windows.attrNavigationControlGrp

Next topic

pymel.core.windows.autoLayout

Core

Core Modules

Other Modules

This Page