Wednesday, October 3, 2018

Notes: Constraints and Parenting


Constraints tutorial:

Constraints are used for advanced manipulation of objects when animating characters.
  • good for picking up and putting down objects.
  • good for grabbing multiple objects in a short time without needing to animate the object itself.

Constraints Tutorial:
We  are building a switch we can turn on and off within 2 frames to make objects stick and unstick from other objects. Frame before, turn off current setting. Frame after, turn on opposite setting.
  • Create —> Locator (create two or three of them.)
    • Position in middle of object.
    • Duplicate and make 1 more. Control D
      • Name: hand_locator
      • Name: object_locator
      • can make one extra one for the floor of your world if you plan to have your object get released, or whatever surface the object rests on when not in use. (Name: floor_locator) This locator will have it's translate controls animated so the object can be dropped in the same position. (See: One Step Further)
  • Make the object_locator the leader to everything else.

Constraints vs. parenting:  You can KEY the relationships of constraints in your channel box. Parenting can’t be changed once set without breaking everything.

For this method, we use both: constraints and parenting. (you can use parenting inside constraints)

Cont:
  • select object_loc
  • shift select object mesh.
  • Animation MENU: Constraint —> Parent.
    • parent constraining gives you control of rotation, translation, scale.
    • check translate_All
    • check Rotate_All
    • weight: 1. (this will change whether or not the constraint works.)
    • In channel box, everything is now blue for object. 
    • Now, when I select locator, object moves.
  • Q&A: In parenting VS constraints, what you select is important. You click parents first when establishing constraints.  When you do simple parenting instead, the child is selected first.
    • Why? Constraints —> Parent establishes child relationships in menus.
    • Simple Parenting: Child object is given a parent to follow from your outliner.
  • Make the HAND locator follow hand.
    • go to frame that switch will occur. Select hand_lc, and then shift-select wrist control.
    • Create standard parent by hitting “p”.
    • HAND LOCATOR IS NOW CHILD TO WRIST CONTROL of RIG.
  • Make Hand locator be a leader of object locator. That way I can turn off the relationship when I don’t want it. 
    • Hand_Loc selected. shift-click cup locator to select it too.
    • go to frame where you want switch to occur.
    • Constraints —> Parent. (settings should be same as before, but if not, remake them.)
    • THIS CREATES A NODE IN YOUR SHAPE HISTORY THAT CAN BE KEYFRAMED.
  • Go to Hand_Loc_weight channel in channel box.
    • Key it:  When set to 0, the object is not attached to hand.
    • When set to 1, the object is attached.
  • Procedure for keying. (0 off, 1 on.)
    • go to the frame before contact.
    • Key “0” under weight.
    • go to the frame after:
    • Key “1” instead.
      • Note: If the number fluctuates when playing back, check and make sure these tangents are set to LINEAR to avoid any splines.

NEXT LEVEL (1 step further)
  • constrain the SURFACE_loc (floor, table, etc) to object_loc as well.
    • Note: be aware that you will now have two channels for locators. If both are set to 1, they both affect the object at the same time. 50/50 influence over your grabbable object.
      • Same process for keying the object down. This way, you can lock in an object to a surface to keep it from moving if it needs to be set back down in the same position.
        • Surface locator 0 at first.
        • Set locator to 1 on setting when you want it to sit back on table.
        • EVEN FURTHER: can animate surface locator position so I can affect how the object touches the ground after grabbing. I can make it follow anything i want.
        • Animation workflow:
          • hand_loc = 0
          • hand_loc = 1
          • hand_loc = 0, surface_loc = 1 (if I want to give control of object to anything else, or put the object on the ground.
          • (optional) animate the translation of that surface locator so when you let go of the object, it drops down wherever you want it to go.
          • This way, we don’t have to animate the object locator. We 
          • NOTE:  If you keyframe object to character’s hand, the action is much less_intuitive.  This is why we do it with locators instead. easier for more complex action.


TO SUMMARIZE:
  • click the object, click the child.
  • Constraints -> Parent.
  • Make sure translate, rotate, scale are selected.
  • Weight 1 to start. (can be 0 in the future.)
  • Other Locator should be for the wrist.
  • Simple parent hand locator to wrist.
  • Make hand locator a constraint parent to object.
    • Hierarchy:
      • Wrist control from rig
      • hand locator (simple child of wrist)
        • weight of 1: turn on grab.
        • weight of 0: turn off grab.
      • Object locator (constrained child of hand)

No comments:

Post a Comment