Skip to content

Instantly share code, notes, and snippets.

@JustinPedersen
Created July 28, 2017 08:40
Show Gist options
  • Save JustinPedersen/7bf0387e269f4bca29380fb20d2a8242 to your computer and use it in GitHub Desktop.
Save JustinPedersen/7bf0387e269f4bca29380fb20d2a8242 to your computer and use it in GitHub Desktop.
string $Ver = "v2";
string $WinName = ("AutoReverseLockFoot_" + $Ver);
if (`window -exists ("AutoReverseLockFoot_" + $Ver)`)
deleteUI ("AutoReverseLockFoot_" + $Ver);
window -title ("AutoReverseLockFoot." + $Ver) -s false -rtf true ("AutoReverseLockFoot_" + $Ver);
frameLayout -w 190-h 100 ("Sheep's Auto Reverse Lock Foot " + $Ver);
rowColumnLayout -nc 1 -cw 1 200;
// UI STARTS HERE
button -label "CREATE LOCS" -c CreateRL_Foot_LOCS;;
separator -height 4 -style "out";
button -label "CREATE FOOT" -c CreateFoot;
separator -height 4 -style "out";
rowColumnLayout -numberOfRows 1;
button -l "Mirror" -w 95 -c MirrorRL;
button -l "Delete Setup" -w 95 -c Delete_Left_Setup; ;
separator -height 4 -style "out";
setParent..;
setParent..;
setParent..;
showWindow $WinName;
/*============================================================================*/
// Sheep's RL foot creator
// V2
// 06/06/2017
// 8:20 AM
proc CreateFoot(){
if (`objExists L_Ball_Loc`){
CreateFootCTRLS;
CreateJoints;
SetupFoot;
}else{
warning "MUST CREATE LOCS FIRST";
}
}
/*==============================================*/
proc CreateFootCTRLS(){
string $LR = "L_";
string $BotCTRL = `curve -d 1 -p -4.51497 0 -4.776227 -p -5.18234 0 -5.447219 -p -3.442003 0 -9.302861 -p -2.732182 0 -8.598435 -p -4.51497 0 -4.776227 -p -2.732182 0 -8.598435 -p 0 0 -9.5 -p 0 0 -10.5 -p -3.442003 0 -9.302861 -p -2.732182 0 -8.598435 -p 0 0 -9.5 -p 2.732008 0 -8.598435 -p 3.441785 0 -9.302861 -p 0 0 -10.5 -p 0 0 -9.5 -p 2.732008 0 -8.598435 -p 4.514646 0 -4.776227 -p 5.181974 0 -5.447219 -p 3.441785 0 -9.302861 -k 0 -k 1 -k 2 -k 3 -k 4 -k 5 -k 6 -k 7 -k 8 -k 9 -k 10 -k 11 -k 12 -k 13 -k 14 -k 15 -k 16 -k 17 -k 18`;
rename $BotCTRL ($LR + "Foot_CTRL");
string $TopCTRL = `curve -d 1 -p -5.281207 0 5.305076 -p -6.061785 0 5.976067 -p -5.078024 0 11.08862 -p -4.450692 0 10.384195 -p -5.281207 0 5.305076 -p -4.450692 0 10.384195 -p -0.000366211 0 12.410333 -p -0.000366211 0 13.410333 -p -5.078024 0 11.08862 -p -4.450692 0 10.384195 -p -0.000366211 0 12.410333 -p 4.450119 0 10.384195 -p 5.077523 0 11.08862 -p -0.000366211 0 13.410333 -p -0.000366211 0 12.410333 -p 4.450119 0 10.384195 -p 5.280791 0 5.305076 -p 6.061419 0 5.976067 -p 5.077523 0 11.08862 -k 0 -k 1 -k 2 -k 3 -k 4 -k 5 -k 6 -k 7 -k 8 -k 9 -k 10 -k 11 -k 12 -k 13 -k 14 -k 15 -k 16 -k 17 -k 18 `;
rename $TopCTRL ($LR + "top_Foot_CTRL");
select -r ($LR + "top_Foot_CTRLShape");
select -add ($LR + "Foot_CTRL");
parent -r -s;
select -r ($LR + "top_Foot_CTRL");
doDelete;
select -cl ;
// Moving the CTRL to Roughly the right place
float $AnkleLocPos[] = `xform -ws -q -t ($LR + "Ankle_Loc")`;
float $HeelLocPos[] = `xform -ws -q -t ($LR + "Heel_Loc")`;
float $BallLocPos[] = `xform -ws -q -t ($LR + "Ball_Loc")`;
float $ToeLocPos[] = `xform -ws -q -t ($LR + "Toe_Loc")`;
float $InnerLocPos[] = `xform -ws -q -t ($LR + "Inner_Loc")`;
float $OuterLocPos[] = `xform -ws -q -t ($LR + "Outer_Loc")`;
float $CTRLposX = ($HeelLocPos[0] + $ToeLocPos[0] + $InnerLocPos[0] + $OuterLocPos[0])/4;
float $CTRLposY = ($HeelLocPos[1] + $ToeLocPos[1] + $InnerLocPos[1] + $OuterLocPos[1])/4;
float $CTRLposZ = ($HeelLocPos[2] + $ToeLocPos[2] + $InnerLocPos[2] + $OuterLocPos[2])/4;
xform -t $CTRLposX $CTRLposY $CTRLposZ ($LR + "Foot_CTRL");
// adding Foot CTRLS
/*======================MANUALLY SWAP L AND R HERE =============================*/
select -r ($LR + "Foot_CTRL");
addAttr -ln "foot_ctrls" -nn "Foot CTRLS" -at double -dv 0 ;
setAttr -e-channelBox true |L_Foot_CTRL.foot_ctrls;
addAttr -ln "Foot_Roll" -at double -min -10 -max 10 -dv 0;
setAttr -e-keyable true |L_Foot_CTRL.Foot_Roll;
addAttr -ln "bank" -at double -min -10 -max 10 -dv 0;
setAttr -e-keyable true |L_Foot_CTRL.bank;
addAttr -ln "heel_piv" -at double -min -90 -max 90 -dv 0;
setAttr -e-keyable true |L_Foot_CTRL.heel_piv;
addAttr -ln "heel_raise" -at double -min -90 -max 90 -dv 0;
setAttr -e-keyable true |L_Foot_CTRL.heel_raise;
addAttr -ln "ball_roll" -at double -min 0 -max 10 -dv 0;
setAttr -e-keyable true |L_Foot_CTRL.ball_roll;
addAttr -ln "toe_piv" -at double -min -90 -max 90 -dv 0;
setAttr -e-keyable true |L_Foot_CTRL.toe_piv;
addAttr -ln "toe_raise" -at double -min -90 -max 90 -dv 0;
setAttr -e-keyable true |L_Foot_CTRL.toe_raise;
addAttr -ln "toe_flop" -at double -min -90 -max 90 -dv 0;
setAttr -e-keyable true |L_Foot_CTRL.toe_flop;
addAttr -ln "inner_piv" -at double -min -90 -max 90 -dv 0;
setAttr -e-keyable true |L_Foot_CTRL.inner_piv;
addAttr -ln "outer_piv" -at double -min -90 -max 90 -dv 0;
setAttr -e-keyable true |L_Foot_CTRL.outer_piv;
addAttr -ln "custom_piv_vis" -at bool;
setAttr -e-keyable true |L_Foot_CTRL.custom_piv_vis;
}
proc CreateFootPivotCTRLS(){
string $LR = "L_";
curve -d 1 -p 0 0 -1 -p -0.707107 0 -0.707107 -p -1 0 0 -p -0.707107 0 0.707107 -p 0 0 1 -p 0.707107 0 0.707107 -p 1 0 0 -p 0.707107 0 -0.707107 -p 0 0 -1 -p 0 0 0 -p -5.20986e-008 0 -1.87407 -p 0 0 0 -p 1.87407 0 -2.60493e-008 -p 0 0 0 -p 0 5.20986e-008 1.87407 -p 0 0 0 -p -1.87407 0 -2.60493e-008 -p 0 0 0 -p 0 1 0 -p 0 0 0 -p 0 -1 0 -k 0 -k 1 -k 2 -k 3 -k 4 -k 5 -k 6 -k 7 -k 8 -k 9 -k 10 -k 11 -k 12 -k 13 -k 14 -k 15 -k 16 -k 17 -k 18 -k 19 -k 20 -n ($LR + "Foot_Custom_Pivot_CTRL");
rename "curveShape1" ($LR + "Foot_Custom_Pivot_CTRLshape");
}
proc CreateRL_Foot_LOCS(){
string $LR = "L_";
spaceLocator -p 0 0 0 -n ($LR + "Ankle_Loc");
spaceLocator -p 0 0 0 -n ($LR + "Heel_Loc");
spaceLocator -p 0 0 0 -n ($LR + "Ball_Loc");
spaceLocator -p 0 0 0 -n ($LR + "Toe_Loc");
spaceLocator -p 0 0 0 -n ($LR + "Inner_Loc");
spaceLocator -p 0 0 0 -n ($LR + "Outer_Loc");
xform -t 10 5 -5 ($LR + "Ankle_Loc");
xform -t 10 0 -8 ($LR + "Heel_Loc");
xform -t 10 0 5 ($LR + "Ball_Loc");
xform -t 10 0 11 ($LR + "Toe_Loc");
xform -t 5 0 5 ($LR + "Inner_Loc");
xform -t 15 0 5 ($LR + "Outer_Loc");
select -cl ;
}
proc CreateJoints(){
string $LR = "L_";
// Finding where The LOCS are
float $AnkleLocPos[] = `xform -ws -q -t ($LR + "Ankle_Loc")`;
float $HeelLocPos[] = `xform -ws -q -t ($LR + "Heel_Loc")`;
float $BallLocPos[] = `xform -ws -q -t ($LR + "Ball_Loc")`;
float $ToeLocPos[] = `xform -ws -q -t ($LR + "Toe_Loc")`;
float $InnerLocPos[] = `xform -ws -q -t ($LR + "Inner_Loc")`;
float $OuterLocPos[] = `xform -ws -q -t ($LR + "Outer_Loc")`;
/*=================================================*/
/* Creating the RL Joints on the LOc's World space */
/*=================================================*/
joint -p $HeelLocPos[0] $HeelLocPos[1] $HeelLocPos[2] -n ($LR + "RL_Heel_JNT");
joint -p $ToeLocPos[0] $ToeLocPos[1] $ToeLocPos[2] -n ($LR + "RL_Toe_JNT");
joint -e -zso -oj xyz -sao yup ($LR + "RL_Heel_JNT");
joint -p $BallLocPos[0] $BallLocPos[1] $BallLocPos[2] -n ($LR + "RL_Ball_JNT");
joint -e -zso -oj xyz -sao yup ($LR + "RL_Toe_JNT");
joint -p $AnkleLocPos[0] $AnkleLocPos[1] $AnkleLocPos[2] -n ($LR + "RL_Ankle_JNT");
joint -e -zso -oj xyz -sao yup ($LR + "RL_Toe_JNT");
// Orr the Joints
select ($LR + "RL_Heel_JNT");
select -hi;
joint -e -oj xyz -secondaryAxisOrient xdown -ch -zso;
select -cl;
/*====================================================*/
/* Creating the Bount Joints on the LOc's World space */
/*====================================================*/
joint -p $AnkleLocPos[0] $AnkleLocPos[1] $AnkleLocPos[2] -n ($LR + "bn_Ankle_JNT");
joint -p $BallLocPos[0] $BallLocPos[1] $BallLocPos[2] -n ($LR + "bn_Ball_JNT");
joint -e -zso -oj xyz -sao yup ($LR + "bn_Ankle_JNT");
joint -p $ToeLocPos[0] $ToeLocPos[1] $ToeLocPos[2] -n ($LR + "be_Toe_JNT");
joint -e -zso -oj xyz -sao yup ($LR + "bn_Ball_JNT");
select ($LR + "bn_Ankle_JNT");
select -hi;
joint -e -oj xyz -secondaryAxisOrient xdown -ch -zso;
select -cl;
select ($LR + "bn_Ball_JNT");
duplicate -po;
select -r ($LR + "bn_Ball_JNT" + "1") ;
rename ($LR + "be_OrrBall_JNT");
parent ($LR + "bn_Ball_JNT")($LR + "be_OrrBall_JNT");
select ($LR + "bn_Ball_JNT");
Group 0 1 1;
rename group1 ($LR + "Bound_Orr_Absorb_GRP");
select -cl;
}
proc SetupFoot(){
string $LR = "L_";
string $RL_MD1 = ($LR + "ReverseFootBallMD");
float $AnkleLocPos[] = `xform -ws -q -t ($LR + "Ankle_Loc")`;
float $HeelLocPos[] = `xform -ws -q -t ($LR + "Heel_Loc")`;
float $BallLocPos[] = `xform -ws -q -t ($LR + "Ball_Loc")`;
float $ToeLocPos[] = `xform -ws -q -t ($LR + "Toe_Loc")`;
float $InnerLocPos[] = `xform -ws -q -t ($LR + "Inner_Loc")`;
float $OuterLocPos[] = `xform -ws -q -t ($LR + "Outer_Loc")`;
parentConstraint -mo -weight 1 ($LR + "RL_Ankle_JNT") ($LR + "bn_Ankle_JNT");
parentConstraint -mo -weight 1 ($LR + "RL_Ball_JNT") ($LR + "be_OrrBall_JNT");
shadingNode -asUtility multiplyDivide -n $RL_MD1;
setAttr ($RL_MD1 + ".input2X") -1;
connectAttr -f ($RL_MD1 + ".outputX") ($LR + "Bound_Orr_Absorb_GRP" + ".rotateY");
connectAttr -f ($LR + "RL_Ball_JNT" + ".rotateY") ($RL_MD1 + ".input1X");
// creating Group Heirarchy
group -em -n ($LR + "Heel_Piv_GRP");
group -n ($LR + "Inner_Piv_GRP");
group -n ($LR + "Outer_Piv_GRP");
group -n ($LR + "Toe_Piv_GRP");
group -n ($LR + "Ball_Piv_GRP");
group -n ($LR + "Const_GRP");
xform -ws -t $AnkleLocPos[0] $AnkleLocPos[1] $AnkleLocPos[2] ($LR + "Const_GRP");
xform -ws -t $BallLocPos[0] $BallLocPos[1] $BallLocPos[2] ($LR + "Ball_Piv_GRP");
xform -ws -t $ToeLocPos[0] $ToeLocPos[1] $ToeLocPos[2] ($LR + "Toe_Piv_GRP");
xform -ws -t $OuterLocPos[0] $OuterLocPos[1] $OuterLocPos[2] ($LR + "Outer_Piv_GRP");
xform -ws -t $InnerLocPos[0] $InnerLocPos[1] $InnerLocPos[2] ($LR + "Inner_Piv_GRP");
xform -ws -t $HeelLocPos[0] $HeelLocPos[1] $HeelLocPos[2] ($LR + "Heel_Piv_GRP");
// Creating Custom Piv CTLS and moving into place.
curve -d 1 -p 0 0 -1 -p -0.707107 0 -0.707107 -p -1 0 0 -p -0.707107 0 0.707107 -p 0 0 1 -p 0.707107 0 0.707107 -p 1 0 0 -p 0.707107 0 -0.707107 -p 0 0 -1 -p 0 0 0 -p -5.20986e-008 0 -1.87407 -p 0 0 0 -p 1.87407 0 -2.60493e-008 -p 0 0 0 -p 0 5.20986e-008 1.87407 -p 0 0 0 -p -1.87407 0 -2.60493e-008 -p 0 0 0 -p 0 1 0 -p 0 0 0 -p 0 -1 0 -k 0 -k 1 -k 2 -k 3 -k 4 -k 5 -k 6 -k 7 -k 8 -k 9 -k 10 -k 11 -k 12 -k 13 -k 14 -k 15 -k 16 -k 17 -k 18 -k 19 -k 20 -n ($LR + "Foot_CustPiv_Heel_CTRL");
rename "curveShape1" ($LR + "Foot_CustPiv_Heel_CTRLshape");
curve -d 1 -p 0 0 -1 -p -0.707107 0 -0.707107 -p -1 0 0 -p -0.707107 0 0.707107 -p 0 0 1 -p 0.707107 0 0.707107 -p 1 0 0 -p 0.707107 0 -0.707107 -p 0 0 -1 -p 0 0 0 -p -5.20986e-008 0 -1.87407 -p 0 0 0 -p 1.87407 0 -2.60493e-008 -p 0 0 0 -p 0 5.20986e-008 1.87407 -p 0 0 0 -p -1.87407 0 -2.60493e-008 -p 0 0 0 -p 0 1 0 -p 0 0 0 -p 0 -1 0 -k 0 -k 1 -k 2 -k 3 -k 4 -k 5 -k 6 -k 7 -k 8 -k 9 -k 10 -k 11 -k 12 -k 13 -k 14 -k 15 -k 16 -k 17 -k 18 -k 19 -k 20 -n ($LR + "Foot_CustPiv_Ball_CTRL");
rename "curveShape1" ($LR + "Foot_CustPiv_Ball_CTRLshape");
curve -d 1 -p 0 0 -1 -p -0.707107 0 -0.707107 -p -1 0 0 -p -0.707107 0 0.707107 -p 0 0 1 -p 0.707107 0 0.707107 -p 1 0 0 -p 0.707107 0 -0.707107 -p 0 0 -1 -p 0 0 0 -p -5.20986e-008 0 -1.87407 -p 0 0 0 -p 1.87407 0 -2.60493e-008 -p 0 0 0 -p 0 5.20986e-008 1.87407 -p 0 0 0 -p -1.87407 0 -2.60493e-008 -p 0 0 0 -p 0 1 0 -p 0 0 0 -p 0 -1 0 -k 0 -k 1 -k 2 -k 3 -k 4 -k 5 -k 6 -k 7 -k 8 -k 9 -k 10 -k 11 -k 12 -k 13 -k 14 -k 15 -k 16 -k 17 -k 18 -k 19 -k 20 -n ($LR + "Foot_CustPiv_Toe_CTRL");
rename "curveShape1" ($LR + "Foot_CustPiv_Toe_CTRLshape");
curve -d 1 -p 0 0 -1 -p -0.707107 0 -0.707107 -p -1 0 0 -p -0.707107 0 0.707107 -p 0 0 1 -p 0.707107 0 0.707107 -p 1 0 0 -p 0.707107 0 -0.707107 -p 0 0 -1 -p 0 0 0 -p -5.20986e-008 0 -1.87407 -p 0 0 0 -p 1.87407 0 -2.60493e-008 -p 0 0 0 -p 0 5.20986e-008 1.87407 -p 0 0 0 -p -1.87407 0 -2.60493e-008 -p 0 0 0 -p 0 1 0 -p 0 0 0 -p 0 -1 0 -k 0 -k 1 -k 2 -k 3 -k 4 -k 5 -k 6 -k 7 -k 8 -k 9 -k 10 -k 11 -k 12 -k 13 -k 14 -k 15 -k 16 -k 17 -k 18 -k 19 -k 20 -n ($LR + "Foot_CustPiv_Inner_CTRL");
rename "curveShape1" ($LR + "Foot_CustPiv_Inner_CTRLshape");
curve -d 1 -p 0 0 -1 -p -0.707107 0 -0.707107 -p -1 0 0 -p -0.707107 0 0.707107 -p 0 0 1 -p 0.707107 0 0.707107 -p 1 0 0 -p 0.707107 0 -0.707107 -p 0 0 -1 -p 0 0 0 -p -5.20986e-008 0 -1.87407 -p 0 0 0 -p 1.87407 0 -2.60493e-008 -p 0 0 0 -p 0 5.20986e-008 1.87407 -p 0 0 0 -p -1.87407 0 -2.60493e-008 -p 0 0 0 -p 0 1 0 -p 0 0 0 -p 0 -1 0 -k 0 -k 1 -k 2 -k 3 -k 4 -k 5 -k 6 -k 7 -k 8 -k 9 -k 10 -k 11 -k 12 -k 13 -k 14 -k 15 -k 16 -k 17 -k 18 -k 19 -k 20 -n ($LR + "Foot_CustPiv_Outer_CTRL");
rename "curveShape1" ($LR + "Foot_CustPiv_Outer_CTRLshape");
xform -ws -t $HeelLocPos[0] $HeelLocPos[1] $HeelLocPos[2] ($LR + "Foot_CustPiv_Heel_CTRL");
xform -ws -t $BallLocPos[0] $BallLocPos[1] $BallLocPos[2] ($LR + "Foot_CustPiv_Ball_CTRL");
xform -ws -t $ToeLocPos[0] $ToeLocPos[1] $ToeLocPos[2] ($LR + "Foot_CustPiv_Toe_CTRL");
xform -ws -t $InnerLocPos[0] $InnerLocPos[1] $InnerLocPos[2] ($LR + "Foot_CustPiv_Inner_CTRL");
xform -ws -t $OuterLocPos[0] $OuterLocPos[1] $OuterLocPos[2] ($LR + "Foot_CustPiv_Outer_CTRL");
select -r ($LR + "Foot_CustPiv_Heel_CTRL") ($LR + "Foot_CustPiv_Ball_CTRL") ($LR + "Foot_CustPiv_Toe_CTRL")($LR + "Foot_CustPiv_Inner_CTRL")($LR + "Foot_CustPiv_Outer_CTRL");
makeIdentity -apply true -t 1 -r 1 -s 1 -n 0 -pn 1;
// Connecting Rotate Pivots of LOCs to corresponding GRPS
connectAttr -f ($LR + "Foot_CustPiv_Heel_CTRL" + ".translate") ($LR + "Heel_Piv_GRP" + ".rotatePivot");
connectAttr -f ($LR + "Foot_CustPiv_Ball_CTRL" + ".translate") ($LR + "Ball_Piv_GRP" + ".rotatePivot");
connectAttr -f ($LR + "Foot_CustPiv_Toe_CTRL" + ".translate") ($LR + "Toe_Piv_GRP" + ".rotatePivot");
connectAttr -f ($LR + "Foot_CustPiv_Inner_CTRL" + ".translate") ($LR + "Inner_Piv_GRP" + ".rotatePivot");
connectAttr -f ($LR + "Foot_CustPiv_Outer_CTRL" + ".translate") ($LR + "Outer_Piv_GRP" + ".rotatePivot");
// moving RL foot into GRP
parent ($LR + "RL_Heel_JNT") ($LR+ "Heel_Piv_GRP");
// Setting up CTRL Connections to GRPS
connectAttr -f ($LR + "Foot_CTRL.heel_piv")($LR + "Heel_Piv_GRP" + ".rotateY");
connectAttr -f ($LR + "Foot_CTRL.heel_raise")($LR + "Heel_Piv_GRP" + ".rotateX");
connectAttr -f ($LR + "Foot_CTRL.toe_piv")($LR + "Toe_Piv_GRP" + ".rotateY");
connectAttr -f ($LR + "Foot_CTRL.toe_raise")($LR + "Toe_Piv_GRP" + ".rotateX");
connectAttr -f ($LR + "Foot_CTRL.toe_flop") ($LR + "bn_Ball_JNT" + ".rotateY");
connectAttr -f ($LR + "Foot_CTRL.inner_piv") ($LR + "Inner_Piv_GRP" + ".rotateY");
connectAttr -f ($LR + "Foot_CTRL.outer_piv") ($LR + "Outer_Piv_GRP" + ".rotateY");
// SDKS
setDrivenKeyframe -currentDriver ($LR + "Foot_CTRL.bank") ($LR + "Outer_Piv_GRP" + ".rotateZ");
setDrivenKeyframe -currentDriver ($LR + "Foot_CTRL.bank") ($LR + "Inner_Piv_GRP" + ".rotateZ");
setAttr ($LR + "Foot_CTRL" + ".bank") 10;
setAttr ($LR + "Outer_Piv_GRP" + ".rotateZ") -90;
setDrivenKeyframe -currentDriver ($LR + "Foot_CTRL" + ".bank") ($LR + "Outer_Piv_GRP" + ".rotateZ");
setDrivenKeyframe -currentDriver ($LR + "Foot_CTRL" + ".bank") ($LR + "Inner_Piv_GRP" + ".rotateZ");
setAttr ($LR + "Foot_CTRL" + ".bank") -10;
setAttr ($LR + "Outer_Piv_GRP" + ".rotateZ") 0;
setAttr ($LR + "Inner_Piv_GRP" + ".rotateZ") 90;
setDrivenKeyframe -currentDriver ($LR + "Foot_CTRL" + ".bank") ($LR + "Outer_Piv_GRP" + ".rotateZ");
setDrivenKeyframe -currentDriver ($LR + "Foot_CTRL" + ".bank") ($LR + "Inner_Piv_GRP" + ".rotateZ");
setAttr ($LR + "Foot_CTRL.bank") 0;
setAttr ($LR + "Foot_CTRL" + ".ball_roll") 0;
setDrivenKeyframe -currentDriver ($LR + "Foot_CTRL" + ".ball_roll") ($LR + "RL_Ball_JNT" + ".rotateY");
setAttr ($LR + "Foot_CTRL" + ".ball_roll") 10;
setAttr ($LR + "RL_Ball_JNT" + ".rotateY") -60;
setDrivenKeyframe -currentDriver ($LR + "Foot_CTRL" + ".ball_roll") ($LR + "RL_Ball_JNT" + ".rotateY");
setAttr "L_Foot_CTRL.ball_roll" 0;
connectAttr -f ($LR + "Foot_CTRL.custom_piv_vis") ($LR + "Foot_CustPiv_Heel_CTRL" + ".visibility");
connectAttr -f ($LR + "Foot_CTRL.custom_piv_vis") ($LR + "Foot_CustPiv_Toe_CTRL" + ".visibility");
connectAttr -f ($LR + "Foot_CTRL.custom_piv_vis") ($LR + "Foot_CustPiv_Ball_CTRL" + ".visibility");
connectAttr -f ($LR + "Foot_CTRL.custom_piv_vis") ($LR + "Foot_CustPiv_Inner_CTRL" + ".visibility");
connectAttr -f ($LR + "Foot_CTRL.custom_piv_vis") ($LR + "Foot_CustPiv_Outer_CTRL" + ".visibility");
// Foot Roll SDK
setDrivenKeyframe -currentDriver L_Foot_CTRL.Foot_Roll L_RL_Ball_JNT.rotateY;
setDrivenKeyframe -currentDriver L_Foot_CTRL.Foot_Roll L_RL_Toe_JNT.rotateY;
setDrivenKeyframe -currentDriver L_Foot_CTRL.Foot_Roll L_RL_Heel_JNT.rotateY;
setAttr "L_Foot_CTRL.Foot_Roll" 5;
setAttr "L_RL_Ball_JNT.rotateY" -30;
setDrivenKeyframe -currentDriver L_Foot_CTRL.Foot_Roll L_RL_Ball_JNT.rotateY;
setDrivenKeyframe -currentDriver L_Foot_CTRL.Foot_Roll L_RL_Toe_JNT.rotateY;
setDrivenKeyframe -currentDriver L_Foot_CTRL.Foot_Roll L_RL_Heel_JNT.rotateY;
setAttr "L_Foot_CTRL.Foot_Roll" 10;
setAttr "L_RL_Toe_JNT.rotateY" -60;
setAttr "L_RL_Ball_JNT.rotateY" 0;
setDrivenKeyframe -currentDriver L_Foot_CTRL.Foot_Roll L_RL_Ball_JNT.rotateY;
setDrivenKeyframe -currentDriver L_Foot_CTRL.Foot_Roll L_RL_Toe_JNT.rotateY;
setDrivenKeyframe -currentDriver L_Foot_CTRL.Foot_Roll L_RL_Heel_JNT.rotateY;
setAttr "L_Foot_CTRL.Foot_Roll" -10;
setAttr "L_RL_Heel_JNT.rotateY" 60;
setDrivenKeyframe -currentDriver L_Foot_CTRL.Foot_Roll L_RL_Ball_JNT.rotateY;
setDrivenKeyframe -currentDriver L_Foot_CTRL.Foot_Roll L_RL_Toe_JNT.rotateY;
setDrivenKeyframe -currentDriver L_Foot_CTRL.Foot_Roll L_RL_Heel_JNT.rotateY;
setAttr "L_Foot_CTRL.Foot_Roll" 0;
// parenting the Bones to CTRL
select -r ($LR + "Foot_CTRL");
makeIdentity -apply true -t 1 -r 1 -s 1 -n 0 -pn 1;
xform -rp $AnkleLocPos[0] $AnkleLocPos[1] $AnkleLocPos[2] ($LR + "Foot_CTRL");
parentConstraint -mo -weight 1 ($LR + "Foot_CTRL")($LR + "Const_GRP");
// parenting Custom Rotate Piv CTRLS to Foot CTRL
select -cl;
select -r ($LR + "Foot_CustPiv_Heel_CTRL") ($LR + "Foot_CustPiv_Ball_CTRL") ($LR + "Foot_CustPiv_Toe_CTRL")($LR + "Foot_CustPiv_Inner_CTRL")($LR + "Foot_CustPiv_Outer_CTRL") ($LR + "Foot_CTRL");
parent;
select -cl;
/*
// Clean up of LOCS
select -r ($LR + "Ankle_Loc") ($LR + "Heel_Loc") ($LR + "Ball_Loc") ($LR + "Toe_Loc") ($LR + "Inner_Loc") ($LR + "Outer_Loc") ;
doDelete;
*/
// Grouping LOCS for later USE
select -r ($LR + "Ankle_Loc") ($LR + "Heel_Loc") ($LR + "Ball_Loc") ($LR + "Toe_Loc") ($LR + "Inner_Loc") ($LR + "Outer_Loc") ;
group -n ($LR + "LOCS_GRP");
setAttr ($LR + "LOCS_GRP" + ".template") 1;
setAttr ($LR + "LOCS_GRP" + ".visibility") 0;
// Creating Foot GRP
select -r ($LR + "bn_Ankle_JNT") ($LR + "Const_GRP") ($LR + "Foot_CTRL");
group -n ($LR + "Foot_GRP");
}
proc Delete_Left_Setup(){
string $LR = "L_";
string $R = "R_";
if (`objExists ($LR + "Foot_GRP")`){
select -r ($LR + "Foot_GRP");
delete;
}if (`objExists ($R + "Foot_GRP")`){
select -r ($R + "Foot_GRP");
delete;
}
else{
warning "NO SETUP TO DELETE";
}
}
proc MirrorRL(){
string $LR= "L_";
// Mirroring LOCS and floating new world space
group -em -n "Locs_Mirror_GRP";
string $LeftLoc[] = `select -r ($LR + "Ankle_Loc") ($LR + "Heel_Loc") ($LR + "Ball_Loc") ($LR + "Toe_Loc") ($LR + "Inner_Loc") ($LR + "Outer_Loc") `;
select -add Locs_Mirror_GRP;
parent;
setAttr "Locs_Mirror_GRP.scaleX" -1;
float $AnkleLocPos[] = `xform -ws -q -t ($LR + "Ankle_Loc")`;
float $HeelLocPos[] = `xform -ws -q -t ($LR + "Heel_Loc")`;
float $BallLocPos[] = `xform -ws -q -t ($LR + "Ball_Loc")`;
float $ToeLocPos[] = `xform -ws -q -t ($LR + "Toe_Loc")`;
float $InnerLocPos[] = `xform -ws -q -t ($LR + "Inner_Loc")`;
float $OuterLocPos[] = `xform -ws -q -t ($LR + "Outer_Loc")`;
// creating Right Foot CTRL
string $R = "R_";
string $R_BotCTRL = `curve -d 1 -p -4.51497 0 -4.776227 -p -5.18234 0 -5.447219 -p -3.442003 0 -9.302861 -p -2.732182 0 -8.598435 -p -4.51497 0 -4.776227 -p -2.732182 0 -8.598435 -p 0 0 -9.5 -p 0 0 -10.5 -p -3.442003 0 -9.302861 -p -2.732182 0 -8.598435 -p 0 0 -9.5 -p 2.732008 0 -8.598435 -p 3.441785 0 -9.302861 -p 0 0 -10.5 -p 0 0 -9.5 -p 2.732008 0 -8.598435 -p 4.514646 0 -4.776227 -p 5.181974 0 -5.447219 -p 3.441785 0 -9.302861 -k 0 -k 1 -k 2 -k 3 -k 4 -k 5 -k 6 -k 7 -k 8 -k 9 -k 10 -k 11 -k 12 -k 13 -k 14 -k 15 -k 16 -k 17 -k 18`;
rename $R_BotCTRL ($R + "Foot_CTRL");
string $R_TopCTRL = `curve -d 1 -p -5.281207 0 5.305076 -p -6.061785 0 5.976067 -p -5.078024 0 11.08862 -p -4.450692 0 10.384195 -p -5.281207 0 5.305076 -p -4.450692 0 10.384195 -p -0.000366211 0 12.410333 -p -0.000366211 0 13.410333 -p -5.078024 0 11.08862 -p -4.450692 0 10.384195 -p -0.000366211 0 12.410333 -p 4.450119 0 10.384195 -p 5.077523 0 11.08862 -p -0.000366211 0 13.410333 -p -0.000366211 0 12.410333 -p 4.450119 0 10.384195 -p 5.280791 0 5.305076 -p 6.061419 0 5.976067 -p 5.077523 0 11.08862 -k 0 -k 1 -k 2 -k 3 -k 4 -k 5 -k 6 -k 7 -k 8 -k 9 -k 10 -k 11 -k 12 -k 13 -k 14 -k 15 -k 16 -k 17 -k 18 `;
rename $R_TopCTRL ($R + "top_Foot_CTRL");
select -r ($R + "top_Foot_CTRLShape");
select -add ($R + "Foot_CTRL");
parent -r -s;
select -r ($R + "top_Foot_CTRL");
doDelete;
select -cl ;
// Moving the CTRL to Roughly the right place
float $R_CTRLposX = ($HeelLocPos[0] + $ToeLocPos[0] + $InnerLocPos[0] + $OuterLocPos[0])/4;
float $R_CTRLposY = ($HeelLocPos[1] + $ToeLocPos[1] + $InnerLocPos[1] + $OuterLocPos[1])/4;
float $R_CTRLposZ = ($HeelLocPos[2] + $ToeLocPos[2] + $InnerLocPos[2] + $OuterLocPos[2])/4;
xform -t $R_CTRLposX $R_CTRLposY $R_CTRLposZ ($R + "Foot_CTRL");
// adding Foot CTRLS
/*======================MANUALLY SWAP L AND R HERE =============================*/
select -r ($R + "Foot_CTRL");
addAttr -ln "foot_ctrls" -nn "Foot CTRLS" -at double -dv 0 ;
setAttr -e-channelBox true |R_Foot_CTRL.foot_ctrls;
addAttr -ln "Foot_Roll" -at double -min -10 -max 10 -dv 0;
setAttr -e-keyable true |R_Foot_CTRL.Foot_Roll;
addAttr -ln "bank" -at double -min -10 -max 10 -dv 0;
setAttr -e-keyable true |R_Foot_CTRL.bank;
addAttr -ln "heel_piv" -at double -min -90 -max 90 -dv 0;
setAttr -e-keyable true |R_Foot_CTRL.heel_piv;
addAttr -ln "heel_raise" -at double -min -90 -max 90 -dv 0;
setAttr -e-keyable true |R_Foot_CTRL.heel_raise;
addAttr -ln "ball_roll" -at double -min 0 -max 10 -dv 0;
setAttr -e-keyable true |R_Foot_CTRL.ball_roll;
addAttr -ln "toe_piv" -at double -min -90 -max 90 -dv 0;
setAttr -e-keyable true |R_Foot_CTRL.toe_piv;
addAttr -ln "toe_raise" -at double -min -90 -max 90 -dv 0;
setAttr -e-keyable true |R_Foot_CTRL.toe_raise;
addAttr -ln "toe_flop" -at double -min -90 -max 90 -dv 0;
setAttr -e-keyable true |R_Foot_CTRL.toe_flop;
addAttr -ln "inner_piv" -at double -min -90 -max 90 -dv 0;
setAttr -e-keyable true |R_Foot_CTRL.inner_piv;
addAttr -ln "outer_piv" -at double -min -90 -max 90 -dv 0;
setAttr -e-keyable true |R_Foot_CTRL.outer_piv;
addAttr -ln "custom_piv_vis" -at bool;
setAttr -e-keyable true |R_Foot_CTRL.custom_piv_vis;
/*=================================================*/
/* Creating the RL Joints on the LOc's World space */
/*=================================================*/
select -cl;
joint -p $HeelLocPos[0] $HeelLocPos[1] $HeelLocPos[2] -n ($R+ "RL_Heel_JNT");
joint -p $ToeLocPos[0] $ToeLocPos[1] $ToeLocPos[2] -n ($R+ "RL_Toe_JNT");
joint -e -zso -oj xyz -sao yup ($R+ "RL_Heel_JNT");
joint -p $BallLocPos[0] $BallLocPos[1] $BallLocPos[2] -n ($R+ "RL_Ball_JNT");
joint -e -zso -oj xyz -sao yup ($R+ "RL_Toe_JNT");
joint -p $AnkleLocPos[0] $AnkleLocPos[1] $AnkleLocPos[2] -n ($R+ "RL_Ankle_JNT");
joint -e -zso -oj xyz -sao yup ($R+ "RL_Toe_JNT");
// Orr the Joints
select ($R+ "RL_Heel_JNT");
select -hi;
joint -e -oj xyz -secondaryAxisOrient xdown -ch -zso;
select -cl;
/*====================================================*/
/* Creating the Bount Joints on the LOc's World space */
/*====================================================*/
joint -p $AnkleLocPos[0] $AnkleLocPos[1] $AnkleLocPos[2] -n ($R+ "bn_Ankle_JNT");
joint -p $BallLocPos[0] $BallLocPos[1] $BallLocPos[2] -n ($R+ "bn_Ball_JNT");
joint -e -zso -oj xyz -sao yup ($R+ "bn_Ankle_JNT");
joint -p $ToeLocPos[0] $ToeLocPos[1] $ToeLocPos[2] -n ($R+ "be_Toe_JNT");
joint -e -zso -oj xyz -sao yup ($R+ "bn_Ball_JNT");
select ($R+ "bn_Ankle_JNT");
select -hi;
joint -e -oj xyz -secondaryAxisOrient xdown -ch -zso;
select -cl;
select ($R+ "bn_Ball_JNT");
duplicate -po;
select -r ($R+ "bn_Ball_JNT" + "1") ;
rename ($R+ "be_OrrBall_JNT");
parent ($R+ "bn_Ball_JNT")($R+ "be_OrrBall_JNT");
select ($R+ "bn_Ball_JNT");
Group 0 1 1;
rename group1 ($R+ "Bound_Orr_Absorb_GRP");
select -cl;
string $RL_MD2 = ($R + "ReverseFootBallMD");
parentConstraint -mo -weight 1 ($R+ "RL_Ankle_JNT") ($R+ "bn_Ankle_JNT");
parentConstraint -mo -weight 1 ($R+ "RL_Ball_JNT") ($R+ "be_OrrBall_JNT");
shadingNode -asUtility multiplyDivide -n $RL_MD2;
setAttr ($RL_MD2 + ".input2X") -1;
connectAttr -f ($RL_MD2 + ".outputX") ($R+ "Bound_Orr_Absorb_GRP" + ".rotateY");
connectAttr -f ($R+ "RL_Ball_JNT" + ".rotateY") ($RL_MD2 + ".input1X");
// creating Group Heirarchy
group -em -n ($R+ "Heel_Piv_GRP");
group -n ($R+ "Inner_Piv_GRP");
group -n ($R+ "Outer_Piv_GRP");
group -n ($R+ "Toe_Piv_GRP");
group -n ($R+ "Ball_Piv_GRP");
group -n ($R+ "Const_GRP");
xform -ws -t $AnkleLocPos[0] $AnkleLocPos[1] $AnkleLocPos[2] ($R+ "Const_GRP");
xform -ws -t $BallLocPos[0] $BallLocPos[1] $BallLocPos[2] ($R+ "Ball_Piv_GRP");
xform -ws -t $ToeLocPos[0] $ToeLocPos[1] $ToeLocPos[2] ($R+ "Toe_Piv_GRP");
xform -ws -t $OuterLocPos[0] $OuterLocPos[1] $OuterLocPos[2] ($R+ "Outer_Piv_GRP");
xform -ws -t $InnerLocPos[0] $InnerLocPos[1] $InnerLocPos[2] ($R+ "Inner_Piv_GRP");
xform -ws -t $HeelLocPos[0] $HeelLocPos[1] $HeelLocPos[2] ($R+ "Heel_Piv_GRP");
// Creating Custom Piv CTLS and moving into place.
curve -d 1 -p 0 0 -1 -p -0.707107 0 -0.707107 -p -1 0 0 -p -0.707107 0 0.707107 -p 0 0 1 -p 0.707107 0 0.707107 -p 1 0 0 -p 0.707107 0 -0.707107 -p 0 0 -1 -p 0 0 0 -p -5.20986e-008 0 -1.87407 -p 0 0 0 -p 1.87407 0 -2.60493e-008 -p 0 0 0 -p 0 5.20986e-008 1.87407 -p 0 0 0 -p -1.87407 0 -2.60493e-008 -p 0 0 0 -p 0 1 0 -p 0 0 0 -p 0 -1 0 -k 0 -k 1 -k 2 -k 3 -k 4 -k 5 -k 6 -k 7 -k 8 -k 9 -k 10 -k 11 -k 12 -k 13 -k 14 -k 15 -k 16 -k 17 -k 18 -k 19 -k 20 -n ($R+ "Foot_CustPiv_Heel_CTRL");
rename "curveShape1" ($R+ "Foot_CustPiv_Heel_CTRLshape");
curve -d 1 -p 0 0 -1 -p -0.707107 0 -0.707107 -p -1 0 0 -p -0.707107 0 0.707107 -p 0 0 1 -p 0.707107 0 0.707107 -p 1 0 0 -p 0.707107 0 -0.707107 -p 0 0 -1 -p 0 0 0 -p -5.20986e-008 0 -1.87407 -p 0 0 0 -p 1.87407 0 -2.60493e-008 -p 0 0 0 -p 0 5.20986e-008 1.87407 -p 0 0 0 -p -1.87407 0 -2.60493e-008 -p 0 0 0 -p 0 1 0 -p 0 0 0 -p 0 -1 0 -k 0 -k 1 -k 2 -k 3 -k 4 -k 5 -k 6 -k 7 -k 8 -k 9 -k 10 -k 11 -k 12 -k 13 -k 14 -k 15 -k 16 -k 17 -k 18 -k 19 -k 20 -n ($R+ "Foot_CustPiv_Ball_CTRL");
rename "curveShape1" ($R+ "Foot_CustPiv_Ball_CTRLshape");
curve -d 1 -p 0 0 -1 -p -0.707107 0 -0.707107 -p -1 0 0 -p -0.707107 0 0.707107 -p 0 0 1 -p 0.707107 0 0.707107 -p 1 0 0 -p 0.707107 0 -0.707107 -p 0 0 -1 -p 0 0 0 -p -5.20986e-008 0 -1.87407 -p 0 0 0 -p 1.87407 0 -2.60493e-008 -p 0 0 0 -p 0 5.20986e-008 1.87407 -p 0 0 0 -p -1.87407 0 -2.60493e-008 -p 0 0 0 -p 0 1 0 -p 0 0 0 -p 0 -1 0 -k 0 -k 1 -k 2 -k 3 -k 4 -k 5 -k 6 -k 7 -k 8 -k 9 -k 10 -k 11 -k 12 -k 13 -k 14 -k 15 -k 16 -k 17 -k 18 -k 19 -k 20 -n ($R+ "Foot_CustPiv_Toe_CTRL");
rename "curveShape1" ($R+ "Foot_CustPiv_Toe_CTRLshape");
curve -d 1 -p 0 0 -1 -p -0.707107 0 -0.707107 -p -1 0 0 -p -0.707107 0 0.707107 -p 0 0 1 -p 0.707107 0 0.707107 -p 1 0 0 -p 0.707107 0 -0.707107 -p 0 0 -1 -p 0 0 0 -p -5.20986e-008 0 -1.87407 -p 0 0 0 -p 1.87407 0 -2.60493e-008 -p 0 0 0 -p 0 5.20986e-008 1.87407 -p 0 0 0 -p -1.87407 0 -2.60493e-008 -p 0 0 0 -p 0 1 0 -p 0 0 0 -p 0 -1 0 -k 0 -k 1 -k 2 -k 3 -k 4 -k 5 -k 6 -k 7 -k 8 -k 9 -k 10 -k 11 -k 12 -k 13 -k 14 -k 15 -k 16 -k 17 -k 18 -k 19 -k 20 -n ($R+ "Foot_CustPiv_Inner_CTRL");
rename "curveShape1" ($R+ "Foot_CustPiv_Inner_CTRLshape");
curve -d 1 -p 0 0 -1 -p -0.707107 0 -0.707107 -p -1 0 0 -p -0.707107 0 0.707107 -p 0 0 1 -p 0.707107 0 0.707107 -p 1 0 0 -p 0.707107 0 -0.707107 -p 0 0 -1 -p 0 0 0 -p -5.20986e-008 0 -1.87407 -p 0 0 0 -p 1.87407 0 -2.60493e-008 -p 0 0 0 -p 0 5.20986e-008 1.87407 -p 0 0 0 -p -1.87407 0 -2.60493e-008 -p 0 0 0 -p 0 1 0 -p 0 0 0 -p 0 -1 0 -k 0 -k 1 -k 2 -k 3 -k 4 -k 5 -k 6 -k 7 -k 8 -k 9 -k 10 -k 11 -k 12 -k 13 -k 14 -k 15 -k 16 -k 17 -k 18 -k 19 -k 20 -n ($R+ "Foot_CustPiv_Outer_CTRL");
rename "curveShape1" ($R+ "Foot_CustPiv_Outer_CTRLshape");
xform -ws -t $HeelLocPos[0] $HeelLocPos[1] $HeelLocPos[2] ($R+ "Foot_CustPiv_Heel_CTRL");
xform -ws -t $BallLocPos[0] $BallLocPos[1] $BallLocPos[2] ($R+ "Foot_CustPiv_Ball_CTRL");
xform -ws -t $ToeLocPos[0] $ToeLocPos[1] $ToeLocPos[2] ($R+ "Foot_CustPiv_Toe_CTRL");
xform -ws -t $InnerLocPos[0] $InnerLocPos[1] $InnerLocPos[2] ($R+ "Foot_CustPiv_Inner_CTRL");
xform -ws -t $OuterLocPos[0] $OuterLocPos[1] $OuterLocPos[2] ($R+ "Foot_CustPiv_Outer_CTRL");
select -r ($R+ "Foot_CustPiv_Heel_CTRL") ($R+ "Foot_CustPiv_Ball_CTRL") ($R+ "Foot_CustPiv_Toe_CTRL")($R+ "Foot_CustPiv_Inner_CTRL")($R+ "Foot_CustPiv_Outer_CTRL");
makeIdentity -apply true -t 1 -r 1 -s 1 -n 0 -pn 1;
// Connecting Rotate Pivots of LOCs to corresponding GRPS
connectAttr -f ($R+ "Foot_CustPiv_Heel_CTRL" + ".translate") ($R+ "Heel_Piv_GRP" + ".rotatePivot");
connectAttr -f ($R+ "Foot_CustPiv_Ball_CTRL" + ".translate") ($R+ "Ball_Piv_GRP" + ".rotatePivot");
connectAttr -f ($R+ "Foot_CustPiv_Toe_CTRL" + ".translate") ($R+ "Toe_Piv_GRP" + ".rotatePivot");
connectAttr -f ($R+ "Foot_CustPiv_Inner_CTRL" + ".translate") ($R+ "Inner_Piv_GRP" + ".rotatePivot");
connectAttr -f ($R+ "Foot_CustPiv_Outer_CTRL" + ".translate") ($R+ "Outer_Piv_GRP" + ".rotatePivot");
// moving RL foot into GRP
parent ($R+ "RL_Heel_JNT") ($R+ "Heel_Piv_GRP");
// Setting up CTRL Connections to GRPS
connectAttr -f ($R+ "Foot_CTRL.heel_piv")($R+ "Heel_Piv_GRP" + ".rotateY");
connectAttr -f ($R+ "Foot_CTRL.heel_raise")($R+ "Heel_Piv_GRP" + ".rotateX");
connectAttr -f ($R+ "Foot_CTRL.toe_piv")($R+ "Toe_Piv_GRP" + ".rotateY");
connectAttr -f ($R+ "Foot_CTRL.toe_raise")($R+ "Toe_Piv_GRP" + ".rotateX");
connectAttr -f ($R+ "Foot_CTRL.toe_flop") ($R+ "bn_Ball_JNT" + ".rotateY");
connectAttr -f ($R+ "Foot_CTRL.inner_piv") ($R+ "Inner_Piv_GRP" + ".rotateY");
connectAttr -f ($R+ "Foot_CTRL.outer_piv") ($R+ "Outer_Piv_GRP" + ".rotateY");
// SDKS
setDrivenKeyframe -currentDriver ($R+ "Foot_CTRL.bank") ($R+ "Outer_Piv_GRP" + ".rotateZ");
setDrivenKeyframe -currentDriver ($R+ "Foot_CTRL.bank") ($R+ "Inner_Piv_GRP" + ".rotateZ");
setAttr ($R + "Foot_CTRL" + ".bank") 10;
setAttr ($R + "Outer_Piv_GRP" + ".rotateZ") 90;
setDrivenKeyframe -currentDriver ($R+ "Foot_CTRL" + ".bank") ($R+ "Outer_Piv_GRP" + ".rotateZ");
setDrivenKeyframe -currentDriver ($R+ "Foot_CTRL" + ".bank") ($R+ "Inner_Piv_GRP" + ".rotateZ");
setAttr ($R + "Foot_CTRL" + ".bank") -10;
setAttr ($R + "Outer_Piv_GRP" + ".rotateZ") 0;
setAttr ($R + "Inner_Piv_GRP" + ".rotateZ") -90;
setDrivenKeyframe -currentDriver ($R+ "Foot_CTRL" + ".bank") ($R+ "Outer_Piv_GRP" + ".rotateZ");
setDrivenKeyframe -currentDriver ($R+ "Foot_CTRL" + ".bank") ($R+ "Inner_Piv_GRP" + ".rotateZ");
setAttr ($R + "Foot_CTRL.bank") 0;
setAttr ($R + "Foot_CTRL" + ".ball_roll") 0;
setDrivenKeyframe -currentDriver ($R+ "Foot_CTRL" + ".ball_roll") ($R+ "RL_Ball_JNT" + ".rotateY");
setAttr ($R + "Foot_CTRL" + ".ball_roll") 10;
setAttr ($R + "RL_Ball_JNT" + ".rotateY") -60;
setDrivenKeyframe -currentDriver ($R+ "Foot_CTRL" + ".ball_roll") ($R+ "RL_Ball_JNT" + ".rotateY");
setAttr ($R + "Foot_CTRL.ball_roll") 0;
connectAttr -f ($R+ "Foot_CTRL.custom_piv_vis") ($R+ "Foot_CustPiv_Heel_CTRL" + ".visibility");
connectAttr -f ($R+ "Foot_CTRL.custom_piv_vis") ($R+ "Foot_CustPiv_Toe_CTRL" + ".visibility");
connectAttr -f ($R+ "Foot_CTRL.custom_piv_vis") ($R+ "Foot_CustPiv_Ball_CTRL" + ".visibility");
connectAttr -f ($R+ "Foot_CTRL.custom_piv_vis") ($R+ "Foot_CustPiv_Inner_CTRL" + ".visibility");
connectAttr -f ($R+ "Foot_CTRL.custom_piv_vis") ($R+ "Foot_CustPiv_Outer_CTRL" + ".visibility");
// Foot Roll SDK
setDrivenKeyframe -currentDriver R_Foot_CTRL.Foot_Roll R_RL_Ball_JNT.rotateY;
setDrivenKeyframe -currentDriver R_Foot_CTRL.Foot_Roll R_RL_Toe_JNT.rotateY;
setDrivenKeyframe -currentDriver R_Foot_CTRL.Foot_Roll R_RL_Heel_JNT.rotateY;
setAttr "R_Foot_CTRL.Foot_Roll" 5;
setAttr "R_RL_Ball_JNT.rotateY" -30;
setDrivenKeyframe -currentDriver R_Foot_CTRL.Foot_Roll R_RL_Ball_JNT.rotateY;
setDrivenKeyframe -currentDriver R_Foot_CTRL.Foot_Roll R_RL_Toe_JNT.rotateY;
setDrivenKeyframe -currentDriver R_Foot_CTRL.Foot_Roll R_RL_Heel_JNT.rotateY;
setAttr "R_Foot_CTRL.Foot_Roll" 10;
setAttr "R_RL_Toe_JNT.rotateY" -60;
setAttr "R_RL_Ball_JNT.rotateY" 0;
setDrivenKeyframe -currentDriver R_Foot_CTRL.Foot_Roll R_RL_Ball_JNT.rotateY;
setDrivenKeyframe -currentDriver R_Foot_CTRL.Foot_Roll R_RL_Toe_JNT.rotateY;
setDrivenKeyframe -currentDriver R_Foot_CTRL.Foot_Roll R_RL_Heel_JNT.rotateY;
setAttr "R_Foot_CTRL.Foot_Roll" -10;
setAttr "R_RL_Heel_JNT.rotateY" 60;
setDrivenKeyframe -currentDriver R_Foot_CTRL.Foot_Roll R_RL_Ball_JNT.rotateY;
setDrivenKeyframe -currentDriver R_Foot_CTRL.Foot_Roll R_RL_Toe_JNT.rotateY;
setDrivenKeyframe -currentDriver R_Foot_CTRL.Foot_Roll R_RL_Heel_JNT.rotateY;
setAttr "R_Foot_CTRL.Foot_Roll" 0;
// parenting the Bones to CTRL
select -r ($R+ "Foot_CTRL");
makeIdentity -apply true -t 1 -r 1 -s 1 -n 0 -pn 1;
xform -rp $AnkleLocPos[0] $AnkleLocPos[1] $AnkleLocPos[2] ($R+ "Foot_CTRL");
parentConstraint -mo -weight 1 ($R+ "Foot_CTRL")($R+ "Const_GRP");
// parenting Custom Rotate Piv CTRLS to Foot CTRL
select -cl;
select -r ($R+ "Foot_CustPiv_Heel_CTRL") ($R+ "Foot_CustPiv_Ball_CTRL") ($R+ "Foot_CustPiv_Toe_CTRL")($R+ "Foot_CustPiv_Inner_CTRL")($R+ "Foot_CustPiv_Outer_CTRL") ($R+ "Foot_CTRL");
parent;
select -cl;
// Creating Foot GRP
select -r ($R + "bn_Ankle_JNT") ($R + "Const_GRP") ($R + "Foot_CTRL");
group -n ($R + "Foot_GRP");
//cleanup of locs group
select -r "Locs_Mirror_GRP";
doDelete;
select -r "L_LOCS_GRP";
doDelete;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment