Working with locks
Locks in the SFM are similar to parenting in other 3D animation tools, but they work a little differently. You can use locks to put a hat on a character or keep a camera on a character's face. A lock parents any 3D object onto any other 3D object in the scene.
Unlike in traditional 3D parenting, however, adding a lock does not change an object's existing animation; a hand locked to a wheelbarrow will not move with the wheelbarrow if it didn't before. What locking does is parent one object to another but also create counter-animation to maintain the animation relationships as they were. Then, you can remove or work with that counter-animation to make objects that are locked together also move together.
Also unlike in traditional 3D parenting, you can remove a lock after you have used it to adjust your animation, and the animation will be unaffected; the effects of having locked the objects together persist even after you remove the lock itself.
You lock and unlock objects in the Animation Set Editor. To the left of each object and each control for each object in the Animation Set Editor, there's a small lock box. That lock box indicates the object's or control's lock state.
To lock a control to the world:
- In the Animation Set Editor, click the control's lock box. The lock box will change to a padlock icon.
To lock one control to another:
- In the Animation Set Editor, drag the parent control onto the child control's lock box. The lock box will change to a padlock icon.
To lock a camera to a moving character's head:
- Select your shot.
- Position the scene camera so it frames the character's face.
- In the Animation Set Editor, drag the control for the character's head onto the scene camera's lock box.
Counter-animation is the original animation of the locked object. When an object is locked to a parent, the parent's movement samples are displayed in the Motion Editor, however, the locked objects counter-animation prevents it from following the parent. It must be confirmed by sliding the Default, Playhead, or Zero slider (under the Procedural tab) to full to override the counter-animation. Position and rotation of the locked object can be isolated in this manner. For example, the object can be locked to its parent's rotation but not it's position if so desired.
The Default slider applies the lock's position and/or rotation relative to the world. The Playhead slider applies the lock relative to the locked bone itself. Zero locks to the bone without changes (all Team Fortress 2 hats and cosmetics use this).
To remove the counter-animation of a locked object:
- Select the locked object in the Animation Set Editor.
- Go into the Motion Editor.
- Select the region of time you want affected, or select all of time ( + ).
- Drag the playhead until the locked object is in a state you like.
- On the Procedural tab, drag the Default preset all the way up.
- Preview your animation. The motion of the child object is now synchronized with the motion of the parent object.