pymel.core.system.listDeviceAttachments

listDeviceAttachments(*args, **kwargs)

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 ../../../_images/create.gif
 
specify the attribute attachments to list
axis (ax) unicode ../../../_images/create.gif
 
specify the axis attachments to list
clutch (c) unicode ../../../_images/create.gif
 
List only attachment clutched with this button
device (d) unicode ../../../_images/create.gif
 
specify which device attachments to list
file (f) unicode ../../../_images/create.gif
 
Specify the name of the file to write out device attachments. Flag can have multiple arguments, passed either as a tuple or a list.
selection (sl) bool ../../../_images/create.gif
 
This flag list only attachments on selection
write (w) bool ../../../_images/create.gif
 
Write out device attachments to a file specified by the -f flag, is set. If -f is not set, it’ll write out to a file named for the device.

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 )

Previous topic

pymel.core.system.launchImageEditor

Next topic

pymel.core.system.listInputDeviceAxes

Core

Core Modules

Other Modules

This Page