This command lists the current set of device attachments. The listing is in the form of the commands required to recreate them. This includes both attachments and device mappings.
Long name (short name) | Argument Types | Properties | |
---|---|---|---|
attribute (at) | unicode | ||
|
|||
axis (ax) | unicode | ||
|
|||
clutch (c) | unicode | ||
|
|||
device (d) | unicode | ||
|
|||
file (f) | unicode | ||
Specify the name of the file to write out device attachments.Flag can appear in Create mode of commandFlag can have multiple arguments, passed either as a tuple or a list. |
|||
selection (sl) | bool | ||
|
|||
write (w) | bool | ||
|
Derived from mel command maya.cmds.listDeviceAttachments
Example:
import pymel.core as pm
import maya.cmds as cmds
pm.listDeviceAttachments()# List all attachments
# Result: [u'\n', u'', u'\tsetInputDeviceMapping -d "virtualClock" -ax "hours" -s 1 -o 0 -a ;\n\tsetInputDeviceMapping -d "virtualClock" -ax "minutes" -s 1 -o 0 -a ;\n\tsetInputDeviceMapping -d "virtualClock" -ax "seconds" -s 1 -o 0 -a ;\n'] #
# List attachments on the spaceball that are clutched on Button1
pm.listDeviceAttachments( d='spaceball', c='Button1' )
# write out attachments for the spaceball device, since there is
# no file name specified, attachments will be written out to
# spaceball.mel
pm.listDeviceAttachments( d='spaceball', w=True )
# write out attachments for all devices, since there is not file
# name specified, attachments will be written out to devices.mel
pm.listDeviceAttachments( w=True )