Go to: Synopsis. Return value. Flags. MEL examples.
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.
None
In query mode, return type is based on queried flag.
absolute, attribute, axis,
clutch, device,
offset, relative, scale,
selection
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. |
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.