Tuesday, November 26, 2013

Seamless Ik/Fk Switch


The Process of how this Ik/Fk works is that there are six locators setup in the rig that the script will take the information of the locators and apply them to the controls.  

Setup

To set up the Seamless Switch, you must first create a normal Ik/Fk Switch.
The elbow joints in the main skeleton and the contorller joints have all the translation, rotation, and scale locked except for the Y rotate.  So the arm bends like a real arm.


Fk Locators:
 
The Fk locators are set up just like the Fk controls.  There are three locators: one in the hand, one in the elbow, and one in the shoulder.  The hand is parented to the elbow and the elbow is parented to the shoulder.  Then each of the locators are orient constrained to the Ik control joints.  This way the locators have the right orientation when switching from Ik to Fk.

Ik Locators:

The Ik locators are a little more tricky.  There are three locators.  The first one is located in the Fk Hand Controller Joint.  This locator is then Parent constrained to the Fk Hand Controller Joint.  That one will be for the Ik handle control. 
The other two are for the Elbow control.  The first one with be parented in the Fk Control Joints.  What you do is you put the locator on top of the shoulder joint.  You then parent the locator to the Fk Shoulder Control Joint.  If you zero out the rotation of the locator it will then be pointing down the joint chain.  slide the locator down the joint chain and place it on top of the Elbow joint.  Then move it back so that it sits where the Elbow Control will be located.  This locator will now move wherever the Fk Shoulder Control Joint moves and since we locked all the movements of the Elbow joints, the arm will always be level with the locator.  The last locator will not be parented to anything.  You will place this locator on top of the Locator that is parented to the shoulder joint.  You will then zero out the locator and then point constrain it to the Locator its on top of.  This way the second locator will have the translate information you need for the Elbow control when you switch from Fk to Ik.


Script Setup:

I set up the script as a global proc, then set that global proc in a seperate button so the animator can use the Ik/Fk switch normally then when they want to use the seamless setup it will work at any time.

Seamless Switch Global Proc:
This scrip is for just the left arm.  You will have to setup a second one for the right arm.
The scrip also checks if there are any keys on the Ik Hand Control or the Fk Shoulder Control.  If there are keys then it will key the switch so the animator doesnt have to.

global proc L_IkFkArmScripts ()

{
    int $L_IkFkSwitchCheck = `getAttr L_IkFkSwitchCTL.IkFkSwitch`;
    int $i;
    select -r  L_IkFkSwitchCTL.IkFkSwitch;
    $StepCurvsObj = `ls -sl`;
    select -cl  ;
    int $time = `currentTime -q`;
    int $time2 = ($time - 1);
    int $keys1 = `selectKey  L_ShoulderFkCTL` ;
    int $keys2 = `selectKey L_HandIkCTL`;
   


    if ($L_IkFkSwitchCheck == 1) {//Ik
        if ($keys1 > 0 || $keys2 > 0){
            setKeyframe -v 1 -t $time2 {"L_IkFkSwitchCTL"};
            setKeyframe -t $time2 {"L_ShoulderFkCTL"};
            setKeyframe -t $time2 {"L_ArmFkCTL"};
            setKeyframe -t $time2 {"L_HandFkCTL"};
        }
        float $IkHandRot[] = `xform -q -ro L_IkHandParent`;
        setAttr L_HandIkCTL.rotateX $IkHandRot[0];
        setAttr L_HandIkCTL.rotateY $IkHandRot[1];
        setAttr L_HandIkCTL.rotateZ $IkHandRot[2];
        float $IkHandTran[] = `xform -q -t L_IkHandParent`;
        setAttr L_HandIkCTL.translateX $IkHandTran[0];
        setAttr L_HandIkCTL.translateY $IkHandTran[1];
        setAttr L_HandIkCTL.translateZ $IkHandTran[2];
        float $IkElbowTran[] = `xform -q -t L_ElbowTran`;
        setAttr L_ElbowIkCTL.translateX $IkElbowTran[0];
        setAttr L_ElbowIkCTL.translateY $IkElbowTran[1];
        setAttr L_ElbowIkCTL.translateZ $IkElbowTran[2];
        //Switch Ik to Fk
        setAttr L_IkFkSwitchCTL.IkFkSwitch 0;
        if ($keys1 > 0 || $keys2 > 0){
            setKeyframe -v 0 -t $time {"L_IkFkSwitchCTL"};
            setKeyframe -t $time {"L_HandIkCTL"};
            setKeyframe -t $time {"L_ElbowIkCTL"};
        }
    }

    else if ($L_IkFkSwitchCheck == 0) {//Ik
            //Key the frame before
        if ($keys1 > 0 || $keys2 > 0){
            setKeyframe -v 0 -t $time2 {"L_IkFkSwitchCTL"};
            setKeyframe -t $time2 {"L_HandIkCTL"};
            setKeyframe -t $time2 {"L_ElbowIkCTL"};
        }
        // Shoulder
        float $FkShoulder[] = `xform -q -ro L_FkShoudlerRot`;
        setAttr L_ShoulderFkCTL.rotateX $FkShoulder[0];
        setAttr L_ShoulderFkCTL.rotateY $FkShoulder[1];
        setAttr L_ShoulderFkCTL.rotateZ $FkShoulder[2];
        //Arm
        float $FkElbow[] = `xform -q -ro L_FkArmRot`;
        setAttr L_ArmFkCTL.rotateY $FkElbow[1];
        //Hand
        float $FkHand[] = `xform -q -ro L_FkHandRot`;
        setAttr L_HandFkCTL.rotateX $FkHand[0];
        setAttr L_HandFkCTL.rotateY $FkHand[1];
        setAttr L_HandFkCTL.rotateZ $FkHand[2];
        //Switch Ik to Fk
        setAttr L_IkFkSwitchCTL.IkFkSwitch 1;
        if ($keys1 > 0 || $keys2 > 0){
            setKeyframe -v 1 -t $time {"L_IkFkSwitchCTL"};
            setKeyframe -t $time {"L_ShoulderFkCTL"};
            setKeyframe -t $time {"L_ArmFkCTL"};
            setKeyframe -t $time {"L_HandFkCTL"};
        }
    }

}



