Go to: Related nodes. Attributes.

This node implements an aimConstraint. Each constraint has a set of targets that are connected under the target attribute, a single constrained object that is connected to the constraint* attributes, and possibly other information to help compute the correct results. In the case of the aimConstraint, the additional information is: aimVector, upVector, worldUpVector, worldUpMatrix, and worldUpType.

The aimConstraint node can have any number of target inputs. Each target is connected to attributes inside a single element of the target attribute. For example, the first target object would be connected elements of target[0], the second target object would be connected to elements of target[1], etc. The elements of each target are: targetTranslate, targetRotatePivot, targetRotateTranslate, targetParentMatrix, and targetWeight.

The elements of each target are normally connected to the target objects as follows:

aimConstraint attribute connected to
targetTranslate translate
targetRotatePivot rotatePivot
targetRotateTranslate rotatePivotTranslate
targetParentMatrix parentMatrix[i]
targetWeight set to 1.0

The targetWeight attribute is not generally connected to the target object. Instead, it may be animated by other means to adjust the weighted average computation for the target point.

The aimConstraint node uses these inputs to compute the world space position of the pivot point of each target object. It then computes a weighted average of the these pivot points. This weighted average is called the target point.

The constrained object is connected to the constraint* attributes. For an aimConstraint, the constraintTranslate, constraintRotatePivot, constraintRotateTranslate, constraintJointOrient, and constraintParentInverseMatrix are inputs to the aimConstraint. The attributes constraintRotate and constraintVector are outputs.

The additional aimConstraint inputs tell the constraint node how to orient the constrained object. The aimVector attribute defines a vector in the space of the constrained object that should be oriented along the line from the pivot point of the constrained object to the target point. The upVector, worldUpVector, worldUpMatrix, and worldUpType define how the constrained object is rotated about the aimVector.

The upVector defines a vector in the space of the constrained object, very much like the aimVector does. The constrained object is rotated so that the aimVector points at the target point and so that the upVector aligns as closely as possible with the computed world up vector. The world up vector is determined by the worldUpType, worldUpVector, and worldUpMatrix attributes.

The attribute worldUpType can have one of 5 values, which affects the calculation of the world up vector as shown in the following table.

Mnemonic Value Description
scene 0 The upVector is aligned with the up axis of the scene and worldUpVector and worldUpObject are ignored.
object 1 The upVector is aimed as closely as possible to the origin of the space of the worldUpObject and the worldUpVector is ignored.
objectrotation 2 The worldUpVector is interpreted as being in the coordinate space of the worldUpObject, transformed into world space and the upVector is aligned as closely as possible to the result.
vector 3 Default: The upVector is aligned with worldUpVector as closely as possible and worldUpMatrix is ignored.
none 4 No up vector is used in the computation of the orientation of the constrained object; only the aim vector and the target's position are used. Specifying an up vector can cause flipping to occur if the constrained object's new orientation vector is close to the up vector. If the worldUpType is instead set to none, this flipping won't happen, at a loss of control over twisting.

While setAttr requires the numeric values for the worldUpType attribute, both numeric and mnemonic values are allowed by the aimConstraint command.

Although the all the constraint nodes inherit from transform, they do not actively use any of the attributes from transform.

Node nameParentsClassificationMFn typeCompatible function sets

Related nodes

geometryConstraint, normalConstraint, orientConstraint, parentConstraint, pointConstraint, poleVectorConstraint, tangentConstraint, scaleConstraint, lookAt

Attributes (69)

The following quick index only shows top-level attributes (too many attributes to show them all): aimVector (3), constraintJointOrient (3), constraintParentInverseMatrix, constraintRotate (3), constraintRotateOrder, constraintRotatePivot (3), constraintRotateTranslate (3), constraintTranslate (3), constraintVector (3), inverseScale (3), offset (3), restRotate (3), scaleCompensate, target (14), upVector (3), useOldOffsetCalculation, worldUpMatrix, worldUpType, worldUpVector (3)

