My Showreel




Download High-definition video of the Demo Reel.


http://www.4shared.com/file/107172102/3a8046f8/Rk_RIGnMEL.html

Scripts

There were times I found myself pulling my hair out with frustration due to weird and unacceptable errors in Maya and sometimes even dozing off while repeating the same task over and over again. Well.... knowing MEL just did the trick. Anyway I m uploading a few of my scripts i wrote to ease up my work flow. Use them to save some time and a few remaining hair...... U'll definitely need those to deal with ur marital issues...!!

Script: Unlock OverrideColor

Error: The attribute 'Control.overrideColor' is locked or connected and cannot be modified.

This is an error shown in MAYA when we try to change the color of a control object( Nurbs or Polygons ) using the Drawing Overrides feature in the Attribute Editor
of a Rig.
Though its not that common that we get this error but if u do then here is the solution.

Mel Window:


Script:

global proc colorOverrideUI()

{

if(`window -exists colorOverride` )
deleteUI colorOverride;

window -title "Unlock OverrideColor" -width 280 colorOverride;
columnLayout myColumn1;

separator -style "none" -h 15 sep_1;
colorIndexSliderGrp -label "Select Color" -min 2 -max 24 -value 17 mycolorIndexSliderGrp;

separator -style "none" -h 15 sep_2;

button -label "GO" -width 425 -command co mybutton;

separator -style "none" -h 10 sep_3;

text -align "left" -label " Note: Use this Script only when there is an error during Drawing Overrides.\n\n Example - ' The attribute 'Control_L_FK_ElbowShape.overrideColor' is locked or \n connected and cannot be modified. '. \n\n Rakesh K Karkera \n tylerdurtan@gmail.com" mytext;

separator -style "none" -h 10 sep_4;

showWindow colorOverride;
}


global proc co()
{
int $color_slider=`colorIndexSliderGrp -q -value mycolorIndexSliderGrp`;
$color = $color_slider-1;

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

string $shape[];
string $layer[];
string $colorNode;

for ($node in $list)
{

$shape = `listRelatives -f -s $node`;

if (size($shape) == 0)
{

$colorNode = $node;
}
else
{

$colorNode = $shape[0];

}

}

$layer = `listConnections -t displayLayer $colorNode`;


if (size($layer) != 0)
{
disconnectAttr ($layer[0] + ".drawInfo") ($colorNode + ".drawOverride");

setAttr ($colorNode + ".overrideEnabled") 1;
setAttr ($colorNode + ".overrideColor") $color;
}
print "Color override complete.";
}

How To Use: Select the control object, then select the color from the Color Slider and hit "GO".

When To Use: Use this script only when there is an error as it repairs the override connections by breaking it. This script does not work when there is no error.

Mirror Control Objects

Well this one is a time saver. After making those creative and fancy controls to control ur rig, re-doing it again on the opposite side is a little boring. This script does the trick.

Mel Window:


Script:

global proc rakesh_MirrorObjects()
{


if(`window -exists rakesh_MirrorObjectsUI`)
deleteUI rakesh_MirrorObjectsUI;


window -title " Mirror Control Objects " -sizeable 1 rakesh_MirrorObjectsUI;
menuBarLayout myMenubar;
menu -label "\nHelp";

columnLayout -adj 1 myColumn;
text -label" \n " myTex;
button -label " Mirror " -command mirror myButton;
text -label" \n " myTe;
textFieldGrp
-label "Search For"
-text "_L_" myTextFieldGrp_1;
textFieldGrp
-label "Replace With"
-text "_R_" myTextFieldGrp_2;
text -label" \n " ;
button -label " Mirror After Freeze Transformation " -command mirrorAfterFreezeTrans myButton1;
text -label" \n " ;
text -label" Rakesh K Karkera " myText;
text -label" tylerdurtan@gmail.com " myid;
separator -style "in" mySeparator;
text -label" \n " myspace;

showWindow rakesh_MirrorObjectsUI;


}

