Start with the existing leg and foot joint system, with IK created for the leg (ankle), ball of the foot, and toes, all parented under the _**foot_CON**_ curve.
### _**I. Create the Control Joint Hierarchy**_
#### _**Draw the control joints**_
Draw the control joints on top of the existing ankle, ball, and toe joints, then add the heel joint.
The existing bind joint rig with **ankle** > **ball** > **toe** > **toeTip** (you may or may not have _**toeTip**_):
![[001.ReverseFoot_.jpg|Foot Joint Locations and Names]]
*Foot Joint Locations and Names*
**Skeleton > Create Joints** by point snapping (C key) each joint to the existing bind hierarchy: **ankle**, then **ball**, then **toe**. Ignore the toeTip. The new joints may be drawn larger if the default joint radius is larger.
![[002.ReverseFoot_.jpg|Joints to Snap Control Joints]]
*Joints to Snap Control Joints*
Switch to the side view, then place the **Rev_heel** joint where the heel will touch the ground. You do not need to snap. Drawing from the side view places the joint in the same XZ plane as the rest of the hierarchy snapped to the bind joint.
![[003.ReverseFoot_.jpg|Placement of the Reverse Heel Joint]]
*Placement of the Reverse Heel Joint*
#### _**Reroot Skeleton**_
To create the reverse hierarchy after drawing over the bind joints, select the **Rev_heel** joint and go to _**Skeleton > Reroot Skeleton**_.
_**Rev_heel** selected:
![[005.ReverseFoot_.png|Pick the Rev_heel Joint]]
*Pick the Rev_heel Joint*
_**Skeleton > Reroot Skeleton**__:
![[004.ReverseFoot_.png|Skeleton > Reroot Skeleton]]
*Skeleton > Reroot Skeleton*
#### _**Rename Joints**_
**Rename the new joints** in the new reverse foot joint hierarchy **L_Rev_heel**, **L_Rev_toe**, **L_Rev_ball**, and **L_Rev_ankle**:
![[006.ReverseFoot_.jpg|Rename with Prefix]]
*Rename with Prefix*
The outliner will look like this after you rename the _**control joints**_:
![[009.ReverseFoot_.png|L_Rev_heel Outliner]]
*L_Rev_heel Outliner*
#### _**Orient Joints**_
After you re-root, you should also Orient the joints, including the children, so that Z is the rotation axis. **Rigging** > **Skeleton** > **Orient Joints**. This points the **X-axis** running down the joint with **Z** as the animation axis.
#### _**Colorize the Joints**_
Change the drawing color to distinguish the control joints from the bound joints of the rig. In the **Attribute Editor**, _**select each joint in turn**_, then open the triangle under **Display**, then **Drawing Overrides**. Check on **Enable Overrides**, and the change the **Color** by moving the slider (if using Index color). You'll want to avoid white (a selection color), bright green (another selection color), or dull colors.
![[007.ReverseFoot_.png|Attribute Editor > Drawing Overrides > Enable Overrides and Color]]
*Attribute Editor > Drawing Overrides > Enable Overrides and Color*
The _**reverse foot control joint hierarchy**_ stands out from the _**bind joints**_, which we won't touch during animation.
![[008.ReverseFoot_.jpg|Rev_ Joints are a Control Hierarchy]]
*Rev_ Joints are a Control Hierarchy*
#### _**Parent the reverse joint hierarchy under the Control curve**_
Add the **control joint hierarchy** to the **Foot_CON** control curve.
Select the **L_Rev_heel**, then select the **L_foot_CON**, and **press P** to parent the reverse joint hierarchy to the control. You can also use **Edit > Parent**.
![[010.ReverseFoot_.png|Parent Control Joints Under the Foot Control]]
*Parent Control Joints Under the Foot Control*
#### _**Add IK Handles under the reverse joint hierarchy**_
Next, add the **IK_handles** under the new control joints.
_**Toe IK**_
Select the **L_toe_ikHandle** from underneath the **L_foot_CON**, then control and select the **L_Rev_Toe** reverse joint
![[011.ReverseFoot_.png|Select Joint and IKHandle]]
*Select Join and IKHandle*
_**Press P**_ to parent, or use _**Edit > Parent**_.
![[013.ReverseFoot_.png|Parent IKHandle to Control Joint]]
*Parent IKHandle to Control Joint*
_**Ball/Foot IK**_
Select the **L_foot_ikHandle** from underneath the **L_foot_CON**, then control and select the **L_Rev_Ball** reverse joint. _**Press P**_ to parent, or use _**Edit > Parent**_. (This ikHandle may also be called L_ball_ikHandle.)
_**Ankle/Leg IK**_
Select the **L_leg_ikHandle** from underneath the **L_foot_CON**, then control and select the **L_Rev_Ankle** reverse joint. (This ikHandle may also be called L_ankle_ikHandle.)
![[014.ReverseFoot_.png]]
_**Press P**_ to parent, or use _**Edit > Parent**_.
![[015.ReverseFoot_.png]]
#### _**Test the new hierarchy**_
Test the new hierarchy by selecting one of the control joints, like the _**L_Rev_Ball**_, and **rotating it in Z**, which should be the direction of function for the joints of the foot.
![[016.ReverseFoot_.png]]
### _**II. Add Custom Attributes to the Control Curve**_
You'll create **your own attributes** to access the rotation of the reverse joints without having to navigate the hierarchy to select them. When animating, you'll select only control curves to move the rig.
Select the **L_foot_CON**, which will be the foot's main control.
Select **Modify > Add Atrribute** to open the dialogue box.
![[019.ReverseFoot_.png]]
For each attribute, set the _**Long Name**_, the _**Data Type**_ (Float), and the _**Minimum**_, _**Maximum**_, and _**Default**_ values. The Long Name should not have any spaces, and Maya will break it up according to capitalization, inserting a space before each capital letter. "**heelRoll**" becomes "**Heel Roll**" as you can see in the image below in the **"Nice name"** attribute that is greyed out.
The **Heel Roll** tilts the foot backward on the heel, like when the foot is placed during a walk cycle.
Create the **heelRoll** attribute with a minimum of **-10**, maximum of **0** (or **10**), and default of **0**. Click **Add.
![[020.ReverseFoot_.png]]
The **Heel Sweep** pivots the foot on the heel, pointing the toes left or right.
Create the **heelSweep** attribute with a minimum of **-30**, maximum of 3**0**, and default of **0**. Click **Add.
![[021.ReverseFoot_.png]]
The **Ball Roll** bends the foot, lifting the heel. This happens when in contact with the ground.
Create the **ballRoll** attribute with a minimum of **0**, maximum of **10**, and default of **0**. Click **Add.
![[023.ReverseFoot_.png]]
The **Toe Roll** tilts the foot up or down on the tip of the toe.
Create the **toeRoll** attribute with a minimum of **-10**, maximum of **10**, and default of **0**. Click **Add.
![[026.ReverseFoot_.png]]
The **Toe Sweep** pivots the foot on the toes, pointing the heel left and right.
Create the **toeSweep** attribute with a minimum of **-30**, maximum of **30**, and default of **0**. Click **Add.
![[025.ReverseFoot_.png]]
### _**III. Drive Joint Attributes with Custom Control Attributes via Set Driven Key**_
_**A.**_ Open the _**Animation > Key > Set Driven Key > Set...**_ window.
![[027.ReverseFoot_.png]]
**_B._** Select the **L_foot_CON** curve. Hit _**Load Driver**_ in the SDK Window.
_**C.**_ Select the **L_Rev_Heel** joint. Hit _**Load Driven**_ in the SDK Window.
![[029.ReverseFoot_.png]]
#### _**Mantra keeps it easy**_
Here is the _mantra_ I use to ensure I don't miss a keyframe, especially the first one.
_**"Driver**_ > _**Attribute**_ > _**Driven**_ > _**Attribute**_ > _**Key"**_
We use this sequence for **_every_ key** that we set. Since the **driver** attribute generates the **value** for the **driven** attribute, you have to select and **adjust the driver _first_** and set its attribute value, _then_ select the **driven** and change the values of its attribute(s). Be sure to set a **Key**.
#### _**Set the first 0:0 key**_
In the SDK Window:
D. Select the **driver** (**L_foot_CON**) on the top left side.
E. Select the **attribute** that will be used: **Heel Roll** (_**heelRoll**_)
F. Check the Channel Box to set the attribute. Start with **0**.
In the SDK Window:
G. Select the **driven** (**L_Rev_Heel**) on the bottom left side.
H. Select the **attribute** that will be used, in this case, **Rotate X** (since the joint was drawn last and then made the root of the hierarchy).
I. Check the Channel Box value for **Rotate Z,** which should be **0**.
In the SDK Window:
J. Press **Key**. This sets your first keyframe.
#### _**Set the minimum key**_
_In the SDK Window:_
K. Select the **driver** (**L_foot_CON**) on the top left side.
_In the Channel Box:_
L. Set the **Heel Roll** (_**heelRoll**_) attribute to **-10**.
_In the SDK Window:_
M. Select the **driven** (**L_Rev_Heel**) on the bottom left side.
_In the Channel Box:_
N. Set value for **Rotate Z** to **-35**. (or whatever value tilts the foot back on the heel!)
In the SDK Window:
O. Press **Key**.
![[030.ReverseFoot_.jpg]]
#### _**Set the maximum key**_
If you'd like to set a value for **L_foot_CON.heelRoll** at **10**, the value of **L_Rev_Heel.RZ** would be **35**.
#### _**Other Driver:Driven pairs**_
Always follow the _**"Driver**_ > _**Attribute**_ > _**Driven**_ > _**Attribute**_ > _**Key"**_ mantra when loading and keying the attributes.
Since the **L_foot_CON** drives all attributes, you don't have to reload it. You must pick the **L_Rev_Ball**, then the **L_Rev_Toe** to load its driven attributes. Be sure to set the **0:0** first keys, then the minimums, then the maximums.
#### _**.L_Rev_Ball -> RZ
![[034.ReverseFoot_.png]]
#### _**.L_Rev_Toe -> RZ
![[037.ReverseFoot_.png]]
Here is a table of the values of the **driver attributes** versus the **driven attributes**:
| | | | |
|---|---|---|---|
|**L_foot_CON**|_**.heelRoll**_||**L_Rev_Heel_.RotX_**|
||0|->|0|
||-10|->|-35|
||10|->|35|
||_**.ballRoll**_||**L_Rev_Ball_.RotZ_**|
||0|->|0|
||10|->||
||_**.toeRoll**_||**L_Rev_Toe_.RotZ_**|
||0|->||
||-10|->||
||10|->||
### _**IV. Connect Custom Control Attributes to Joint Attributes with the Connection Editor**_
The last two control attributes (**L_foot_CON**_**.heelSweep**_ and _**.toeSweep)**_ can be directly connected to the rotation attributes they drive (**L_Rev_Heel.RotateY** and **L_Rev_Toe.RotateY**).
Select the **L_foot_CON**, then go to **Windows > General Editors > Connection Editor** to open the **Connection Editor:
![[039.ReverseFoot_.png]]
#### _**heelSweep**_
If **L_foot_CON** is not loaded on the left, select it and click **Reload Left** in the **Connection Editor:
![[040.ReverseFoot_.png]]
Select the **L_Rev_Heel** and **Reload Right** in the **Connection Editor.**
The custom attributes you've added are at the bottom of the attribute list on the left. Connected attributes are in italics.
Select the **heelSweep** attribute under the L_foot_CON on the left.
On the right side under L_Rev_Heel, scroll down to **Rotate**, a triple attribute (_XYZ_), and click the **(+)** symbol to open up to the single attributes that compose it: **rotateX**, **rotateY**, and **rotateZ**. The Connection Editor will only let you connect attributes of the same type, so you can connect **L_foot_CON** and **rotateY**, which are both _**floats**_.
With **heelSweep** selected on the left, select **rotateY** on the right.**
![[042.ReverseFoot_.png]]
You can test this connection by selecting the **L_foot_CON** and changing the **heelSweep** attribute by selecting it and dragging the middle mouse button in the perspective viewport. The toeSweep and rotateY should have the same values, but they are limited by the custom attribute's minimum and maximum. Notice in this image that the foot rotates but not the control curve:
![[045.ReverseFoot_.png]]
#### _**toeSweep**_
You can select the **L_Rev_Toe** and **Reload Right** in the **Connection Editor**.
Connect **toeSweep** on the left to **RotateY** on the right to connect the attributes.**!
![[043.ReverseFoot_.png]]
You can test the **toeSweep** connection by selecting the **L_foot_CON** and changing the **toeSweep** attribute in the Channel Box.
![[046.ReverseFoot_.png]]
Now, you have a control curve for the foot that can perform a decent walk cycle and also translate and rotate the entire foot, bending the knee.
#### _**Duplicate Attributes**_
Although you cannot necessarily duplicate the entire **SDK** and **Connection Editor** setup, you can duplicate the **custom attributes** you created on the **L_foot_CON** to the **R_foot_CON** by first **selecting the object you are copying to** (R_foot_CON), then **the object you are copying from** (L_foot_CON), so you can see the attributes. This is backward from the usual Maya selection scheme.
![[047.ReverseFoot_.png|Select Custom Attributes]]
*Select Custom Attributes*
Select the **custom attributes**, then with the CTRL key, right-click and select Duplicate Attribute. There are so many context menu commands that you need CTRL to see the extra commands!
![[049.ReverseFoot_.png|Right Click + Duplicate Attributes to Copy]]
*Right Click + Duplicate Attributes to Copy*
#### _**The other foot**_
You can perform the same SDK and Connections on the right foot, and some rotations may switch negative for positive values. You could duplicate and rename the reverse joint hierarchy, although it is more accurate to snap joints to the existing bind joints, in case the skeleton is not entirely symmetrical!
_**fin**_