Go to: Synopsis. Return value. Related. Flags. MEL examples.

Synopsis

attachDeviceAttr [-attribute string] [-axis string] [-camera] [-cameraRotate] [-cameraTranslate] [-clutch string] [-device string] [-selection]

attachDeviceAttr is undoable, queryable, and NOT editable.

This command associates a device/axis pair with a node/attribute pair. When the device axis moves, the value of the attribute is set to the value of the axis. This value can be scaled and offset using the setAttrScale command.

Return value

None

In query mode, return type is based on queried flag.

Related

assignInputDevice, detachDeviceAttr, devicePanel, getInputDeviceRange, getModifiers, listDeviceAttachments, listInputDeviceAxes, listInputDeviceButtons, listInputDevices, recordAttr, setAttrMapping, setInputDeviceMapping, unassignInputDevice

Flags

attribute, axis, camera, cameraRotate, cameraTranslate, clutch, device, selection
Long name (short name) Argument types Properties
-device(-d) string create
specify which device to assign the command string.
-clutch(-c) string create
specify a clutch button. This button must be down for the command string to be executed. If no clutch is specified the command string is executed everytime the device state changes
-attribute(-at) string createmultiuse
specify the attribute to attach to
-axis(-ax) string create
specify the axis to attach from.
-selection(-sl) create
This flag attaches to the nodes in the selection list. This is different from the default arguments of the command since changing the selection will change the attachments.
-camera(-cam) create
This flag attaches the device/axis to the current camera. The mapping between device axes and camera controls is uses a heuristic based on the device descripton. The interaction is a copy of the mouse camera navigation controls.
-cameraTranslate(-ct) create
This flag attaches the device/axis to the current cameras translate controls.
-cameraRotate(-cr) create
This flag attaches the device/axis to the current cameras rotation controls.

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 be used more than once in a command.

MEL examples

attachDeviceAttr -d "spaceball" -ax "XAxis" "surface1.translateX";

// This command will assign the XAxis of the spaceball to
// the translateX attribute of surface1.  This
// assignment is independent of the selection list (i.e.
// if surface1 was selected when the command is executed,
// surface1 will be translated by the spaceball regardless
// of the current selection.)

attachDeviceAttr -d "spaceball" -ax "XAxis" -at translateX;

// This command will assign the XAxis of the spaceball to
// the translateX attribute of the selected objects.

attachDeviceAttr -d "wacom" -ax "puck:X" -c "puckButton1" -at "translateX" -sl;
attachDeviceAttr -d "wacom" -ax "puck:Y" -c "puckButton1" -at "translateY" -sl;

// This command will attach the wacom puck X and Y axes to the
// X and Y translate attributes of the selected items.
// When the selection changes so does the attachment.
// The -c option means you can only move the selected items
// with the puck when button1 on the puck is down.