The Button has the script to create the Ik/Fk Switch window.

global proc L_IkFkSwitchButton ()

{
string $window = `window -title "IkFk Switch" -widthHeight 410 25`;
     rowLayout
          -numberOfColumns 2
          -columnWidth2 120 120
          -columnAlign2 "center" "center";

     button -l "L_IkFkSwitch" -c L_IkFkArmScripts -w 200;
     button -l "R_IkFkSwitch" -c R_IkFkArmScripts -w 200;
showWindow $window;
}


Each of the buttons calls the scripts above to seamlessly switch between Ik and Fk.

The rig still works normally without this script.  This system is there just in case the animator want to seamlessly switch in the middle of the animation. 

Monday, July 1, 2013

Destrozar Portfolio Rig

Portfolio 2 Destrozar Rig

This is the rig I created for the main enemy Destrozar in our game Grapple

Model by Karen McCarthy





The Rig was designed so that the animators would have to end the animations on a multiple of frame 60 so that the cogs and pistons would start and end in the same place.

Expressions used in the rig

Cogs that rotate in the opposite direction of the legs
R_F_Cog1BCTL.rotateY = -R_F_Leg.rotateY * 10;
R_B_Cog1BCTL.rotateY = -R_B_Leg.rotateY * 10;
L_F_Cog1BCTL.rotateY = -L_F_Leg.rotateY * 10;
L_B_Cog1BCTL.rotateY = -R_B_Leg.rotateY * 10;
R_F_Cog2BCTL.rotateY = -R_F_Leg1.rotateY * 10;
R_B_Cog2BCTL.rotateY = -R_B_Leg1.rotateY * 10;
L_F_Cog2BCTL.rotateY = -L_F_Leg1.rotateY * 10;
L_B_Cog2BCTL.rotateY = -L_B_Leg1.rotateY * 10;
R_F_Cog3BCTL.rotateY = -R_F_Leg2.rotateY * 10;
L_F_Cog3BCTL.rotateY = -L_F_Leg2.rotateY * 10;
R_F_Cog4BCTL.rotateY = -R_F_Leg3.rotateY * 10;
L_F_Cog4BCTL.rotateY = -L_F_Leg3.rotateY * 10;
R_F_Cog3CTL.rotateY = R_F_Leg2.rotateY * 10;
R_B_Cog3BCTL.rotateY = -R_B_Leg2.rotateY * 10;
L_B_Cog3BCTL.rotateY = -L_B_Leg2.rotateY * 10;
L_F_Cog3CTL.rotateY = L_F_Leg2.rotateY * 10;
R_F_Cog4CTL.rotateY = R_F_Leg3.rotateY * 10;
L_F_Cog4CTL.rotateY = L_F_Leg3.rotateY * 10;