Long name (short name)TypeDefaultFlags
target (tg) compoundn/aarrayoutputinputconnectablestorable
Array of all information for all the targets
targetTranslate (tt) double3outputinputconnectablestorable
Input translate of a target.
targetTranslateX (ttx) distance (double)0.0cmoutputinputconnectablestorable
Input translateX of a target.
targetTranslateY (tty) distance (double)0.0cmoutputinputconnectablestorable
Input translateY of a target.
targetTranslateZ (ttz) distance (double)0.0cmoutputinputconnectablestorable
Input translateZ of a target.
targetRotatePivot (trp) double3outputinputconnectablestorable
Input rotatePivot of a target.
targetRotatePivotX (trpx) distance (double)0.0cmoutputinputconnectablestorable
Input rotatePivotX of a target.
targetRotatePivotY (trpy) distance (double)0.0cmoutputinputconnectablestorable
Input rotatePivotY of a target.
targetRotatePivotZ (trpz) distance (double)0.0cmoutputinputconnectablestorable
Input rotatePivotZ of a target.
targetRotateTranslate (trt) double3outputinputconnectablestorable
Input rotatePivotTranslate of a target.
targetRotateTranslateX (trtx) distance (double)0.0cmoutputinputconnectablestorable
Input rotatePivotTranslateX of a target.
targetRotateTranslateY (trty) distance (double)0.0cmoutputinputconnectablestorable
Input rotatePivotTranslateY of a target.
targetRotateTranslateZ (trtz) distance (double)0.0cmoutputinputconnectablestorable
Input rotatePivotTranslateZ of a target.
targetParentMatrix (tpm) matrixidentityoutputinputconnectablestorable
Input parentMatrix of a target.
targetWeight (tw) double1.0outputinputconnectablestorable
Input weight for a target.
constraintParentInverseMatrix (cpim) matrixidentityoutputinputconnectablestorable
Input parentInverseMatrix for the constrained object.
aimVector (a) double31.0,0.0,0.0outputinputconnectablestorable
Input aimVector in constrained object coordinate system.
aimVectorX (ax) double1.0outputinputconnectablestorable
Input aimVectorX in constrained object coordinate system.
aimVectorY (ay) double0.0outputinputconnectablestorable
Input aimVectorY in constrained object coordinate system.
aimVectorZ (az) double0.0outputinputconnectablestorable
Input aimVectorZ in constrained object coordinate system.
upVector (u) double30.0,1.0,0.0outputinputconnectablestorable
Input upVector in constrained object coordinate system.
upVectorX (ux) double0.0outputinputconnectablestorable
Input upVectorX in constrained object coordinate system.
upVectorY (uy) double1.0outputinputconnectablestorable
Input upVectorY in constrained object coordinate system.
upVectorZ (uz) double0.0outputinputconnectablestorable
Input upVectorZ in constrained object coordinate system.
worldUpVector (wu) double30.0,1.0,0.0outputinputconnectablestorable
Input worldUpVector in world coordinates.
worldUpVectorX (wux) double0.0outputinputconnectablestorable
Input worldUpVectorX in world coordinates.
worldUpVectorY (wuy) double1.0outputinputconnectablestorable
Input worldUpVectorY in world coordinates.
worldUpVectorZ (wuz) double0.0outputinputconnectablestorable
Input worldUpVectorZ in world coordinates.
worldUpMatrix (wum) matrixidentityoutputinputconnectablestorable
Input worldMatrix for the up object.
worldUpType (wut) enum3 vectoroutputinputconnectablestorable
Input control value for computation of world up vector.
constraintTranslate (ct) double3outputinputconnectablestorable
Input constrained object translate value.
constraintTranslateX (ctx) distance (double)0.0cmoutputinputconnectablestorable
Input constrained object translateX value.
constraintTranslateY (cty) distance (double)0.0cmoutputinputconnectablestorable
Input constrained object translateY value.
constraintTranslateZ (ctz) distance (double)0.0cmoutputinputconnectablestorable
Input constrained object translateZ value.
constraintRotatePivot (crp) double3outputinputconnectablestorable
Input constrained object rotatelPivot value.
constraintRotatePivotX (crpx) distance (double)0.0cmoutputinputconnectablestorable
Input constrained object rotatelPivotX value.
constraintRotatePivotY (crpy) distance (double)0.0cmoutputinputconnectablestorable
Input constrained object rotatelPivotY value.
constraintRotatePivotZ (crpz) distance (double)0.0cmoutputinputconnectablestorable
Input constrained object rotatelPivotZ value.
constraintRotateTranslate (crt) double3outputinputconnectablestorable
Input constrained object rotatePivotTranslate value.
constraintRotateTranslateX (crtx) distance (double)0.0cmoutputinputconnectablestorable
Input constrained object rotatePivotTranslateX value.
constraintRotateTranslateY (crty) distance (double)0.0cmoutputinputconnectablestorable
Input constrained object rotatePivotTranslateY value.
constraintRotateTranslateZ (crtz) distance (double)0.0cmoutputinputconnectablestorable
Input constrained object rotatePivotTranslateZ value.
constraintRotateOrder (cro) enum0outputinputconnectablestorable
Input constrained object rotate order value.
constraintJointOrient (cjo) double3outputinputconnectablestorable
Input constrained object joint orient (if any).
constraintJointOrientX (cjox) angle (double)0.0degoutputinputconnectablestorable
Input constrained object joint orient X.
constraintJointOrientY (cjoy) angle (double)0.0degoutputinputconnectablestorable
Input constrained object joint orient Y.
constraintJointOrientZ (cjoz) angle (double)0.0degoutputinputconnectablestorable
Input constrained object joint orient Z.
scaleCompensate (ssc) booltrueoutputinputconnectablestorable
Indicates whether to compensate for the scale of the parent joint.
inverseScale (is) double3outputinputconnectablestorable
Input constrained object scale of the parent joint.
inverseScaleX (isx) double1.0outputinputconnectablestorable
X component of aParentScale.
inverseScaleY (isy) double1.0outputinputconnectablestorable
Y component of aParentScale.
inverseScaleZ (isz) double1.0outputinputconnectablestorable
Z component of aParentScale.
constraintRotate (cr) double3outputconnectable
Output constrained object rotate.
constraintRotateX (crx) angle (double)0.0degoutputconnectable
Output constrained object rotateX.
constraintRotateY (cry) angle (double)0.0degoutputconnectable
Output constrained object rotateY.
constraintRotateZ (crz) angle (double)0.0degoutputconnectable
Output constrained object rotateZ.
constraintVector (cv) double3outputconnectable
Output vector from constrained object to target position
constraintVectorX (cvx) distance (double)0.0cmoutputconnectable
Output X vector from constrained object to target position
constraintVectorY (cvy) distance (double)0.0cmoutputconnectable
Output Y vector from constrained object to target position
constraintVectorZ (cvz) distance (double)0.0cmoutputconnectable
Output Z vector from constrained object to target position
offset (o) double3outputinputconnectablestorable
object offset
offsetX (ox) angle (double)0.0degoutputinputconnectablestorablekeyable
object X offset
offsetY (oy) angle (double)0.0degoutputinputconnectablestorablekeyable
object Y offset
offsetZ (oz) angle (double)0.0degoutputinputconnectablestorablekeyable
object Z offset
restRotate (rsrr) double3outputinputconnectablestorable
rest orientation
restRotateX (rrx) angle (double)0.0degoutputinputconnectablestorable
rest X orientation
restRotateY (rry) angle (double)0.0degoutputinputconnectablestorable
rest Y orientation
restRotateZ (rrz) angle (double)0.0degoutputinputconnectablestorable
rest Z orientation
useOldOffsetCalculation (uooc) boolfalseoutputinputconnectablestorable
Turning this on switches the offset calculation from computing an offset rotation matrix, to simply adding the individual offset values to the x, y, and z rotation value computed by the constraint.