Friday, July 13, 2007

Constraints in Blender

Using constraints in Blender can be a bit of a hassle, but here is a method I have found works quite nicely.

The setup: You have got two objects, A and B. You want B to follow A around, but with the following conditions.
  • The connection can be toggled on or off (that is: keyframed)
  • The connection should work like a parent-child-relationship. If A rotates, B should rotate with A as it's centre.
  • You want control over the offset between A and B
First of all, create A and B and center their center points. Place them exactly where you want them to be the moment the connection is created or released.
Select object B, that is, the "child" or "slave" object. Snap the 3d cursor to that object (shift-S).
Create an empty object at that place and give it an appropriate name. You may want to set it's rotation to the same as your object B.

Parent the empty object to object A. Finally, constraint B to the empty object (location, and rotation if needed). Voila!

The connection works like a parent-child-relationship, but where you can keyframe the weight. You can alter the offset by simply translating/rotating the empty object. And, since everything was set up at the "connection-point", there should be no sliding whatsoever when keyframing the weight-value.

With this setup it's also possible to make multiple connection, for instance, if you have an object handed over from one hand to another. Just make the setup twice, and keyframe the weight-values of each locRot-constraint-pair.

Easy and quite powerful.