Contact Information

Email - Duylinh.Nguyen@gmail.com
Google Voice - 415-613-2177

Tuesday, May 17, 2011

Auto IKFK Blend and Solid Knee Script

This is a script I made for my rigging class so they can see how one would go about creating an auto rig script.

//////////////////////////////////////////////////////
//ikFkSetupLeg.mel //
//scripted by: Duylinh Nguyen //
//description: This script auto creates an IK FK //
//blend setup for desired side of leg. //
//How to use: Create leg joints and //
//name them. Type ikFkSetupLeg and the side of the //
//leg you wish to setup. //
//ie. ikFkSetupLeg right //
//naming conventions //
//L_Hip_Jnt > L_Knee_Jnt > L_Ankle_Jnt > L_Ball_Jnt //
//> L_Toe_Jnt //
//////////////////////////////////////////////////////

global proc ikFkSetupLeg (string $sideLegLong)
{
//Records errors in this variable
int $legWarning = 0; //0 = No Errors
//1 = Error Found

//Checks to see which side is selected
//Checks if the argument is correct

string $sideLeg;
if (($sideLegLong != "left") && ($sideLegLong != "right"))
{
$legWarning = 1;
warning "Unknown argument. Please specify either left or right. ie: ikFkSetupLeg right; \n";
}else
{
if ($sideLegLong == "left")
$sideLeg = "L_";
if ($sideLegLong == "right")
$sideLeg = "R_";
}

//Checks to see if objects exist in the scene
if($legWarning == 0)
{
if(!((`objExists ($sideLeg + "Hip_Jnt")`)
&&(`objExists ($sideLeg + "Knee_Jnt")`)
&&(`objExists ($sideLeg + "Ankle_Jnt")`)
&&(`objExists ($sideLeg + "Ball_Jnt")`)
&&(`objExists ($sideLeg + "Toe_Jnt")`)))
{
$legWarning = 1;
warning "Cannot find all required objects to setup leg. Please check names. \n";
}
}

//If there are no errors, continue
if ($legWarning == 1)
{
warning "The script has encountered an error. Check script editor for details. \n";
}else
{
print "Prerequisites have been fullfilled. \n";

//Sets the axis the foot rotates downwards in (-Z by default)
$footAxis = "Z"; //Change this value if the axis needs to be different
$isFootNegative = -1; //Change this to 1 if the foot axis is positive to rotate down.

//Creates foot controller

curve -d 1 -p -0.5 0 0.5 -p 0.5 0 0.5 -p 0.5 0 -0.5 -p -0.5 0 -0.5 -p -0.5 0 0.5 -k 0 -k 1 -k 2 -k 3 -k 4 -n ($sideLeg + "Foot_CON");
//Orient Joints
select -r ($sideLeg+"Hip_Jnt"); //-r = replace
joint -e -oj xyz -ch -zso; //-e = edit, -oj = joint orientation -ch = children

//Duplicates and rename joints
select -r ($sideLeg + "Hip_Jnt");
duplicate -rr; //rr = returns root only
duplicate -rr;

//Renaming FK Joints
rename ($sideLeg + "Hip_Jnt1") ($sideLeg + "FK_Hip_Jnt");
rename ($sideLeg + "FK_Hip_Jnt|" + $sideLeg + "Knee_Jnt") ($sideLeg + "FK_Knee_Jnt");
rename ($sideLeg + "FK_Hip_Jnt|" + $sideLeg + "FK_Knee_Jnt|" + $sideLeg + "Ankle_Jnt") ($sideLeg + "FK_Ankle_Jnt");
rename ($sideLeg + "FK_Hip_Jnt|" + $sideLeg + "FK_Knee_Jnt|" + $sideLeg + "FK_Ankle_Jnt|" + $sideLeg + "Ball_Jnt") ($sideLeg + "FK_Ball_Jnt");
rename ($sideLeg + "FK_Hip_Jnt|" + $sideLeg + "FK_Knee_Jnt|" + $sideLeg + "FK_Ankle_Jnt|" + $sideLeg + "FK_Ball_Jnt|" + $sideLeg + "Toe_Jnt") ($sideLeg + "FK_Toe_Jnt");

//Renaming IK Joints
rename ($sideLeg + "Hip_Jnt2") ($sideLeg + "IK_Hip_Jnt");
rename ($sideLeg + "IK_Hip_Jnt|" + $sideLeg + "Knee_Jnt") ($sideLeg + "IK_Knee_Jnt");
rename ($sideLeg + "IK_Hip_Jnt|" + $sideLeg + "IK_Knee_Jnt|" + $sideLeg + "Ankle_Jnt") ($sideLeg + "IK_Ankle_Jnt");
rename ($sideLeg + "IK_Hip_Jnt|" + $sideLeg + "IK_Knee_Jnt|" + $sideLeg + "IK_Ankle_Jnt|" + $sideLeg + "Ball_Jnt") ($sideLeg + "IK_Ball_Jnt");
rename ($sideLeg + "IK_Hip_Jnt|" + $sideLeg + "IK_Knee_Jnt|" + $sideLeg + "IK_Ankle_Jnt|" + $sideLeg + "IK_Ball_Jnt|" + $sideLeg + "Toe_Jnt") ($sideLeg + "IK_Toe_Jnt");

//Creates FK controllers
circle -c 0 0 0 -nr 0 1 0 -sw 360 -r 1 -d 3 -ut 0 -tol 0.00393701 -s 8 -ch 1 -n ($sideLeg + "FK_Hip_CON");
group -n ($sideLeg + "FK_Hip_CON_NULL");
circle -c 0 0 0 -nr 0 1 0 -sw 360 -r 1 -d 3 -ut 0 -tol 0.00393701 -s 8 -ch 1 -n ($sideLeg + "FK_Knee_CON");
group -n ($sideLeg + "FK_Knee_CON_NULL");
circle -c 0 0 0 -nr 0 1 0 -sw 360 -r 1 -d 3 -ut 0 -tol 0.00393701 -s 8 -ch 1 -n ($sideLeg + "FK_Ankle_CON");
group -n ($sideLeg + "FK_Ankle_CON_NULL");
circle -c 0 0 0 -nr 0 1 0 -sw 360 -r 1 -d 3 -ut 0 -tol 0.00393701 -s 8 -ch 1 -n ($sideLeg + "FK_Ball_CON");
group -n ($sideLeg + "FK_Ball_CON_NULL");

//Snaps controllers into place, breaks their connections, rotates and freezes their transformations
//FK Hip Controller
//creates the point constraint to position the controller null to the desired joint
pointConstraint -offset 0 0 0 -weight 1 ($sideLeg + "FK_Hip_Jnt") ($sideLeg + "FK_Hip_CON_NULL") ;
delete ($sideLeg + "FK_Hip_CON_NULL_pointConstraint1");
setAttr ($sideLeg + "FK_Hip_CON_NULL.rotateZ") 90;
FreezeTransformations;
orientConstraint -offset 0 0 0 -weight 1 ($sideLeg + "FK_Hip_Jnt") ($sideLeg + "FK_Hip_CON_NULL") ;
delete ($sideLeg + "FK_Hip_CON_NULL_orientConstraint1");
orientConstraint -offset 0 0 0 -weight 1 ($sideLeg + "FK_Hip_CON") ($sideLeg + "FK_Hip_Jnt");;

//FK Knee Controller
pointConstraint -offset 0 0 0 -weight 1 ($sideLeg + "FK_Knee_Jnt") ($sideLeg + "FK_Knee_CON_NULL");
delete ($sideLeg + "FK_Knee_CON_NULL_pointConstraint1");
setAttr ($sideLeg + "FK_Knee_CON_NULL.rotateZ") 90;
FreezeTransformations;
orientConstraint -offset 0 0 0 -weight 1 ($sideLeg + "FK_Knee_Jnt") ($sideLeg + "FK_Knee_CON_NULL");
delete ($sideLeg + "FK_Knee_CON_NULL_orientConstraint1");
orientConstraint -offset 0 0 0 -weight 1 ($sideLeg + "FK_Knee_CON") ($sideLeg + "FK_Knee_Jnt");

//FK Ankle Controller
pointConstraint -offset 0 0 0 -weight 1 ($sideLeg + "FK_Ankle_Jnt") ($sideLeg + "FK_Ankle_CON_NULL");
delete ($sideLeg + "FK_Ankle_CON_NULL_pointConstraint1");
setAttr ($sideLeg + "FK_Ankle_CON_NULL.rotateZ") 90;
FreezeTransformations;
orientConstraint -offset 0 0 0 -weight 1 ($sideLeg + "FK_Ankle_Jnt") ($sideLeg + "FK_Ankle_CON_NULL");
delete ($sideLeg + "FK_Ankle_CON_NULL_orientConstraint1");
orientConstraint -offset 0 0 0 -weight 1 ($sideLeg + "FK_Ankle_CON") ($sideLeg + "FK_Ankle_Jnt");

//FK Ball Controller
pointConstraint -offset 0 0 0 -weight 1 ($sideLeg + "FK_Ball_Jnt") ($sideLeg + "FK_Ball_CON_NULL");
delete ($sideLeg + "FK_Ball_CON_NULL_pointConstraint1");
setAttr ($sideLeg + "FK_Ball_CON_NULL.rotateZ") 90;
FreezeTransformations;
orientConstraint -offset 0 0 0 -weight 1 ($sideLeg + "FK_Ball_Jnt") ($sideLeg + "FK_Ball_CON_NULL");
delete ($sideLeg + "FK_Ball_CON_NULL_orientConstraint1");
orientConstraint -offset 0 0 0 -weight 1 ($sideLeg + "FK_Ball_CON") ($sideLeg + "FK_Ball_Jnt");


//Parents the controllers together
parent ($sideLeg + "FK_Ball_CON_NULL") ($sideLeg + "FK_Ankle_CON");
parent ($sideLeg + "FK_Ankle_CON_NULL") ($sideLeg + "FK_Knee_CON");
parent ($sideLeg + "FK_Knee_CON_NULL") ($sideLeg + "FK_Hip_CON");

//Creates orient constraints
orientConstraint -offset 0 0 0 -weight 1 ($sideLeg + "FK_Hip_Jnt") ($sideLeg + "IK_Hip_Jnt") ($sideLeg + "Hip_Jnt");
orientConstraint -offset 0 0 0 -weight 1 ($sideLeg + "FK_Knee_Jnt") ($sideLeg + "IK_Knee_Jnt") ($sideLeg + "Knee_Jnt");
orientConstraint -offset 0 0 0 -weight 1 ($sideLeg + "FK_Ankle_Jnt") ($sideLeg + "IK_Ankle_Jnt") ($sideLeg + "Ankle_Jnt");
orientConstraint -offset 0 0 0 -weight 1 ($sideLeg + "FK_Ball_Jnt") ($sideLeg + "IK_Ball_Jnt") ($sideLeg + "Ball_Jnt");

//Changes interpolation types on orient constraints to limit constraint blend problems
setAttr ($sideLeg + "Hip_Jnt_orientConstraint1.interpType") 2;
setAttr ($sideLeg + "Knee_Jnt_orientConstraint1.interpType") 2;
setAttr ($sideLeg + "Ankle_Jnt_orientConstraint1.interpType") 2;
setAttr ($sideLeg + "Ball_Jnt_orientConstraint1.interpType") 2;


//-ln = long name
//-k = keyable
//-at = attribute type
//-min = minimum
//-max = maximum
//-dv = default value
//Adds the attributes for the Foot Controller
addAttr -ln toeTap -k 1 -at double -min -10 -max 10 -dv 0 ("|" + $sideLeg + "Foot_CON");
addAttr -ln peelHeel -k 1 -at double -min 0 -max 10 -dv 0 ("|" + $sideLeg + "Foot_CON");
addAttr -ln standTip -k 1 -at double -min 0 -max 10 -dv 0 ("|" + $sideLeg + "Foot_CON");
addAttr -ln twistHeel -k 1 -at double -min -10 -max 10 -dv 0 ("|" + $sideLeg + "Foot_CON");
addAttr -ln twistToe -k 1 -at double -min -10 -max 10 -dv 0 ("|" + $sideLeg + "Foot_CON");
addAttr -ln ikFk -k 1 -at double -min 0 -max 10 -dv 0 ("|" + $sideLeg + "Foot_CON");
addAttr -ln kneeTwist -k 1 -at double -dv 0 ("|" + $sideLeg + "Foot_CON");

//Set driven key for IK/FK Switch
//-cd = current driver
setAttr ($sideLeg + "Foot_CON.ikFk") 0;
setAttr ($sideLeg + "Hip_Jnt_orientConstraint1." + $sideLeg + "IK_Hip_JntW1") 1;
setAttr ($sideLeg + "Hip_Jnt_orientConstraint1." + $sideLeg + "FK_Hip_JntW0") 0;
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.ikFk") ($sideLeg + "Hip_Jnt_orientConstraint1." + $sideLeg + "FK_Hip_JntW0");
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.ikFk") ($sideLeg + "Hip_Jnt_orientConstraint1." + $sideLeg + "IK_Hip_JntW1");

setAttr ($sideLeg + "Foot_CON.ikFk") 10;
setAttr ($sideLeg + "Hip_Jnt_orientConstraint1." + $sideLeg + "IK_Hip_JntW1") 0;
setAttr ($sideLeg + "Hip_Jnt_orientConstraint1." + $sideLeg + "FK_Hip_JntW0") 1;
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.ikFk") ($sideLeg + "Hip_Jnt_orientConstraint1." + $sideLeg + "FK_Hip_JntW0");
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.ikFk") ($sideLeg + "Hip_Jnt_orientConstraint1." + $sideLeg + "IK_Hip_JntW1");

setAttr ($sideLeg + "Foot_CON.ikFk") 0;
setAttr ($sideLeg + "Knee_Jnt_orientConstraint1." + $sideLeg + "FK_Knee_JntW0") 0;
setAttr ($sideLeg + "Knee_Jnt_orientConstraint1." + $sideLeg + "IK_Knee_JntW1") 1;
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.ikFk") ($sideLeg + "Knee_Jnt_orientConstraint1." + $sideLeg + "FK_Knee_JntW0");
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.ikFk") ($sideLeg + "Knee_Jnt_orientConstraint1." + $sideLeg + "IK_Knee_JntW1");

setAttr ($sideLeg + "Foot_CON.ikFk") 10;
setAttr ($sideLeg + "Knee_Jnt_orientConstraint1." + $sideLeg + "FK_Knee_JntW0") 1;
setAttr ($sideLeg + "Knee_Jnt_orientConstraint1." + $sideLeg + "IK_Knee_JntW1") 0;
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.ikFk") ($sideLeg + "Knee_Jnt_orientConstraint1." + $sideLeg + "FK_Knee_JntW0");
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.ikFk") ($sideLeg + "Knee_Jnt_orientConstraint1." + $sideLeg + "IK_Knee_JntW1");

setAttr ($sideLeg + "Foot_CON.ikFk") 0;
setAttr ($sideLeg + "Ankle_Jnt_orientConstraint1." + $sideLeg + "FK_Ankle_JntW0") 0;
setAttr ($sideLeg + "Ankle_Jnt_orientConstraint1." + $sideLeg + "IK_Ankle_JntW1") 1;
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.ikFk") ($sideLeg + "Ankle_Jnt_orientConstraint1." + $sideLeg + "FK_Ankle_JntW0");
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.ikFk") ($sideLeg + "Ankle_Jnt_orientConstraint1." + $sideLeg + "IK_Ankle_JntW1");

setAttr ($sideLeg + "Foot_CON.ikFk") 10;
setAttr ($sideLeg + "Ankle_Jnt_orientConstraint1." + $sideLeg + "FK_Ankle_JntW0") 1;
setAttr ($sideLeg + "Ankle_Jnt_orientConstraint1." + $sideLeg + "IK_Ankle_JntW1") 0;
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.ikFk") ($sideLeg + "Ankle_Jnt_orientConstraint1." + $sideLeg + "FK_Ankle_JntW0");
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.ikFk") ($sideLeg + "Ankle_Jnt_orientConstraint1." + $sideLeg + "IK_Ankle_JntW1");

setAttr ($sideLeg + "Foot_CON.ikFk") 0;
setAttr ($sideLeg + "Ball_Jnt_orientConstraint1." + $sideLeg + "FK_Ball_JntW0") 0;
setAttr ($sideLeg + "Ball_Jnt_orientConstraint1." + $sideLeg + "IK_Ball_JntW1") 1;
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.ikFk") ($sideLeg + "Ball_Jnt_orientConstraint1." + $sideLeg + "FK_Ball_JntW0");
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.ikFk") ($sideLeg + "Ball_Jnt_orientConstraint1." + $sideLeg + "IK_Ball_JntW1");

setAttr ($sideLeg + "Foot_CON.ikFk") 10;
setAttr ($sideLeg + "Ball_Jnt_orientConstraint1." + $sideLeg + "FK_Ball_JntW0") 1;
setAttr ($sideLeg + "Ball_Jnt_orientConstraint1." + $sideLeg + "IK_Ball_JntW1") 0;
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.ikFk") ($sideLeg + "Ball_Jnt_orientConstraint1." + $sideLeg + "FK_Ball_JntW0");
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.ikFk") ($sideLeg + "Ball_Jnt_orientConstraint1." + $sideLeg + "IK_Ball_JntW1");

setAttr ($sideLeg + "Foot_CON.ikFk") 0;

//Creates the IK handles for the inverse foot and IK Leg
ikHandle -n ($sideLeg + "BallIk") -sol ikSCsolver -s 0 -sj ($sideLeg + "IK_Ankle_Jnt") -ee ($sideLeg + "IK_Ball_Jnt"); //-sol = solver, -s = sticky
ikHandle -n ($sideLeg + "ToeIk") -sol ikSCsolver -s 0 -sj ($sideLeg + "IK_Ball_Jnt") -ee ($sideLeg + "IK_Toe_Jnt");
ikHandle -n ($sideLeg + "LegIk") -sol ikRPsolver -s 0 -sj ($sideLeg + "IK_Hip_Jnt") -ee($sideLeg + "IK_Ankle_Jnt");

//Group IK Handles for reverse foot
group -n ($sideLeg + "ToeTapGroup") ($sideLeg + "ToeIk") ($sideLeg + "BallIk");
group -n ($sideLeg + "PeelHeelGroup")($sideLeg + "LegIk");
group -n ($sideLeg + "ToePivotGroup") ($sideLeg + "ToeTapGroup") ($sideLeg + "PeelHeelGroup");
group -n ($sideLeg + "HeelPivotGroup");
group -n ($sideLeg + "FootGroup");

//Creates the nodes for the Solid Knee Setup
createRenderNodeCB -asUtility "" multiplyDivide"";

//Renames the utility nodes
rename ("multiplyDivide1") ($sideLeg + "flipKneeRotate");

//Connects the attributes between the foot controller, the utility nodes and the leg's IK
connectAttr ($sideLeg + "Foot_CON.kneeTwist") ($sideLeg + "flipKneeRotate.input1X");
connectAttr ($sideLeg + "flipKneeRotate.outputX") ($sideLeg + "LegIk.twist");

setAttr ($sideLeg + "flipKneeRotate.input2X") -1; //multiplies the output of the kneeFix with -1 to reverse the direction


//Move pivots of foot groups for reverse foot.
float $worldSpaceOfJoint[];

//xform = find or set any element in the transform node. It can also set pivot points.
//-ws = worldspace
//-rp = rotate pivot
//-q = query mode

$worldSpaceOfJoint = `xform -q -ws -rp ($sideLeg + "Ball_Jnt")`;
move -a $worldSpaceOfJoint[0] $worldSpaceOfJoint[1] $worldSpaceOfJoint[2] ($sideLeg + "ToeTapGroup.scalePivot") ($sideLeg + "ToeTapGroup.rotatePivot");

$worldSpaceOfJoint = `xform -q -ws -rp ($sideLeg + "Ball_Jnt")`;
move -a $worldSpaceOfJoint[0] $worldSpaceOfJoint[1] $worldSpaceOfJoint[2] ($sideLeg + "PeelHeelGroup.scalePivot") ($sideLeg + "PeelHeelGroup.rotatePivot");

$worldSpaceOfJoint = `xform -q -ws -rp ($sideLeg + "Toe_Jnt")`;
move -a $worldSpaceOfJoint[0] $worldSpaceOfJoint[1] $worldSpaceOfJoint[2] ($sideLeg + "ToePivotGroup.scalePivot") ($sideLeg + "ToePivotGroup.rotatePivot");

$worldSpaceOfJoint = `xform -q -ws -rp ($sideLeg + "Ankle_Jnt")`;
move -a $worldSpaceOfJoint[0] $worldSpaceOfJoint[1] $worldSpaceOfJoint[2] ($sideLeg + "HeelPivotGroup.scalePivot") ($sideLeg + "HeelPivotGroup.rotatePivot");

$worldSpaceOfJoint = `xform -q -ws -rp ($sideLeg + "Ball_Jnt")`;
move -a $worldSpaceOfJoint[0] $worldSpaceOfJoint[1] $worldSpaceOfJoint[2] ($sideLeg + "FootGroup.scalePivot") ($sideLeg + "FootGroup.rotatePivot");

//Attach Foot Controller
group -n ($sideLeg + "Foot_CONAlign") ($sideLeg + "Foot_CON");
delete `orientConstraint ($sideLeg + "Ball_Jnt") ($sideLeg + "Foot_CONAlign")`;
delete `pointConstraint ($sideLeg + "Ball_Jnt") ($sideLeg + "Foot_CONAlign")`;
parent ($sideLeg + "FootGroup") ($sideLeg + "Foot_CON");
FreezeTransformations;
performFreezeTransformations(0);
setAttr ($sideLeg + "LegIk.poleVectorX") 0;
setAttr ($sideLeg + "LegIk.poleVectorY") 0;
setAttr ($sideLeg + "LegIk.poleVectorZ") 0;

// SET DRIVEN KEY FOR REVERSE FOOT
// TOE TAP
setAttr ($sideLeg + "Foot_CON.toeTap") 0;
setAttr ($sideLeg + "ToeTapGroup.rotate" + $footAxis) 0;
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.toeTap") ($sideLeg + "ToeTapGroup.rotate" + $footAxis);

setAttr ($sideLeg + "Foot_CON.toeTap") 10;
setAttr ($sideLeg + "ToeTapGroup.rotate" + $footAxis) (90*$isFootNegative);
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.toeTap") ($sideLeg + "ToeTapGroup.rotate" + $footAxis);

setAttr ($sideLeg + "Foot_CON.toeTap") -10;
setAttr ($sideLeg + "ToeTapGroup.rotate" + $footAxis) (-90*$isFootNegative);
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.toeTap") ($sideLeg + "ToeTapGroup.rotate" + $footAxis);
setAttr ($sideLeg + "Foot_CON.toeTap") 0;

// PEEL HEEL
setAttr ($sideLeg + "Foot_CON.peelHeel") 0;
setAttr ($sideLeg + "PeelHeelGroup.rotate" + $footAxis) 0;
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.peelHeel") ($sideLeg + "PeelHeelGroup.rotate" + $footAxis);

setAttr ($sideLeg + "Foot_CON.peelHeel") 10;
setAttr ($sideLeg + "PeelHeelGroup.rotate" + $footAxis) (90*$isFootNegative);
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.peelHeel") ($sideLeg + "PeelHeelGroup.rotate" + $footAxis);
setAttr ($sideLeg + "Foot_CON.peelHeel") 0;

// STAND TIP
setAttr ($sideLeg + "Foot_CON.standTip") 0;
setAttr ($sideLeg + "ToePivotGroup.rotate" + $footAxis) 0;
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.standTip") ($sideLeg + "ToePivotGroup.rotate" + $footAxis);

setAttr ($sideLeg + "Foot_CON.standTip") 10;
setAttr ($sideLeg + "ToePivotGroup.rotate" + $footAxis) (90*$isFootNegative);
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.standTip") ($sideLeg + "ToePivotGroup.rotate" + $footAxis);
setAttr ($sideLeg + "Foot_CON.standTip") 0;

// TWIST HEEL
setAttr ($sideLeg + "Foot_CON.twistHeel") 0;
setAttr ($sideLeg + "HeelPivotGroup.rotateY") 0;
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.twistHeel") ($sideLeg + "HeelPivotGroup.rotateY");

setAttr ($sideLeg + "Foot_CON.twistHeel") -10;
setAttr ($sideLeg + "HeelPivotGroup.rotateY") 90;
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.twistHeel") ($sideLeg + "HeelPivotGroup.rotateY");

setAttr ($sideLeg + "Foot_CON.twistHeel") 10;
setAttr ($sideLeg + "HeelPivotGroup.rotateY") -90;
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.twistHeel") ($sideLeg + "HeelPivotGroup.rotateY");
setAttr ($sideLeg + "Foot_CON.twistHeel") 0;

// TWIST TOE
setAttr ($sideLeg + "Foot_CON.twistToe") 0;
setAttr ($sideLeg + "ToePivotGroup.rotateY") 0;
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.twistToe") ($sideLeg + "ToePivotGroup.rotateY");

setAttr ($sideLeg + "Foot_CON.twistToe") -10;
setAttr ($sideLeg + "ToePivotGroup.rotateY") 90;
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.twistToe") ($sideLeg + "ToePivotGroup.rotateY");

setAttr ($sideLeg + "Foot_CON.twistToe") 10;
setAttr ($sideLeg + "ToePivotGroup.rotateY") -90;
setDrivenKeyframe -cd ($sideLeg + "Foot_CON.twistToe") ($sideLeg + "ToePivotGroup.rotateY");
setAttr ($sideLeg + "Foot_CON.twistToe") 0;

//Setup is finished, inform user that the script has made it all the way through.
print ("The " + $sideLegLong + " leg has been setup. \n");
}
}

