Thursday, July 1, 2010

Eye Rig of Doom!

But first, a little Morphy update...

Quick range of motion test on the 80% complete facial rig. Still have some pose polishing to work on but I'm pretty happy with the base controls.

So getting the intial moveable scalable eye rig working wasn't too hard until I wanted to have a master eye IK control .

Master Eye IK control, I shake my fist at you!

Picked this up and left it numerous times after getting frustrated with it. However, this morning, things finally came together. Heirarchy of the transformable, moveable eye rig. The basis for the rig is Scott Englerts fk/ik eye rig. Anywhere there's a "left" item, a "right" item is assumed to be as well. These are my notes so I can make sure everything is connected right on the other side....
  • EyeRig_grp - this is the top group that contain all of the eye rig elements.
    • Parent Constraint -  target - left_eyeorb_skin_jnt
    • Scale Constraint -  target left_eyeorb_skin_jnt
    • eyeRigAttributeHolder - empty transform node with a ton of attributes connected. Holds attributes for Scott's eye rig as well as the eyelid rig
    • eyeIKMeasurements_grp - group containing all of the measurement elements to position the individual eye IK controls when the face is transformed. It is a template that helps us get the initial positions from which all subsequent offsets happen
      • eyeIKMaster_loc - Simulates the position of the eye_masterIK_anim control using the exact same constraint setup.
        • Parent Constraint - two targets - eye_left_rig_grp and eye_right_rig_grp
      • masterLeftIkDeformPos_loc - this is the startpoint for the distance node that measures how far out we need to push the ik_eye_left_anim_grp to be where it needs to be when the face is deformed
        • Parent Constraint - eyeIKMaster_loc
      • eyeIK_leftDeformPos_loc - end point for this sides measurement node
        • Parent Constraint - eyeIK_left_loc
      • masterIKToEyeIK_left_dist - distance node using the start and end point listed above. Get's our distance to later plug into the individual eye's offset when the eye postion and scale are deformed
    • eye_masterIK_Pos_grp - hold's the master IK control and the stuff necessary to move it where it needs to be when the face is deformed
      • Parent Constraint - two targets - eye_left_rig_grp and eye_right_rig_grp
      • eye_masterIK_anim_grp
        • eye_masterIK_anim - The master IK anim control that moves both eye IK anim controls with it
          • eyeIK_left_anim_grp
            • Connection - masterIKToEyeIK_left_dist.distance >>> eyeIK_left_anim_grp.tx
            • eyeIK_left_anim - Individual eye IK control 
              • Aim Constraint target left_eyeorb_skin_jnt
    • eye_left_rig_grp - All the rest of the rig stuff for the individual eye
      • eyeIK_left_loc - positioned where the original eyeFK_left_anim position is
      • eye_left_IK_UpVector_loc - positioned above the eyeball to act as a Y up object for the eye's aim constraint 
      • eyeFK_left_anim_grp 
        • eyeFK_left_anim - Individual eye FK Joystick type control
          • Limits - .tx and .ty only open channels and both clamped to -1 to 1
      • eye_left_orient_grp - holds the meat of Scott's rig
        • eye_left_FKOrient_loc - "Joystick driven" eye rotation
          • Expression - 
eye_left_FKOrient_loc.rotateX = eyeFK_left_anim.translateY * -eyeRigAttributeHolder.eye_left_UpDn;
eye_left_FKOrient_loc.rotateY = eyeFK_left_anim.translateX * eyeRigAttributeHolder.eye_left_LeftRight;
          • eye_left_IKOrient_loc - Aims at the individual eye's IK control
            • Aim Constraint - (.rx and .ry only) Targets eyeIK_left_anim
              • Up object is eye_left_IK_UpVector_loc (who is located above the eyeball to simulate Y up when the head spins around)
          • eye_left_Orient_loc - "End result" locator which the eye is constrained to
            • Orient Constraint - Targets - eye_left_FKOrient_loc & eye_left_IKOrient_loc
              • Weights are expression driven - 
    eye_left_Orient_loc_orientConstraint1.eye_left_FKOrient_locW0 = eye_left_fkikSwitch_anim.translateY;

    eye_left_Orient_loc_orientConstraint1.eye_left_IKOrient_locW1 = 1-eye_left_fkikSwitch_anim.translateY;
          • eye_left_ikPOS_loc - Snapping object for the ik control that's driven by the FK control. Initial position should match the eyeIK_left_anim
            • Parent Constraint - target eye_left_Orient_loc
        • iris_left_anim_grp - Positions the iris/pupil controls to blend between the FK and IK controls
          • Parent Constraint - (maintain position off) - Targets eyeFK_left_anim & eyeIK_left_anim
            • Weights are expression driven to move the iris between the two controls
    iris_left_anim_grp_parentConstraint1.eyeFK_left_animW0 = eye_left_fkikSwitch_anim.translateY;
    iris_left_anim_grp_parentConstraint1.eyeIK_left_animW1 = 1-eye_left_fkikSwitch_anim.translateY;
            • iris_left_anim - .sx only, connected to the iris scale blendshape via expression (.sy and .sz are connected to .sx)
              • pupil_left_anim - .sx only, connected to the pupil scale blendshape via expression (.sy and .sz are connected to .sx)
                • Expression for both -

       if (iris_left_anim.scaleY <=1) {

      eye_left_bsNode.irisShrink_bsGeo = clamp (0,1, 1 -iris_left_anim.scaleY * iris_left_anim.scaleY);
      else {
      eye_left_bsNode.irisShrink_bsGeo = 0;
      if (pupil_left_anim.scaleY <=1) {
      eye_left_bsNode.pupilShrink_bsGeo = clamp (0,1, (1 - pupil_left_anim.scaleY * pupil_left_anim.scaleY));
      else {
      eye_left_bsNode.pupilShrink_bsGeo = 0;
      eye_left_bsNode.irisGrow_bsGeo = clamp (0,1, iris_left_anim.scaleY -1 );
      eye_left_bsNode.pupilGrow_bsGeo = clamp (0,1, pupil_left_anim.scaleY -1);


        mattanimation said...

        hot digitty dog! wonderful stuff, i'm pretty sure people will pay for this one

        Jon said...

        Wow! I like how this is turning out Josh! Is there going to be a body attached to the head? I would definitely pay to use this rig, all your hard word should be rewarded. Good luck on the rest!

        All the stuff on this site is 2000 - by Josh Burton...unless otherwise noted. All rights reserved.