Go to: Synopsis. Return value. Keywords. Flags. Python examples.
attributeMenu([beginMenu=boolean], [editor=string], [finishMenu=boolean], [inputs=boolean], [plug=name], [regPulldownMenuCommand=string], [unregPulldownMenuCommand=int])
Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.
attributeMenu is NOT undoable, NOT queryable, and NOT editable.
Action to generate popup connection menus for Hypershade. This command is
used internally by the Hypershade panel.
render, hypergraph, shader, hypershade
beginMenu, editor, finishMenu, inputs, plug, regPulldownMenuCommand, unregPulldownMenuCommand
Long name (short name) |
Argument types |
Properties |
beginMenu(beg)
|
boolean
|
|
|
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)
|
string
|
|
|
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)
|
boolean
|
|
|
inputs(inp)
|
boolean
|
|
|
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)
|
name
|
|
|
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.
|
|
regPulldownMenuCommand(rpm)
|
string
|
|
|
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.
|
|
unregPulldownMenuCommand(upm)
|
int
|
|
|
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 command
|
Flag can appear in Edit mode of command
|
Flag can appear in Query mode of command
|
Flag can have multiple arguments, passed either as a tuple or a list.
|
import maya.cmds as cmds
cmds.attributeMenu( 'nodeName', inputs=1, beginMenu=True, editor='editor' )
cmds.attributeMenu( 'nodeName', inputs=0, beginMenu=True, editor='editor' )