Orient controller to joint script

//////////////////////////////////////////////////////////////////
//jointOrientController.mel //
//Scripted By: Duylinh Nguyen //
//Description: This script takes a curve, orients it to the //
//desired joint and applies an orient constraint on the //
//joint. //
//How to use- //
//type jointOrient "name of controller" "name of joint"; //
//ie. jointOrient shoulder_CON shouler_Jnt; //
//////////////////////////////////////////////////////////////////

proc jointOrient (string $conName, string $jntName)
{
//Creates a group Null
select -r ($conName);
group -n ($conName + "_NULL");
//Snaps the controller to the desired joint, rotates and freezes it's transforms
pointConstraint -offset 0 0 0 -weight 1 $jntName ($conName + "_NULL") ;
delete ($conName + "_NULL_pointConstraint1");
setAttr ($conName + "_NULL.rotateZ")90;
FreezeTransformations;
//Snaps the orientation of the controller to the joint
orientConstraint -offset 0 0 0 -weight 1 $jntName ($conName + "_NULL");
delete ($conName + "_NULL_orientConstraint1");
//Orient Constrains the joint to the controller
orientConstraint -offset 0 0 0 -weight 1 $conName $jntName;
}

Yet another big update

It seems my posts are getting fewer and further apart. I'll try my best from now on to update this on a for normal basis. I've been in a scripting mood lately, so if you see several scripts, you'll know why haha.

First sculpt pass for my orc


Still have to design clothing for this dude



A Tank I modeled for my students to create LOD's for