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).
Long name (short name) | Argument Types | Properties | |
---|---|---|---|
annotation (ann) | unicode | ||
|
|||
command (c) | callable | ||
|
|||
data1 (da1) | unicode | ||
data2 (da2) | unicode | ||
data3 (da3) | unicode | ||
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 have multiple arguments, passed either as a tuple or a list. |
|||
default (d) | bool | ||
|
|||
sourceType (stp) | unicode | ||
|
Derived from mel command maya.cmds.nameCommand
Example:
import pymel.core as pm
# Create a nameCommand object.
#
pm.nameCommand( 'circleToolNameCommand', ann='The Circle Tool', c='pm.setToolTo("circleContext")' )
# Result: u'circleToolNameCommand' #
# Now map the nameCommand to a hotkey.
#
pm.hotkey( keyShortcut='F5', altModifier=True, name='circleToolNameCommand' )