Go to: Synopsis. Flags. Return value. Python examples.
nameCommand(
[objectName]
, [annotation=string], [command=string], [data1=string], [data2=string], [data3=string], [default=boolean])
Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.
nameCommand is undoable, queryable, and editable.
This command creates a nameCommand object. Each nameCommand object
can be connected to a hotkey. Thereafter, the nameCommand's command
string will be executed whenever the hotkey is pressed (or released,
as specified by the user).
annotation, command, data1, data2, data3, default
| Long name (short name) |
[argument types] |
Properties |
annotation(ann)
|
string
|
|
|
A description of the command.
|
|
command(c)
|
string
|
|
|
The command that is executed
when the nameCommand is invoked.
|
|
default(d)
|
boolean
|
|
|
Indicate that this name command is a default command.
Default name commands will not be saved to preferences.
|
|
data1(da1)
|
string
|
|
|
|
data2(da2)
|
string
|
|
|
|
data3(da3)
|
string
|
|
|
These are optional, user-defined data strings that
are attached to the nameCommand object. They can be
edited or queried using the assignCommand command.
|
|
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.
|
None
import maya.cmds as cmds
# Create a nameCommand object.
#
cmds.nameCommand( 'circleToolNameCommand', ann='The Circle Tool', c='setToolTo circleContext' )
# Now map the nameCommand to a hotkey.
#
cmds.hotkey( keyShortcut='F5', altModifier=True, name='circleToolNameCommand' )
Return to Autodesk Index