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.
Flags:
Long Name / Short Name | Argument Types | Properties | |
---|---|---|---|
attribute / at | unicode | ![]() |
|
|
|||
axis / ax | unicode | ![]() |
|
|
|||
clutch / c | unicode | ![]() |
|
|
|||
device / d | unicode | ![]() |
|
|
|||
file / f | unicode | ![]() |
|
|
|||
selection / sl | bool | ![]() |
|
|
|||
write / w | bool | ![]() |
|
|
Derived from mel command maya.cmds.listDeviceAttachments
Example:
import pymel.core as pm
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 )