global proc mirror()
{

string $selectedObject[]= `ls -sl`;
string $searchFor= `textFieldGrp -q -text myTextFieldGrp_1`;
string $replaceWith= `textFieldGrp -q -text myTextFieldGrp_2`;
for( $eachObject in $selectedObject )
{
select -r $eachObject;


float $translateValues[]=`xform -q -ws -rp $eachObject`;

float $translateValues_IF[]=`xform -q -ws -t $eachObject`;
float $rotateValues[]=`xform -q -ws -rotation $eachObject`;

if( $translateValues_IF[0]==0 && $translateValues_IF[1]==0 && $translateValues_IF[2]==0
&& $rotateValues[0]==0 && $rotateValues[1]==0 && $rotateValues[2]==0 )
{
confirmDialog -title "Alert" -message "The values of the Control Objects have been Frozen already. Click on the \"Mirror After Freeze Transformation \" button below."
-button "Re-Do";
break;
}
else
{
duplicate -name ($eachObject+"_mirrored") $eachObject;
string $duplicatedObject[]= `ls -sl`;

float $translateValues[]=`xform -q -ws -rp $eachObject`;
float $rotateValues[]=`xform -q -ws -rotation $eachObject`;

float $scaleX = `getAttr ($eachObject+".sx")`;
float $scaleY = `getAttr ($eachObject+".sy")`;
float $scaleZ = `getAttr ($eachObject+".sz")`;

float $new_translateXVal = - $translateValues[0];

float $new_rotateYVal = 180 + $rotateValues[1];
float $new_rotateZVal = 180 - $rotateValues[2];

float $new_scaleX = - $scaleX;
float $new_scaleY = - $scaleY;
float $new_scaleZ = - $scaleZ;

setAttr ($duplicatedObject[0]+ ".tx") $new_translateXVal;

setAttr ($duplicatedObject[0]+ ".ty") $translateValues[1];

setAttr ($duplicatedObject[0]+ ".tz") $translateValues[2];

setAttr ($duplicatedObject[0]+ ".rx") $rotateValues[0];

setAttr ($duplicatedObject[0]+ ".ry") $new_rotateYVal;

setAttr ($duplicatedObject[0]+ ".rz") $new_rotateZVal;

setAttr ($duplicatedObject[0]+ ".sx") $new_scaleX;

setAttr ($duplicatedObject[0]+ ".sy") $new_scaleY;

setAttr ($duplicatedObject[0]+ ".sz") $new_scaleZ;

makeIdentity -apply true -t 0 -r 0 -s 1 -n 0 $duplicatedObject[0];


searchReplaceNames $searchFor $replaceWith "hierarchy";

searchReplaceNames "_mirrored" " " "hierarchy";

}
}

}

global proc mirrorAfterFreezeTrans()
{

string $selectedObject[]= `ls -sl`;
string $searchFor= `textFieldGrp -q -text myTextFieldGrp_1`;
string $replaceWith= `textFieldGrp -q -text myTextFieldGrp_2`;
for( $eachObject in $selectedObject )
{
select -r $eachObject;

float $translateValues_IF[]=`xform -q -ws -t $eachObject`;
float $rotateValues[]=`xform -q -ws -rotation $eachObject`;

if( $translateValues_IF[0]!=0 && $translateValues_IF[1]!=0 &&$translateValues_IF[2]!=0
&&$rotateValues[0]!=0 &&$rotateValues[1]!=0 &&$rotateValues[2]!=0 )

{
confirmDialog -title "Alert" -message "The values of the Control Objects has'nt been Frozen. Click on the \"Mirror \" button above."
-button "Re-Do";
break;
}
else

{
duplicate -name ($eachObject+"_mirrored") $eachObject;
string $duplicatedObject[]= `ls -sl`;



move 0 0 0 ($duplicatedObject[0]+".scalePivot") ;
setAttr ($duplicatedObject[0]+ ".sx") -1;

CenterPivot;
makeIdentity -apply true -t 0 -r 0 -s 1 -n 0 $duplicatedObject[0];

CenterPivot;
searchReplaceNames $searchFor $replaceWith "hierarchy";

searchReplaceNames "_mirrored" " " "hierarchy";

}
}

}

How To Use: Select the control object and hit the relevant button on the window.

Note: This Script works only in the YZ-Axis.

Advanced Twist Control

Alright, here is a confusing concept for the beginners. Though the theory of the advanced twist is slightly complicated to comprehend, the result is just smooth. Anyways, here is my script.

Mel Window:


Script:

global proc rk_advanceTwistControl()

