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

Synopsis

setAttrMapping [-absolute] [-attribute string] [-axis string] [-clutch string] [-device string] [-offset float] [-relative] [-scale float] [-selection]

setAttrMapping is undoable, queryable, and NOT editable.

This command applies an offset and scale to a specified device attachment. This command is different than the setInputDeviceMapping command, which applies a mapping to a device axis.

The value from the device is multiplied by the scale and the offset is added to this product. With an absolute mapping, the attached attribute gets the resulting value. If the mapping is relative, the resulting value is added to the previous calculated value. The calculated value will also take into account the setInputDeviceMapping, if it was defined.

As an example, if the space ball is setup with absolute attachment mappings, pressing in one direction will cause the attached attribute to get a constant value. If a relative mapping is used, and the spaceball is pressed in one direction, the attached attribute will get a constantly increasing (or constantly decreasing) value.

Note that the definition of relative is different than the definition used by the setInputDeviceMapping command. In general, both a relative attachment mapping (this command) and a relative device mapping (setInputDeviceMapping) should not be used together one the same axis.

Return value

None

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

Flags

absolute, attribute, axis, clutch, device, offset, relative, scale, selection
Long name (short name) Argument types Properties
-absolute(-a) create
Make the mapping absolute.
-attribute(-at) string createmultiuse
The attribute used in the attachment.
-axis(-ax) string create
The axis on the device used in the attachment.
-clutch(-c) string create
The clutch button used in the attachment.
-device(-d) string create
The device used in the attachment.
-offset(-o) float create
Specify the offset value.
-relative(-r) create
Make the mapping relative.
-scale(-s) float create
Specify the scale value.
-selection(-sl) create
This flag specifies the mapping should be on the selected objects

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" -at "translateX";
setAttrMapping -d "spaceball" -ax "XAxis" -at "translateX" -scale 0.01;

// The first command will assign the XAxis of the spaceball to
// the translateX attribute of the selected objects.
// The second command sets the scaling of attribute value to
// 0.01 of the value of the axis. This results in finer control
// since the motions of the spaceball are damped.