Let's start by creating the IK Foot.
		
  1. STEP 1: create foot and knee anims

    					Now lets to the real stuff.  Lets get on with the actual rigging now that we are finished with the setup.
    					Lets create the foot and knee anims. 
    					For the foot anim create a circle and snap it to the left ankle joint. 
    					Resize it about the same size as the foot.
    					Rename it "left_foot_anim".
    					Now grab all the CV's and place them down around the foot, like the image below.
    					Make sure the pivot of the foot anim is still on the ankle. This becomes important for the animator and usability.
    					Now create a square curve. Import squareCurve.mb from the rigging controls.
    					Snap the curve at the knee and pull it forward in the Z.
    					Rename the anim, left_knee_anim.
    					Select both of the new anims and freeze transforms.
    				
    foot anim placement
  2. STEP 2: Duplicate the Bind Skeleton

    					We aren't going to hook up the the IK rig to the bind skeleton.
    					We are going to duplicate the bind chain and hook the IK handles to the new chain.
    					Then later we are going to hook the new chain with the bind chain. 
    					This will create good separation and make the rig easier to adjust later if needed. 
    					Later we are goint to duplicate it agian for the FK chain also.
    					Then we will make the bind follow either the IK or FK based on an attribute.
    					This will allow us to switch between the two.
    					Select the left_upperLeg_bind_joint. 
    					Press the group rename icon from the rigging shelf.
    					Search for "_bind_", replace with "_ik_", make sure duplicate and rename is selected. Press go.
    					Unparent the new joint chain to the world.
    					Hide the "skeleton_grp".
    					Now only the ik leg should be visible.
    				
  3. STEP 3: Create the foot pivots

    					Part of the leg setup requires multiple foot pivots so we can twist the leg in various positions easily.
    					Create a locator. Create -> locator. 
    					Rename it "left_toe_piv". Snap it to the nearest vertex to the toe on the base of the foot.
    					Duplicate the locator and name it "left_heel_piv". Place it at the heel of the foot.
    					Duplicate the locator and name it "left_outside_piv". Place it on the outside rim of the foot.
    					Duplicate the locator and name it "left_inside_piv". Place it on the inside rim of the foot.
    					Duplicate the locator and name it "left_ball_piv". Place snap it to the ball joint. 
    					Duplicate the locator and name it "left_wiggle_piv".  This is also placed on the ball joint.
    					We are going to hook them up later but now we need to create IK handles.				
    				
    foot piv placement
  4. STEP 4: Create IK handles

    					Create an ik handle from the left_upperLeg_bind_joint to the left_ankle_bind_joint.
    					Make sure this ik handle has a rotation plane solver(so it can have a knee anim).
    					You can make sure this happens by selecting RPSolver in the tool options.
    					Rename the ikHandle, "left_leg_ik".
    					Then create two more Ik handles. This two ik handles should be Single chain solver or SCSolver in the options box.
    					Create one from the ankle to the ball and one more from the ball to the toe.
    					Rename the first "left_foot_ik" and the other "left_toe_ik".
    					Now we can create the heirarchy for the foot.
    				
    rpSolver option
  5. STEP 5: Create the foot Heirarchy.

    					Now if we do some carefully parenting we can create a nice rig.
    					Try to follow these instructions very carefully.
    					
    • Parent the heel_piv under the foot_anim.
    • Parent the toe_piv under the heel_piv.
    • Parent the outside_piv under the toe_piv
    • Parent the inside_piv under the outside_piv
    • Parent the ball_piv, wiggle_piv and foot_ik under the inside_piv
    • Parent the leg_ik under the ball_piv
    • Parent the toe_ik under the wiggle_piv
    Great. Now if you notice if you rotate the toe pivot, The foot rotates around the toe. If you rotate the outside piv it will pivot from there. Cool eh. This is not user friendly, yet, so lets create some attributes a animator could use.
    heirarchy of the foot
  6. STEP 5: Create foot attributes.

    					Lets talk about some attributes and what they do.
    					
    • roll: I want this to animate all 5 stages of the roll with one attribute. See all five stages below. The attr represents the foot angle.A negative value is phase 1, and positive values are 2-5
    • toeLift: The angle at which the toe will start to lift. End of phase 3
    • toeStraight: The angle at which the foot becomes straight again(start of phase 5)
    • lean: Moves the heel toward or away from the body as if the character were leaning
    • side: Pivots the foot on one of the foot sides. inside/outside pivots
    • toeSpin: Spins the foot around the toe
    • toeWiggle: Wiggles the toe up and down.
    Select the foot anim, in the channel box right click -> attributes -> add attribute. For all of the attr names above, create an attribute. Make sure it is a float, the rest of the defaults should be fine. Set toeLift to 35, and toeStraight to 50, for starters. If toeStraight is zero then it goes to stage 5 way to fast, and we can't see a roll.
    heirarchy of the foot
  7. STEP 7: Create the foot expression

    					In the expression editor, Window -> Animation Editors -> Expression Editor. Name the expression, "left_foot_expression".
    					Then type in this code. 
    					I am not going to go into what it means. If you are curious you can ask during office hours.
    				
    					$roll = left_foot_anim.roll;
    					$toeLift = left_foot_anim.toeLift;
    					$toeStraight = left_foot_anim.toeStraight;
    					$lean = left_foot_anim.lean;
    					$side = left_foot_anim.side;
    					$spin = left_foot_anim.toeSpin;
    					$wiggle = left_foot_anim.toeWiggle;
    					
    					left_heel_piv.rotateX = min($roll,0);
    					left_ball_piv.rotateX = (linstep(0, $toeLift,$roll)) * (1-(linstep($toeLift, $toeStraight, $roll))) * $roll;
    					left_toe_piv.rotateX = linstep($toeLift, $toeStraight, $roll) * $roll;
    					left_ball_piv.rotateZ = $lean;
    					left_outside_piv.rotateZ = min($side,0);
    					left_inside_piv.rotateZ = max($side,0);
    					left_toe_piv.rotateY = $spin;
    					left_wiggle_piv.rotateX = $wiggle;
    				
  8. STEP 8: Test

    Make sure everything works. It is always important that you test the rig before it is finished. Make sure everything is working properly and easy to animate. You should be confident in your rig before it goes any further down the pipeline.