Sie sind auf Seite 1von 10

Documentation for character modelled and Rigged using Mel

Modelling : Created a low poly model using reference. Also modeled


Blendshapes for creating facial expressions.
Texture : Used Maya Lambert shaders.
Rigging :
1.
2.
3.
4.
5.
6.
7.

Created a simple bided using joint tool.


Applied Ik RP solvers to arms and legs.
Created polvectors for arms and legs
Created reverse foot system for legs.
Created control handles for legs, arms, spine, neck and fingers.
Created GUI to control facial expressions.
Created Control handles for FK setup for arm and orient constrained it to
respective joints.
8. Created Spline Solver system for Spine.
9. Renamed all joints and control handles respectively.
10.Written a script on IK handle of arms to create IK/FK Switch.

if(L_ikfkSwitch.ikfk==1)
{
L_Ik_cltr|L_IkHandel.ikBlend=1;
L_Ik_cltr.visibility=1;
Chest_ctrl1|Left_Sholder.visibility=0;
L_PV.visibility=1;
}
else
{
L_Ik_cltr|L_IkHandel.ikBlend=0;
L_Ik_cltr.visibility=0;
Chest_ctrl1|Left_Sholder.visibility=1;
L_PV.visibility=0;
}

11.Written a mel script to create stretchy leg setup.


global proc stretchIK () {
string $list[] = `ls -sl`;
if (`window -exists stretch_win`) {

deleteUI -window stretch_win;


}
window -t "IK Stretch (Multiple Joints)" -w 400 -h 300 stretch_win;
columnLayout -adj 1;
text -l "Prefix:" -align "left";
textField prefix_TF;
text -l "Select IKHandle" -align "left";
rowLayout -adj 1 -nc 2;
textField -tx ($list[0]) ikHandle_TF;
button -l " << " -c
stretchIK_addIkHandleToTextField;
setParent..;
// Aim axis
text -l "Select AIM axis" -align "left";
rowColumnLayout -nc 3;
radioCollection aimAxis_RC;
radioButton -label "x" -sl -align "left" RX;
radioButton -label "y" -align "left" RY;
radioButton -label "z" -align "left" RZ;
setParent..;
separator -h 30;
rowLayout -adj 1 -nc 2;
button -l " Ok " -c
("stretchIK_formProcess;deleteUI stretch_win");
button -l " Apply " -c stretchIK_formProcess;
setParent..;
showWindow stretch_win;

}
global proc stretchIK_Multiple (string $ikHandleName, string $prefix,
string $aimAxis) {
switch ($aimAxis) {
case "x": {
$aimAxis = ".tx";
break;
}
case "y": {
$aimAxis = ".ty";
break;
}
case "z": {
$aimAxis = ".tz";
break;
}
}
string $list[] = `ls -sl`;
string $theIkHandle = $ikHandleName;
string $jointList[] = `ikHandle -q -jl $theIkHandle`;
// Aadimos el ltimo joint que el comando ikHandle no aade
string $endEffector = `ikHandle -q -ee $theIkHandle`;
string $lastJoint[] = `pickWalk -d left $endEffector`;
$jointList[size($jointList)] = $lastJoint[0];
// Todos los joints menos el primero
string $stretchyJointList[];
for ($i=0;$i<size($jointList)-1;$i++) {
$stretchyJointList[$i] = $jointList[$i+1];
}

// MD nodes
// normalize MD
string $normalizeMD = `createNode multiplyDivide -n ($prefix +
"Normalize_MD")`;
// joints MD
for ($i=0;$i<size($stretchyJointList);$i++) {
createNode multiplyDivide -n ($prefix +
$stretchyJointList[$i] + "_MD");
}
// condition nodes
// main condition node
string $mainCondition = `createNode condition -n ($prefix +
"Main_CN")`;
// joints CN
for ($i=0;$i<size($stretchyJointList);$i++) {
createNode condition -n ($prefix + $stretchyJointList[$i] +
"_CN");
}
// creacin del distance node y sus locators
string $distanceNode = `createNode distanceBetween -n ($prefix +
"DistNode")`;
string $startLocator[] = `spaceLocator -p 0 0 0 -n ($prefix +
"startDist_loc")`;
string $startLocatorShape[] = `pickWalk -d down $startLocator[0]`;
string $endLocator[] = `spaceLocator -p 0 0 0 -n ($prefix +
"endDist_loc")`;
string $endLocatorShape[] = `pickWalk -d down $endLocator[0]`;
connectAttr -f ($startLocatorShape[0] + ".worldPosition")
($distanceNode + ".point1");
connectAttr -f ($endLocatorShape[0] + ".worldPosition")
($distanceNode + ".point2");

// calculamos la longitud total de la cadena


float $chainLength = 0.0000;
for ($i=0;$i<size($stretchyJointList);$i++) {
$chainLength += `getAttr ($stretchyJointList[$i] +
$aimAxis)`;
}
$chainLength = abs($chainLength);
// conexiones
// distance node
pointConstraint -w 1 $jointList[0] $startLocator[0];
pointConstraint -w 1 $theIkHandle $endLocator[0];
// main condition
setAttr ($mainCondition + ".operation") 3;
setAttr ($mainCondition + ".firstTerm") $chainLength;
connectAttr -f ($distanceNode + ".distance") ($mainCondition +
".secondTerm");
setAttr ($mainCondition + ".colorIfTrueR") 0;
setAttr ($mainCondition + ".colorIfFalseR") 1;
// normalize MD
setAttr ($normalizeMD + ".operation") 2;
connectAttr -f ($distanceNode + ".distance") ($normalizeMD +
".input1X");
setAttr ($normalizeMD + ".input2X") $chainLength;
float $aimValue;
for ($i=0;$i<size($stretchyJointList);$i++) {
connectAttr -f ($normalizeMD + ".outputX") ($prefix +
$stretchyJointList[$i] + "_MD" + ".input1X");
$aimValue = `getAttr ($stretchyJointList[$i] + $aimAxis)`;
$aimValue = abs ($aimValue);
setAttr ($prefix + $stretchyJointList[$i] + "_MD" +
".input2X") $aimValue;

}
for ($i=0;$i<size($stretchyJointList);$i++) {
connectAttr -f ($mainCondition + ".outColor.outColorR")
($prefix + $stretchyJointList[$i] + "_CN" + ".firstTerm");
setAttr ($prefix + $stretchyJointList[$i] + "_CN" +
".secondTerm") 1;
$aimValue = `getAttr ($stretchyJointList[$i] + $aimAxis)`;
$aimValue = abs ($aimValue);
setAttr ($prefix + $stretchyJointList[$i] + "_CN" +
".colorIfFalseR") $aimValue;
connectAttr -f ($prefix + $stretchyJointList[$i] + "_MD" +
".outputX") ($prefix + $stretchyJointList[$i] + "_CN" + ".colorIfTrueR");
connectAttr -f ($prefix + $stretchyJointList[$i] + "_CN" +
".outColor.outColorR") ($stretchyJointList[$i] + $aimAxis);
}
// Creamos un atributo en el ikHandle para on/off la funcion de
stretch
addAttr -ln "ikStretch" -at double -min 0 -max 1 -dv 1
$theIkHandle;
setAttr -e-keyable true ($theIkHandle + ".ikStretch");
connectAttr -f ($theIkHandle + ".ikStretch") ($mainCondition +
".colorIfFalseR");
print ("// The attribute \"Ik Stretch\" has been created at " +
$theIkHandle + " to control stretch on/off\n");
select $theIkHandle;
}
global proc stretchIK_formProcess () {
string $theIkHandle = `textField -q -tx ikHandle_TF`;
string $thePrefix = `textField -q -tx prefix_TF`;

string $aimAxisCollRadioSelected = `radioCollection -q -sl


aimAxis_RC`;
string $aimAxis = `radioButton -q -l $aimAxisCollRadioSelected`;
stretchIK_Multiple ($theIkHandle, $thePrefix, $aimAxis);
}
global proc stretchIK_addIkHandleToTextField () {
string $list[] = `ls -sl`;
textField -e -tx $list[0] ikHandle_TF;
}