Cogs that rotate depending on time
R_F_Cog1CTL.rotateY = time * 180;
R_B_Cog1CTL.rotateY = time * 180;
L_F_Cog1CTL.rotateY = time * 180;
L_B_Cog1CTL.rotateY = time * 180;
R_F_Cog2CTL.rotateY = -time * 180;
R_B_Cog2CTL.rotateY = -time * 180;
L_F_Cog2CTL.rotateY = -time * 180;
L_B_Cog2CTL.rotateY = -time * 180;
BodyCog1.rotateZ = -time * 180;
BodyCog2.rotateZ = time * 180;
BodyCog3.rotateZ = time * 180;
BackCog1.rotateZ = -time * 180;
BackCog2.rotateZ = time * 180;
BackCog3.rotateZ = -time * 180;
BackCog5.rotateZ = -time * 180;

Pistons movements
R_F_PistonCTL.Move = (sin((3.14 * time)-1.)/2)+.5;
R_B_PistonCTL.Move = (sin((3.14 * time)-1.571)/2)+.5;
L_F_PistonCTL.Move = (sin((3.14 * time)-.571)/2)+.5;
L_B_PistonCTL.Move = (sin((3.14 * time)-1.571)/2)+.5;
BodyPiston1CTL.Move = (sin((3.14 * time)-.571)/2)+.5;
BodyPiston2CTL.Move = (sin((3.14 * time)-1.)/2)+.5;
BodyPiston3CTL.Move = (sin((3.14 * time)-1.571)/2)+.5;

BackPiston1CTL.Move = (sin((3.14 * time)-.571)/2)+.5;
BackPiston2CTL.Move = (sin((3.14 * time)-1.)/2)+.5;
BackPiston3CTL.Move = (sin((3.14 * time)-1.571)/2)+.5;

Monday, April 29, 2013

End of the semester Demo Reel.  Fall 2013





1.  Standard Enemy Charge Animation
2. Amina's Facial Animation Rig
Amina Model By Nisa Martinez
3. Standard Enemy Rig
Standard Enemy Model by James Diab

Friday, March 22, 2013

Motion Capture Session for Grapple's Standard Enemy


I am the lead Motion Capture Technician in Fiea's Cohort 9.  I have ran, directed, and now acted in multiple Mocap sessions.  These are some for the pictures and a video from our Mocap shoot where I finally got to be the actor

These are the pictures of me after I am markered up


 




























Here is a video of the Idle animation in the Mocap session and the data brought into Maya.





















Sunday, March 10, 2013

Last Dragon Rider

Last Dragon Rider was one of the games pitched in our program that got cut.  Here is the model i made for the presentation. 

I modeled, rigged and animated the dragon.  He flew around in the back of the presentation while the producers presented.





Textures by Karen McCarthy

Auto Rig Scrip with Ik Fk switch

This script was made for any Motion Capture data used on our different characters.

For the script to work it needs to have the controls in a separate Maya file where it can be imported to the scene.

The script attaches all the controls to the joints, bakes all the movements onto the controls, then reattaches all the controls to the joints for the animators to clean up the data. It also builds arm control joints that allow the rig to switch between Ik and Fk.

