Working with locks

From Valve Developer Community
Revision as of 16:00, 16 October 2012 by DefectiveJoey (talk | contribs)
Jump to: navigation, search

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:

  1. Select your shot.
  2. Position the scene camera so it frames the character's face.
  3. In the Animation Set Editor, drag the control for the character's head onto the scene camera's lock box.
Note.png Note: Even though the two objects are now locked together, if you preview the existing animation, you'll see that nothing has changed yet, because of the locked camera's new counter-animation. However, if you move the character's head around in the viewport, the camera will now track the movement.

To remove the counter-animation of a locked object:

  1. Select the locked object in the Animation Set Editor.
  2. Go into the Motion Editor.
  3. Select the region of time you want affected, or select all of time (Ctrl+A).
  4. Drag the playhead until the locked object is in a state you like.
  5. On the Procedural tab, drag the Default preset all the way up.
  6. Preview your animation. The motion of the child object is now synchronized with the motion of the parent object.
Note.png Note: You can also partially remove the counter-animation by dragging the Default preset only partway, which will blend the locked object's original animation with the animation of its new parent.

See also