12 . Written mel script to create stretchy spine system


Interaction
if (`window -exists "nnStretch"`)
deleteUI "nnStretch";
window -t"nnStretchy Spine" -h 50 -w 100 -mxb 0 -mnb 0 nnStretch;
columnLayout -adj 1 -w 50 -h 50 -rs 5;
text -l "Select spline IKHandle and press the button" -fn
"smallBoldLabelFont";
button -l " << Make Selected SplineIK Stretchy >>" -h 20 -w 30 -c

("nnStretchSpine()");
text -l" Parent the SpineGlobalScaleDummy null under Master Control to
work with Scaling";
text -l" Spine Strech" -bgc 1 1 1;
showWindow nnStretch;
////////////////////////////////////////////////////////////////////////////
/////////////////

global proc nnStretchSpine()


{
string $ikHandle []=`ls -sl`;

string $ikJoints [] =`ikHandle -q -jl $ikHandle`;


string $numberOfBones =`size $ikJoints`;
string $splineCRV = `ikHandle -q -c $ikHandle`;
string $loc []=`spaceLocator -p 0 0 0 -n "SpineGlobalScaleDummy"`;
select $loc;
//------------------------------------------------------select $splineCRV;
string $arclen =`arclen -ch 1`;
//----------------------------------------------------string $multiDivArclen =`shadingNode -asUtility multiplyDivide`;
setAttr ($multiDivArclen +".operation")2;
addAttr -ln "stretchy" -at double -dv 0 -keyable 1 $multiDivArclen ;
addAttr -ln "spineVolume" -at double -dv 0 -keyable 1 $multiDivArclen ;

connectAttr -force ($arclen+".arcLength") ($multiDivArclen +".input1X");


connectAttr -force ($multiDivArclen +".outputX") ($multiDivArclen
+".stretchy");
float $input2X =`getAttr ($multiDivArclen +".input1X")`;
setAttr ($multiDivArclen +".input2X") $input2X;
//----------------------------------------------------------------------------

string $multiDivScale =`shadingNode -asUtility multiplyDivide`;


connectAttr -force ($loc [0]+".sy") ($multiDivScale +".input1X");

//-------------------------------------------------------------------string $outMultiDiv =`shadingNode -asUtility multiplyDivide`;

setAttr ($outMultiDiv +".operation") 2;


connectAttr -force ($multiDivArclen +".stretchy") ($outMultiDiv
+".input1X");
connectAttr -force ($multiDivScale+".outputX") ($outMultiDiv
+".input2X");
connectAttr -force ($outMultiDiv+".outputX")
($multiDivArclen+".spineVolume");
//------------------------------------------------------------------------------string $eachElement;
for ($eachElement in $ikJoints )
{

connectAttr -force ($outMultiDiv +".outputX") ($eachElement +


".scaleX");
}
}
13. Connected Blendshapes to GUI using set driven key to make facial
expressions

Das könnte Ihnen auch gefallen