{
if(`window -exists rk_advanceTwistControlUI`)
deleteUI rk_advanceTwistControlUI;

window -title " Advanced Twist Controls " -maximizeButton 0 rk_advanceTwistControlUI;
menuBarLayout myMenubar;
menu -label "\nHelp";
menu -label "\nEdit" myResetmenu ;
menuItem -label "Reset" -command rk_advanceTwistControl myMenuitem;
formLayout myformLayout;
//-----------------------------------------------------------------------------------
text -label " Joints " jointsText;
textScrollList -height 50 my_jointsTSL;

//-----------------------------------------------------------------------------------
text -label " IK Spline Handle" ikHandleText;
textScrollList -height 25 my_ikHandleTSL;

//-----------------------------------------------------------------------------------

text -label " Control Objects" myControlsText;
textScrollList -height 50 my_ConObjectsTSL;

//-----------------------------------------------------------------------------------

button -label " Joints " -command jointProcedure joints_button;
button -label " IK Spline Handle " -command ikHandleProcedure IKSpline_button;
button -label " Control Objects " -command controlsProcedure conObjects_button;

//-----------------------------------------------------------------------------------------

button -label " Go " -command go go_button;

//---------------------------------------------------------------
text -label " Rakesh K Karkera " myName;
text -label " tylerdurtan@gmail.com " myid;

formLayout -edit

-attachForm jointsText left 5
-attachForm jointsText top 5
-attachPosition jointsText right 0 30

-attachForm my_jointsTSL left 5
-attachControl my_jointsTSL top 2 jointsText
-attachPosition my_jointsTSL right 0 30
//-----------------------------------------------------------------------------------
-attachControl ikHandleText left 5 jointsText
-attachForm ikHandleText top 5
-attachPosition ikHandleText right 0 60

-attachControl my_ikHandleTSL left 5 my_jointsTSL
-attachControl my_ikHandleTSL top 2 ikHandleText
-attachPosition my_ikHandleTSL right 0 61
//-----------------------------------------------------------------------------------

-attachControl myControlsText left 5 ikHandleText
-attachForm myControlsText top 5
-attachPosition myControlsText right 0 90

-attachControl my_ConObjectsTSL left 6 my_ikHandleTSL
-attachControl my_ConObjectsTSL top 2 myControlsText
-attachPosition my_ConObjectsTSL right 0 98

//---------------------------------------------------------------------------------
-attachForm joints_button left 9
-attachControl joints_button top 15 my_jointsTSL
-attachPosition joints_button right 0 28

-attachControl IKSpline_button left 25 joints_button
-attachControl IKSpline_button top 40 my_ikHandleTSL
-attachPosition IKSpline_button right 0 59


-attachControl conObjects_button left 28 IKSpline_button
-attachControl conObjects_button top 15 my_ConObjectsTSL
-attachPosition conObjects_button right 0 97
//-------------------------------------------------------------------------------------
-attachForm go_button left 30
-attachControl go_button top 20 IKSpline_button
-attachForm go_button right 30

//--------------------------------------------------------------------------------------

-attachPosition myName left 0 38
-attachControl myName top 30 go_button
-attachPosition myName right 0 95


-attachPosition myid left 1 36
-attachControl myid top 0 myName
-attachPosition myid right 0 95

//----------------------------------------------------------------------------
myformLayout;

showWindow rk_advanceTwistControlUI;

}

global proc jointProcedure()

{
textScrollList -edit -removeAll my_jointsTSL;
string $selectedJoints[]= `ls -sl -head 2 ` ;

for( $eachJoint in $selectedJoints)


{
textScrollList -edit -append $eachJoint my_jointsTSL;
}

}

global proc ikHandleProcedure()

{

textScrollList -edit -removeAll my_ikHandleTSL;

string $selectedIK[]=`ls -sl -head 1`;

textScrollList -edit -append $selectedIK[0] my_ikHandleTSL;
}

global proc controlsProcedure()
{
textScrollList -edit -removeAll my_ConObjectsTSL;

string $selectedControls[]=`ls -sl -head 2`;
string $selectedJoints[]= `textScrollList -q -allItems my_jointsTSL`;

int $i;
for($i=0; $i<=1; $i++)
{
textScrollList -edit -append $selectedControls[$i] my_ConObjectsTSL;

select -r $selectedControls[$i];
move 0 0 0 ;
rotate 0 0 0 ;
group -relative -name ($selectedControls[$i]+"_grp" );

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

parentConstraint $selectedJoints[$i] $grouped[0];
select -r ($grouped[0]+"_parentConstraint1");
delete;
}
}
global proc go()

{
string $selectedikHandle[]= `textScrollList -q -allItems my_ikHandleTSL`;

string $selectedconObjects[]= `textScrollList -q -allItems my_ConObjectsTSL`;

setAttr ($selectedikHandle[0]+".dTwistControlEnable") 1;

setAttr ($selectedikHandle[0]+".dWorldUpType") 4;

string $wrldUpObject = $selectedconObjects[0];
string $wrldUpObject2 = $selectedconObjects[1];
string $splnIKHandle = $selectedikHandle[0];
connectAttr -f ($wrldUpObject + ".worldMatrix") ($splnIKHandle+".dWorldUpMatrix");
connectAttr -f ($wrldUpObject2 + ".worldMatrix") ($splnIKHandle+".dWorldUpMatrixEnd");
}

Where To Use: Advance twist is commonly used in the spine of a bi-ped rig. After attaching the ikSpline handle to the spine, attaching the controls to its advance twist gives a very smooth rotation action in a certain direction.

How To Use: After creating the skeleton and attaching the ikSpline handle to the bi-ped character, create two control curves as shown in picture 1 below. In my case i have just created two nurbs circles but u can create your fancy curves. Remember to keep them near the origin as shown in the picture.


Then attach the joints, ikSpline handle and conrols to the Mel Window by selecting and hitting on their respective buttons as shown below in picture 2.


Finally click on 'GO'. The advanced twist is thus activated and by rotating the controls in the X- Axis direction we can see a smooth rotation down the spine as shown in picture below.