Relation constraints are made of multiple boxes (FBBox
), which are connected to one another through operators. You can use relation constraints to create relationships between the objects with greater control than other constraint types. Following boxes are used for creating relation constraints:
For information about how to use relation constraints in the UI, see the Relations Constraints topic in the User's Guide.
Download the create_relationship_constraint.py script from http://area.autodesk.com/downloads/scripts/motionbuilder-animation-scripts. Run the script in MotionBuilder and see how it creates a relation constraint to drive a cube animation.
Following are the points to keep in mind:
lConstraintRelation = FBConstraintRelation('AConstraintRelation')
is used to create a relation constraint.lConstraintRelation.CreateFunctionBox('Sources', 'Sine Ramp')
is used to create a sine ramp
type function box in a relation constraint.lConstraintRelation.SetBoxPosition(lNumberToVectorBox, 400, 30)
sets the box's position in the relation constraint panel.FBConnect (lSineRampOut, lNumberToVectorIn)
connects the two animation nodes to make the first one drive the second one.lConstraintRelation.Active = True
to set the constraint active.