The script also makes it that when you switch between Ik and Fk the unused setting goes invisible.












 if (!objExists("BodyCTL"))
    {

    currentTime 0 ;
  
    select -r Hips ;
    SelectHierarchy;
  
    string $allJoints_array[];
    $allJoints_array = `ls -sl`;
  

  
    for($object in $allJoints_array)
    {
        setAttr ($object + ".rotateX") 0;
        setAttr ($object + ".rotateY") 0;
        setAttr ($object + ".rotateZ") 0;
    }
    setAttr "Hips.translateX" 0;
    setAttr "Hips.translateY" 0;
    setAttr "Hips.translateZ" 59.701;



//Constrain controles to Joints

file -import -type "mayaBinary" -ra true -mergeNamespacesOnClash false -namespace "medEnemie_Controles" -options "v=0;" -loadReferenceDepth "all" "C:/Users/rcampbell/Documents/Semester 2/animation/Enemies/MiddleEnemie/Skeleton/medEnemie_Controles.mb";

namespace -mv "medEnemie_Controles" ":" -force;

select -r Hips Spine Spine1 Head LeftShoulder LeftArm LeftForeArm RightShoulder RightArm RightForeArm LeftFoot RightFoot;

string $FKJoints_rot[];
$FKJoints_rot = `ls -sl`;

select -r BodyCTL SpineCTL Spine1CTL HeadCTL LShoulderCTL LArmFKCTL LForeArmFKCTL RShoulderCTL RArmFKCTL RForeArmFKCTL LFootCTL  RFootCTL;

string $FKCont_rot[];
$FKCont_rot = `ls -sl`;

for($i=0; size($FKJoints_rot)>$i; $i++){
    orientConstraint -weight 1 -mo $FKJoints_rot[$i] $FKCont_rot[$i] ;
}

select -r Hips LeftFoot RightFoot LeftBlade RightBlade LeftLeg RightLeg;

string $Joints_tran[];
$Joints_tran = `ls -sl`;

select -r BodyCTL LFootCTL RFootCTL LIkArmCTL RIkArmCTL LKneeCTL RKneeCTL;

string $Cont_tran[];
$Cont_tran = `ls -sl`;

for($i=0; size($Joints_tran)>$i; $i++){
    pointConstraint -weight 1 -mo $Joints_tran[$i] $Cont_tran[$i] ;
}

//Bake keys onto controles

select -r Hips ;
SelectHierarchy;
  
string $allJoints_array[];
$allJoints_array = `ls -sl`;

int $time_range_start = `findKeyframe -which first Hips`;
int $time_range_end = `findKeyframe -which last Hips`;
$time_range = $time_range_start+":"+$time_range_end;

bakeResults -simulation true -t $time_range -sampleBy 1 -disableImplicitControl true -preserveOutsideKeys true -sparseAnimCurveBake false -removeBakedAttributeFromLayer false -bakeOnOverrideLayer false -minimizeRotation true -controlPoints false -shape true {"BodyCTL", "SpineCTL", "Spine1CTL", "HeadCTL", "JawCTL", "LShoulderCTL", "LArmFKCTL", "LForeArmFKCTL", "LBladeFKCTL", "LIkArmCTL", "LBladeIKCTL", "LElbowCTL", "RShoulderCTL", "RArmFKCTL", "RForeArmFKCTL", "RBladeFKCTL", "RIkArmCTL", "RBladeIKCTL", "RElbowCTL", "LFootCTL", "LKneeCTL", "RFootCTL", "RKneeCTL" };

for($object in $allJoints_array)
{
    selectKey -add -k ($object + "_translateX") ;
    cutKey -animation keys -clear;
    selectKey -add -k ($object + "_translateY") ;
    cutKey -animation keys -clear;
    selectKey -add -k ($object + "_translateZ") ;
    cutKey -animation keys -clear;
    selectKey -add -k ($object + "_rotateX") ;
    cutKey -animation keys -clear;
    selectKey -add -k ($object + "_rotateY") ;
    cutKey -animation keys -clear;
    selectKey -add -k ($object + "_rotateZ") ;
   cutKey -animation keys -clear;
    selectKey -add -k ($object + "_scaleX") ;
    cutKey -animation keys -clear;
    selectKey -add -k ($object + "_scaleY") ;
    cutKey -animation keys -clear;
    selectKey -add -k ($object + "_scaleZ") ;
    cutKey -animation keys -clear;
    selectKey -add -k ($object + "_visibility") ;
    cutKey -animation keys -clear;
}

//Delete Controles

select -r BodyCTL_orientConstraint1 BodyCTL_pointConstraint1 LFootCTL_orientConstraint1 LFootCTL_pointConstraint1 RFootCTL_orientConstraint1 RFootCTL_pointConstraint1 SpineCTL_orientConstraint1 LKneeCTL_pointConstraint1 RKneeCTL_pointConstraint1 Spine1CTL_orientConstraint1 HeadCTL_orientConstraint1 LShoulderCTL_orientConstraint1 RShoulderCTL_orientConstraint1 LArmFKCTL_orientConstraint1 LIkArmCTL_pointConstraint1 RArmFKCTL_orientConstraint1 RIkArmCTL_pointConstraint1 LForeArmFKCTL_orientConstraint1 RForeArmFKCTL_orientConstraint1  ;
delete;

//Create Controle Joints

float $Opos[] = `xform -q -ws -translation LeftArm`;
float $POpos[] = `xform -q -ws -translation LeftForeArm`;
float $Ppos[] = `xform -q -ws -translation LeftBlade`;
joint -p $Opos[0] $Opos[1] $Opos[2] -name "LeftIkArmControle";
joint -p $POpos[0] $POpos[1] $POpos[2]-name "LeftIkForeArmControle";
joint -e -zso -oj xyz -sao yup LeftIkArmControle;
joint -p $Ppos[0] $Ppos[1] $Ppos[2] -name "LeftIkHandControle";
joint -e -zso -oj xyz -sao yup LeftIkForeArmControle;
select -cl  ;
joint -p $Opos[0] $Opos[1] $Opos[2] -name "LeftFkArmControle";
joint -p $POpos[0] $POpos[1] $POpos[2] -name "LeftFkForeArmControle";
joint -e -zso -oj xyz -sao yup LeftFkArmControle;
joint -p $Ppos[0] $Ppos[1] $Ppos[2] -name "LeftFkHandControle";
joint -e -zso -oj xyz -sao yup LeftFkForeArmControle;
select -cl  ;
float $Opos[] = `xform -q -ws -translation RightArm`;
float $POpos[] = `xform -q -ws -translation RightForeArm`;
float $Ppos[] = `xform -q -ws -translation RightBlade`;
joint -p $Opos[0] $Opos[1] $Opos[2] -name "RightIkArmControle";
joint -p $POpos[0] $POpos[1] $POpos[2] -name "RightIkForeArmControle" ;
joint -e -zso -oj xyz -sao yup RightIkArmControle;
joint -p $Ppos[0] $Ppos[1] $Ppos[2]  -name "RightIkHandControle";
joint -e -zso -oj xyz -sao yup RightIkForeArmControle;
select -cl  ;
joint -p$Opos[0] $Opos[1] $Opos[2]  -name "RightFkArmControle";
joint -p $POpos[0] $POpos[1] $POpos[2] -name "RightFkForeArmControle" ;
joint -e -zso -oj xyz -sao yup RightFkArmControle;
joint -p $Ppos[0] $Ppos[1] $Ppos[2] -name "RightFkHandControle";
joint -e -zso -oj xyz -sao yup RightFkForeArmControle;
select -cl  ;


//Create Ik Arm

select -r LeftIkArmControle.rotatePivot ;
select -add LeftIkHandControle.rotatePivot ;
ikHandle -solver ikRPsolver;
rename "ikHandle1" "LeftIkArmHandle";

parent LeftIkArmHandle LIkArmCTL ;

select -r RightIkArmControle.rotatePivot ;
select -add RightIkHandControle.rotatePivot ;
ikHandle -solver ikRPsolver;
rename "ikHandle1" "RightIkArmHandle";

parent RightIkArmHandle RIkArmCTL ;

//Parent Controle Joints to Shoulder

parent LeftIkArmControle LeftShoulder ;
parent LeftFkArmControle LeftShoulder ;
parent RightIkArmControle RightShoulder ;
parent RightFkArmControle RightShoulder ;

select -r LElbowCTL;
select -add LeftIkArmHandle ;
poleVectorConstraint -weight 1;

select -r RElbowCTL;
select -add RightIkArmHandle ;
poleVectorConstraint -weight 1;

//Arm

select -r LeftIkArmControle ;
select -add LeftArm ;
orientConstraint -mo -weight 1;

select -r LeftFkArmControle ;
select -add LeftArm ;
orientConstraint -mo -weight 1;

select -r RightIkArmControle ;
select -add RightArm ;
orientConstraint -mo -weight 1;

select -r RightFkArmControle ;
select -add RightArm ;
orientConstraint -mo -weight 1;

//ForeArm

select -r LeftIkForeArmControle ;
select -add LeftForeArm ;
orientConstraint -mo -weight 1;

select -r LeftFkForeArmControle ;
select -add LeftForeArm ;
orientConstraint -mo -weight 1;

select -r RightIkForeArmControle ;
select -add RightForeArm ;
orientConstraint -mo -weight 1;

select -r RightFkForeArmControle ;
select -add RightForeArm ;
orientConstraint -mo -weight 1;

//Hand

select -r LeftIkHandControle ;
select -add LeftBlade ;
orientConstraint -mo -weight 1;

select -r LeftFkHandControle ;
select -add LeftBlade ;
orientConstraint -mo -weight 1;

select -r RightIkHandControle ;
select -add RightBlade ;
orientConstraint -mo -weight 1;

select -r RightFkHandControle ;
select -add RightBlade ;
orientConstraint -mo -weight 1;

pointConstraint -weight 1 -mo BodyCTL  Hips;

//Orient constrain joint

select -r Hips Spine Spine1 Head Jaw LeftShoulder LeftFkArmControle LeftFkForeArmControle LeftFkHandControle RightShoulder RightFkArmControle RightFkForeArmControle RightFkHandControle LeftFoot  RightFoot;

string $FKJoints_rot2[];
$FKJoints_rot2 = `ls -sl`;

select -r BodyCTL SpineCTL Spine1CTL HeadCTL JawCTL LShoulderCTL LArmFKCTL LForeArmFKCTL LBladeFKCTL RShoulderCTL RArmFKCTL RForeArmFKCTL RBladeFKCTL LFootCTL  RFootCTL;

string $FKCont_rot2[];
$FKCont_rot2 = `ls -sl`;

for($i=0; size($FKJoints_rot2)>$i; $i++){
    orientConstraint -weight 1 -mo $FKCont_rot2[$i] $FKJoints_rot2[$i] ;
}

orientConstraint -weight 1 -mo LBladeIKCTL  LeftIkHandControle;

//Attach nodes

shadingNode -asUtility reverse;
connectAttr -f LIkFkSwitch.L_Ik2Fk LeftArm_orientConstraint1.LeftFkArmControleW1;
connectAttr -f LIkFkSwitch.L_Ik2Fk reverse1.inputX;
connectAttr -f reverse1.outputX LeftArm_orientConstraint1.LeftIkArmControleW0;

connectAttr -f LIkFkSwitch.L_Ik2Fk LeftForeArm_orientConstraint1.LeftFkForeArmControleW1;
connectAttr -f reverse1.outputX LeftForeArm_orientConstraint1.LeftIkForeArmControleW0;

connectAttr -f LIkFkSwitch.L_Ik2Fk LeftBlade_orientConstraint1.LeftFkHandControleW1;
connectAttr -f reverse1.outputX LeftBlade_orientConstraint1.LeftIkHandControleW0;

connectAttr -f RIkFkSwitch.R_Ik2Fk RightArm_orientConstraint1.RightFkArmControleW1;
connectAttr -f RIkFkSwitch.R_Ik2Fk reverse1.inputY;
connectAttr -f reverse1.outputY RightArm_orientConstraint1.RightIkArmControleW0;

connectAttr -f RIkFkSwitch.R_Ik2Fk RightForeArm_orientConstraint1.RightFkForeArmControleW1;
connectAttr -f reverse1.outputY RightForeArm_orientConstraint1.RightIkForeArmControleW0;

connectAttr -f RIkFkSwitch.R_Ik2Fk RightBlade_orientConstraint1.RightFkHandControleW1;
connectAttr -f reverse1.outputY RightBlade_orientConstraint1.RightIkHandControleW0;

//Visibility

connectAttr -f LIkFkSwitch.L_Ik2Fk LeftFkArmControle.visibility;
connectAttr -f LIkFkSwitch.L_Ik2Fk LeftFkForeArmControle.visibility;
connectAttr -f LIkFkSwitch.L_Ik2Fk LeftFkHandControle.visibility;

connectAttr -f LIkFkSwitch.L_Ik2Fk LArmFKCTL.visibility;
connectAttr -f LIkFkSwitch.L_Ik2Fk LForeArmFKCTL.visibility;
connectAttr -f LIkFkSwitch.L_Ik2Fk LBladeFKCTL.visibility;

connectAttr -f RIkFkSwitch.R_Ik2Fk RightFkArmControle.visibility;
connectAttr -f RIkFkSwitch.R_Ik2Fk RightFkForeArmControle.visibility;
connectAttr -f RIkFkSwitch.R_Ik2Fk RightFkHandControle.visibility;

connectAttr -f RIkFkSwitch.R_Ik2Fk RArmFKCTL.visibility;
connectAttr -f RIkFkSwitch.R_Ik2Fk RForeArmFKCTL.visibility;
connectAttr -f RIkFkSwitch.R_Ik2Fk RBladeFKCTL.visibility;

connectAttr -f reverse1.outputX LeftIkArmControle.visibility;
connectAttr -f reverse1.outputX LeftIkForeArmControle.visibility;
connectAttr -f reverse1.outputX LeftIkHandControle.visibility;

connectAttr -f reverse1.outputX LElbowCTL.visibility;
connectAttr -f reverse1.outputX LIkArmCTL.visibility;
connectAttr -f reverse1.outputX LBladeIKCTL.visibility;

connectAttr -f reverse1.outputY RightIkArmControle.visibility;
connectAttr -f reverse1.outputY RightIkForeArmControle.visibility;
connectAttr -f reverse1.outputY RightIkHandControle.visibility;

connectAttr -f reverse1.outputY RElbowCTL.visibility;
connectAttr -f reverse1.outputY RIkArmCTL.visibility;
connectAttr -f reverse1.outputY RBladeIKCTL.visibility;

//Create Ik Legs

select -r LeftUpLeg.rotatePivot ;
select -add LeftFoot.rotatePivot ;
ikHandle -solver ikRPsolver;
rename "ikHandle1" "LeftIkLegHandle";

select -r RightUpLeg.rotatePivot ;
select -add RightFoot.rotatePivot ;
ikHandle -solver ikRPsolver;
rename "ikHandle1" "RightIkLegHandle";

parent LeftIkLegHandle LLegCTL;

parent RightIkLegHandle RLegCTL;

select -r LKneeCTL;
select -add LeftIkLegHandle ;
poleVectorConstraint -weight 1;

select -r RKneeCTL;
select -add RightIkLegHandle ;
poleVectorConstraint -weight 1;

//Create Ik Toes

//First Toes

select -r LeftFirstToe ;
select -tgl LeftFirstToeEnd ;
ikHandle -solver ikRPsolver;
rename "ikHandle1" "LeftIkFirstToeHandle";

select -r RightFirstToe ;
select -tgl RightFirstToeEnd ;
ikHandle -solver ikRPsolver;
rename "ikHandle1" "RightIkFirstToeHandle";

parent LeftIkFirstToeHandle LFirstToeCTL;

parent RightIkFirstToeHandle RFirstToeCTL;

//Middle Toes

select -r LeftMiddleToe ;
select -tgl LeftMiddleToeEnd ;
ikHandle -solver ikRPsolver;
rename "ikHandle1" "LeftIkMiddleToeHandle";

select -r RightMiddleToe ;
select -tgl RightMiddleToeEnd ;
ikHandle -solver ikRPsolver;
rename "ikHandle1" "RightIkMiddleToeHandle";

parent LeftIkMiddleToeHandle LMiddleToeCTL;

parent RightIkMiddleToeHandle RMiddleToeCTL;

//Third Toe

select -r LeftThirdToe ;
select -tgl LeftThirdToeEnd ;
ikHandle -solver ikRPsolver;
rename "ikHandle1" "LeftIkThirdToeHandle";

select -r RightThirdToe ;
select -tgl RightThirdToeEnd ;
ikHandle -solver ikRPsolver;
rename "ikHandle1" "RightIkThirdToeHandle";

parent LeftIkThirdToeHandle LThirdToeCTL;

parent RightIkThirdToeHandle RThirdToeCTL;

//Heel Ik

select -r LeftHeel ;
select -tgl LeftHeelEnd ;
ikHandle -solver ikSCsolver;
rename "ikHandle1" "LeftIkHeelHandle";

select -r RightHeel ;
select -tgl RightHeelEnd ;
ikHandle -solver ikSCsolver;
rename "ikHandle1" "RightIkHeelHandle";

parent LeftIkHeelHandle LHeelCTL;

parent RightIkHeelHandle RHeelCTL;
}

else{
    error "BodyCTL exists!  Cannot zero it out.";
}