Tuesday, 21 December 2010

ZOMG SAUCE PLOX!!!!!1!!!!111!!

proc sc_gui()
{
string $selection[] = (`ls -selection`);
if (`window -exists "sc_gui"`) deleteUI "sc_gui";
window -w 150 -h 300 -t "My Tool Set" -maximizeButton false -minimizeButton false sc_gui;
print "Selected: ";
print ($selection);
columnLayout;
button -l "Select Hierachy" -w 150 -c "sc_hi";
separator -style "double" -w 150;
button -l "Create Locator" -w 150 -c "sc_locator";
separator -style "double" -w 150;
button -l "Toggle Rotation Axes" -w 150 -c "sc_axes";
separator -style "double" -w 150;
button -l "Rename Selected" -w 150 -c "sc_Rename";
separator -style "double" -w 150;
button -label "Convention" -w 150 -command "sc_Convention";
separator -style "double" -w 150;
button -label "Create Box Curve" -w 150 -command "sc_curveBox";
separator -style "double" -w 150;
button -label "Create Joint Curve" -w 150 -command "sc_curveJoint";
separator -style "double" -w 150;
button -label "Character Nodes" -w 150 -command "sc_grpNodes";
separator -style "double" -w 150;
button -label "Vertex Joints" -w 150 -command "sc_vertJoint";
separator -style "double" -w 150;
button -label "Hyper Shader" -w 150 -command "sc_hypershader_gui";
showWindow "sc_gui";
}
proc sc_Convention()
{
if (`window -exists "sc_Convention"`) deleteUI "sc_Convention";
window -w 150 -h 300 -t "GUI" -maximizeButton false -minimizeButton false sc_Convention;
columnLayout -adj 1;
text -w 150 -al "left" -fn "boldLabelFont" -l "Prefix";
textField -width 150 sc_preffix;
text -w 150 -al "left" -fn "boldLabelFont" -l "Sufix";
textField -width 150 -text `date -format "DDMMYY"` sc_suffix;
button -l "Apply" -w 150 -c "sc_Convention_win";
showWindow "sc_Convention";
}
proc sc_Convention_win()
{
string $marker = "nc_";
string $prefix = `textField -q -text sc_preffix`;
string $sufix = `textField -q -text sc_suffix`;
string $selection[] = (`ls -selection`);
if (size($prefix) == 0 || size($prefix) < 1 )
{
print "\nNo Prefix defined\n";
}
else
{
print "\nPREFIX: ";
print ($prefix + "\n");
}
if (size($selection) == 0 || size($selection) < 1 )
{
print "No Objest selected\n";
}
else
{
for ($items in $selection)
{
print ($items + "\n");
string $matches = (`match $marker $items`);
print ($matches + "\n");
if ( $matches == $marker)
{
print "false \n ";
}
else
{
rename $items ("nc_" + $prefix + "_" + $items + "_" + $sufix);
}
}
}
string $selection[] = (`ls -selection`);
print "Selected:\n";
print $selection "\n";
}
proc sc_Rename()
{
if (`window -exists "rnm_win"`) deleteUI "rnm_win";
window -w 600 -h 300 -t "Rename" -maximizeButton false -minimizeButton false rnm_win;
columnLayout -adj 1;
string $sel[] = `ls -sl`;
for ($each in $sel)
{
nameField -o $each;
}
showWindow rnm_win;
}
proc sc_locator()
{
string $locator[] = `spaceLocator`;
string $Rename = `rename $locator "loc"`;
}
proc sc_hi()
{
select -hi;
}
proc sc_axes()
{
ToggleLocalRotationAxes;
}
proc sc_curveBox()
{
string $boxCurve = `curve -d 1 -p -4.810877 4.810877 4.810877 -p 4.810877 4.810877 4.810877 -p 4.810877 4.810877 -4.810877 -p -4.810877 4.810877 -4.810877 -p -4.810877 4.810877 4.810877 -p -4.810877 -4.810877 4.810877 -p 4.810877 -4.810877 4.810877 -p 4.810877 -4.810877 -4.810877 -p 4.810877 4.810877 -4.810877 -p 4.810877 4.810877 4.810877 -p 4.810877 -4.810877 4.810877 -p 4.810877 -4.810877 -4.810877 -p -4.810877 -4.810877 -4.810877 -p -4.810877 4.810877 -4.810877 -p -4.810877 -4.810877 -4.810877 -p -4.810877 -4.810877 4.810877 -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` ;
select $boxCurve;
string $RenameCurve = `rename $boxCurve "boxCurve01"`;
}
proc sc_curveJoint()
{
string $circleCurve1[] = `circle -c 0 0 0 -nr 0 1 0 -sw 360 -r 1 -d 3 -ut 0 -tol 0.01 -s 8 -ch 1`;
string $circleCurve2[] = `circle -c 0 0 0 -nr 0 1 0 -sw 360 -r 1 -d 3 -ut 0 -tol 0.01 -s 8 -ch 1`;
string $circleCurve3[] = `circle -c 0 0 0 -nr 0 1 0 -sw 360 -r 1 -d 3 -ut 0 -tol 0.01 -s 8 -ch 1`;
rotate -r -os 90 0 0 $circleCurve2[0];
rotate -r -os 0 0 90 $circleCurve3[0];
select $circleCurve2[0];
select -add $circleCurve3[0];
makeIdentity -apply 1 -t 1 -r 1 -s 1;
string $relativeCurve2[] = `listRelatives -shapes $circleCurve2[0]`;
string $relativeCurve3[] = `listRelatives -shapes $circleCurve3[0]`;
parent -r -s $relativeCurve2[0] $circleCurve1[0];
parent -r -shape $relativeCurve3[0] $circleCurve1[0];
select $circleCurve2[0];
select -add $circleCurve3[0];
doDelete;
string $RenameCurve = `rename $circleCurve1[0] "jointCurve01"`;
select $RenameCurve;
}
proc sc_vertJoint()
{
string $selVert[] = `ls -sl -fl`;
for ($verts in $selVert)
{
select $verts;
//cluster on each vert
string $cluster[] = `newCluster "-relative -envelope 1"`;
//clear selection
select -cl;
//create joint
string $newJoint = `joint`;
//point constrain
string $pointConstrain[] = `pointConstraint -offset 0 0 0 -weight 1 $cluster $newJoint`;
//query the constraint
string $findConstraint[] = `listRelatives -typ pointConstraint $newJoint`;
//select and delete constraint
select $findConstraint[0];
doDelete;
//delete the cluster
select -replace $cluster;
doDelete;
}
}
proc sc_grpNodes()
{
group -em -w -n charNode01;
group -em -w -n globalMove01;
group -em -w -n joints01;
group -em -w -n iks01;
group -em -w -n controlObjects01;
group -em -w -n to_transform01;
group -em -w -n trns_toShow01;
group -em -w -n trns_toHide01;
group -em -w -n model01;
group -em -w -n blendShapes01;
group -em -w -n extraNodes01;
group -em -w -n xtra_toShow01;
group -em -w -n xtra_toHide01;
setAttr -lock true -keyable false -channelBox false "xtra_toHide01.tx";
setAttr -lock true -keyable false -channelBox false "charNode01.tx";
setAttr -lock true -keyable false -channelBox false "joints01.tx";
setAttr -lock true -keyable false -channelBox false "iks01.tx";
setAttr -lock true -keyable false -channelBox false "controlObjects01.tx";
setAttr -lock true -keyable false -channelBox false "to_transform01.tx";
setAttr -lock true -keyable false -channelBox false "trns_toShow01.tx";
setAttr -lock true -keyable false -channelBox false "trns_toHide01.tx";
setAttr -lock true -keyable false -channelBox false "model01.tx";
setAttr -lock true -keyable false -channelBox false "blendShapes01.tx";
setAttr -lock true -keyable false -channelBox false "extraNodes01.tx";
setAttr -lock true -keyable false -channelBox false "xtra_toShow01.tx";
setAttr -lock true -keyable false -channelBox false "xtra_toHide01.ty";
setAttr -lock true -keyable false -channelBox false "charNode01.ty";
setAttr -lock true -keyable false -channelBox false "joints01.ty";
setAttr -lock true -keyable false -channelBox false "iks01.ty";
setAttr -lock true -keyable false -channelBox false "controlObjects01.ty";
setAttr -lock true -keyable false -channelBox false "to_transform01.ty";
setAttr -lock true -keyable false -channelBox false "trns_toShow01.ty";
setAttr -lock true -keyable false -channelBox false "trns_toHide01.ty";
setAttr -lock true -keyable false -channelBox false "model01.ty";
setAttr -lock true -keyable false -channelBox false "blendShapes01.ty";
setAttr -lock true -keyable false -channelBox false "extraNodes01.ty";
setAttr -lock true -keyable false -channelBox false "xtra_toShow01.ty";
setAttr -lock true -keyable false -channelBox false "xtra_toHide01.tz";
setAttr -lock true -keyable false -channelBox false "charNode01.tz";
setAttr -lock true -keyable false -channelBox false "joints01.tz";
setAttr -lock true -keyable false -channelBox false "iks01.tz";
setAttr -lock true -keyable false -channelBox false "controlObjects01.tz";
setAttr -lock true -keyable false -channelBox false "to_transform01.tz";
setAttr -lock true -keyable false -channelBox false "trns_toShow01.tz";
setAttr -lock true -keyable false -channelBox false "trns_toHide01.tz";
setAttr -lock true -keyable false -channelBox false "model01.tz";
setAttr -lock true -keyable false -channelBox false "blendShapes01.tz";
setAttr -lock true -keyable false -channelBox false "extraNodes01.tz";
setAttr -lock true -keyable false -channelBox false "xtra_toShow01.tz";
setAttr -lock true -keyable false -channelBox false "xtra_toHide01.rx";
setAttr -lock true -keyable false -channelBox false "charNode01.rx";
setAttr -lock true -keyable false -channelBox false "joints01.rx";
setAttr -lock true -keyable false -channelBox false "iks01.rx";
setAttr -lock true -keyable false -channelBox false "controlObjects01.rx";
setAttr -lock true -keyable false -channelBox false "to_transform01.rx";
setAttr -lock true -keyable false -channelBox false "trns_toShow01.rx";
setAttr -lock true -keyable false -channelBox false "trns_toHide01.rx";
setAttr -lock true -keyable false -channelBox false "model01.rx";
setAttr -lock true -keyable false -channelBox false "blendShapes01.rx";
setAttr -lock true -keyable false -channelBox false "extraNodes01.rx";
setAttr -lock true -keyable false -channelBox false "xtra_toShow01.rx";
setAttr -lock true -keyable false -channelBox false "xtra_toHide01.ry";
setAttr -lock true -keyable false -channelBox false "charNode01.ry";
setAttr -lock true -keyable false -channelBox false "joints01.ry";
setAttr -lock true -keyable false -channelBox false "iks01.ry";
setAttr -lock true -keyable false -channelBox false "controlObjects01.ry";
setAttr -lock true -keyable false -channelBox false "to_transform01.ry";
setAttr -lock true -keyable false -channelBox false "trns_toShow01.ry";
setAttr -lock true -keyable false -channelBox false "trns_toHide01.ry";
setAttr -lock true -keyable false -channelBox false "model01.ry";
setAttr -lock true -keyable false -channelBox false "blendShapes01.ry";
setAttr -lock true -keyable false -channelBox false "extraNodes01.ry";
setAttr -lock true -keyable false -channelBox false "xtra_toShow01.ry";
setAttr -lock true -keyable false -channelBox false "xtra_toHide01.rz";
setAttr -lock true -keyable false -channelBox false "charNode01.rz";
setAttr -lock true -keyable false -channelBox false "joints01.rz";
setAttr -lock true -keyable false -channelBox false "iks01.rz";
setAttr -lock true -keyable false -channelBox false "controlObjects01.rz";
setAttr -lock true -keyable false -channelBox false "to_transform01.rz";
setAttr -lock true -keyable false -channelBox false "trns_toShow01.rz";
setAttr -lock true -keyable false -channelBox false "trns_toHide01.rz";
setAttr -lock true -keyable false -channelBox false "model01.rz";
setAttr -lock true -keyable false -channelBox false "blendShapes01.rz";
setAttr -lock true -keyable false -channelBox false "extraNodes01.rz";
setAttr -lock true -keyable false -channelBox false "xtra_toShow01.rz";
setAttr -lock true -keyable false -channelBox false "xtra_toHide01.sx";
setAttr -lock true -keyable false -channelBox false "charNode01.sx";
setAttr -lock true -keyable false -channelBox false "joints01.sx";
setAttr -lock true -keyable false -channelBox false "iks01.sx";
setAttr -lock true -keyable false -channelBox false "controlObjects01.sx";
setAttr -lock true -keyable false -channelBox false "to_transform01.sx";
setAttr -lock true -keyable false -channelBox false "trns_toShow01.sx";
setAttr -lock true -keyable false -channelBox false "trns_toHide01.sx";
setAttr -lock true -keyable false -channelBox false "model01.sx";
setAttr -lock true -keyable false -channelBox false "blendShapes01.sx";
setAttr -lock true -keyable false -channelBox false "extraNodes01.sx";
setAttr -lock true -keyable false -channelBox false "xtra_toShow01.sx";
setAttr -lock true -keyable false -channelBox false "xtra_toHide01.sy";
setAttr -lock true -keyable false -channelBox false "charNode01.sy";
setAttr -lock true -keyable false -channelBox false "joints01.sy";
setAttr -lock true -keyable false -channelBox false "iks01.sy";
setAttr -lock true -keyable false -channelBox false "controlObjects01.sy";
setAttr -lock true -keyable false -channelBox false "to_transform01.sy";
setAttr -lock true -keyable false -channelBox false "trns_toShow01.sy";
setAttr -lock true -keyable false -channelBox false "trns_toHide01.sy";
setAttr -lock true -keyable false -channelBox false "model01.sy";
setAttr -lock true -keyable false -channelBox false "blendShapes01.sy";
setAttr -lock true -keyable false -channelBox false "extraNodes01.sy";
setAttr -lock true -keyable false -channelBox false "xtra_toShow01.sy";
setAttr -lock true -keyable false -channelBox false "xtra_toHide01.sz";
setAttr -lock true -keyable false -channelBox false "charNode01.sz";
setAttr -lock true -keyable false -channelBox false "joints01.sz";
setAttr -lock true -keyable false -channelBox false "iks01.sz";
setAttr -lock true -keyable false -channelBox false "controlObjects01.sz";
setAttr -lock true -keyable false -channelBox false "to_transform01.sz";
setAttr -lock true -keyable false -channelBox false "trns_toShow01.sz";
setAttr -lock true -keyable false -channelBox false "trns_toHide01.sz";
setAttr -lock true -keyable false -channelBox false "model01.sz";
setAttr -lock true -keyable false -channelBox false "blendShapes01.sz";
setAttr -lock true -keyable false -channelBox false "extraNodes01.sz";
setAttr -lock true -keyable false -channelBox false "xtra_toShow01.sz";
setAttr -lock true -keyable false -channelBox false "globalMove01.visibility";
select -r trns_toShow01;
select -tgl trns_toHide01;
select -tgl to_transform01;
parent;
select -r joints01;
select -tgl iks01;
select -tgl controlObjects01;
select -tgl to_transform01;
select -tgl globalMove01;
parent;
select -r xtra_toShow01;
select -tgl xtra_toHide01;
select -tgl extraNodes01;
parent;
select -r globalMove01;
select -tgl model01;
select -tgl blendShapes01;
select -tgl extraNodes01;
select -tgl charNode01;
parent;
select -cl;
}
proc sc_hypershader_gui()
{
string $selection[] = (`ls -selection`);
if (`window -exists "sc_hyper"`) deleteUI "sc_hyper";
window -w 150 -h 300 -t "Hyper shade tools" -maximizeButton false -minimizeButton true sc_hyper;
columnLayout;
button -l "Clear Graph" -w 150 -c "sc_hyperClear";
separator -style "double" -w 150;
button -l "Add Selected" -w 150 -c "sc_hyperAdd";
separator -style "double" -w 150;
button -l "Remove Selected" -w 150 -c "sc_hyperRemove";
separator -style "double" -w 150;
showWindow "sc_hyper";
HypershadeWindow;
hyperShadePanelMenuCommand("hyperShadePanel1", "toggleRenderCreateBar");
hyperShadePanelMenuCommand("hyperShadePanel1", "showBottomTabsOnly");
}
proc sc_hyperClear()
{
hyperShadePanelGraphCommand("hyperShadePanel1", "clearGraph");
}
proc sc_hyperAdd()
{
hyperShadePanelGraphCommand("hyperShadePanel1", "addSelected");
}
proc sc_hyperRemove()
{
hyperShadePanelGraphCommand("hyperShadePanel1", "removeSelected");
}
sc_gui()

Friday, 10 December 2010

An Endless Rig

So now with both feet's roll complete;

I began working on the controls for the foot;


Then cleaned up the attribute editor by locking and hidding some options;

Thursday, 9 December 2010

Rig country

Today I'll primarily be working on setting up the foot roll structure, and looking at creating a joint curve tool.

So I started with creating some new joints;


Next I roughly aligned the new joints to the main foot joints by holding v and snaping the new joints along x;


Then  to make things easier, I wrote a little script to select hierachies easier;

proc sc_hi()

{
      select -hi;
}
sc_hi()

and added it as a shelf button, building up quite a nice little collection of scripts here, hierachy selection, rename, locator creation, local rotation axes display, and the node script (need to add that one back).



After finding out that the foot was twisted out slightly and the joints need realigning and zero'ing back out, I continued forward and renamed the revers lock joints;


Then I needed to mirror them over for the other leg and check the alignment was correct;


Now I need to setup the rev. lock so its functional in the foot roll;

all that needs doing is constraining the rev. lock and parenting the locators, essentially, the locators are orientated and constrained too there respective counter part (one for each the ankle and ball joint) on the main driver skeleton, then the rev. lock joints are parented to the locators, so the locators are directly connected to the rev. lock but not the driver skeleton, there just a reference for the driver, the locators are also point constrained to the IK so it can alter the rev. lock joint section. complicated. but heres my outliner with it all done on the left foot;


Heel pivot;


Ball roll;


Side roll;


And finally a toe pivot;



Thats the toe joints pretty much sorted, I just need to do the same for the right foot then its onwards and upwards.

Got slightly distracted and put all my currently used scripts all into one conveniant window;


SAUCE;

proc sc_gui()
{
string $selection[] = (`ls -selection`);
if (`window -exists "sc_gui"`) deleteUI "sc_gui";
window -w 150 -h 300 -t "My Tool Set" -maximizeButton false -minimizeButton false sc_gui;
print "Selected: ";
print ($selection);
columnLayout;
button -l "Select Hierachy" -w 150 -c "sc_hi";
separator -style "double" -w 150;
button -l "Create Locator" -w 150 -c "sc_locator";
separator -style "double" -w 150;
button -l "Toggle Rotation Axes" -w 150 -c "sc_axes";
separator -style "double" -w 150;
button -l "Rename Selected" -w 150 -c "sc_Rename";
separator -style "double" -w 150;
button -label "Convention" -w 150 -command "sc_Convention";
separator -style "double" -w 150;
button -label "Create Box Curve" -w 150 -command "sc_curveBox";
separator -style "double" -w 150;
button -label "Create Joint Curve" -w 150 -command "sc_curveJoint";
separator -style "double" -w 150;
button -label "Character Nodes" -w 150 -command "sc_grpNodes";
showWindow "sc_gui";
}
proc sc_Convention()
{
if (`window -exists "sc_Convention"`) deleteUI "sc_Convention";
window -w 150 -h 300 -t "GUI" -maximizeButton false -minimizeButton false sc_Convention;
columnLayout -adj 1;
text -w 150 -al "left" -fn "boldLabelFont" -l "Prefix";
textField -width 150 sc_preffix;
text -w 150 -al "left" -fn "boldLabelFont" -l "Sufix";
textField -width 150 -text `date -format "DDMMYY"` sc_suffix;
button -l "Apply" -w 150 -c "sc_Convention_win";
showWindow "sc_Convention";
}
proc sc_Convention_win()
{
string $marker = "nc_";
string $prefix = `textField -q -text sc_preffix`;
string $sufix = `textField -q -text sc_suffix`;
string $selection[] = (`ls -selection`);
if (size($prefix) == 0 || size($prefix) < 1 )
{
print "\nNo Prefix defined\n";
}
else
{
print "\nPREFIX: ";
print ($prefix + "\n");
}
if (size($selection) == 0 || size($selection) < 1 )
{
print "No Objest selected\n";
}
else
{
for ($items in $selection)
{
print ($items + "\n");
string $matches = (`match $marker $items`);
print ($matches + "\n");
if ( $matches == $marker)
{
print "false \n ";
}
else
{
rename $items ("nc_" + $prefix + "_" + $items + "_" + $sufix);
}
}
}
string $selection[] = (`ls -selection`);
print "Selected:\n";
print $selection "\n";
}
proc sc_Rename()
{
if (`window -exists "rnm_win"`) deleteUI "rnm_win";
window -w 600 -h 300 -t "Rename" -maximizeButton false -minimizeButton false rnm_win;
columnLayout -adj 1;
string $sel[] = `ls -sl`;
for ($each in $sel)
{
nameField -o $each;
}
showWindow rnm_win;
}
proc sc_locator()
{
string $locator[] = `spaceLocator`;
string $Rename = `rename $locator "loc"`;
}
proc sc_hi()
{
select -hi;
}
proc sc_axes()
{
ToggleLocalRotationAxes;
}
proc sc_curveBox()
{
string $curveLoc[] = `spaceLocator`;
string $nameLocator = `rename $curveLoc "curveLoc"`;
string $boxCurve = `curve -d 1 -p -4.810877 4.810877 4.810877 -p 4.810877 4.810877 4.810877 -p 4.810877 4.810877 -4.810877 -p -4.810877 4.810877 -4.810877 -p -4.810877 4.810877 4.810877 -p -4.810877 -4.810877 4.810877 -p 4.810877 -4.810877 4.810877 -p 4.810877 -4.810877 -4.810877 -p 4.810877 4.810877 -4.810877 -p 4.810877 4.810877 4.810877 -p 4.810877 -4.810877 4.810877 -p 4.810877 -4.810877 -4.810877 -p -4.810877 -4.810877 -4.810877 -p -4.810877 4.810877 -4.810877 -p -4.810877 -4.810877 -4.810877 -p -4.810877 -4.810877 4.810877 -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` ;
select $boxCurve;
string $RenameCurve = `rename $boxCurve "boxCurve01"`;
}
proc sc_curveJoint()
{
string $circleCurve1[] = `circle -c 0 0 0 -nr 0 1 0 -sw 360 -r 1 -d 3 -ut 0 -tol 0.01 -s 8 -ch 1`;
string $circleCurve2[] = `circle -c 0 0 0 -nr 0 1 0 -sw 360 -r 1 -d 3 -ut 0 -tol 0.01 -s 8 -ch 1`;
string $circleCurve3[] = `circle -c 0 0 0 -nr 0 1 0 -sw 360 -r 1 -d 3 -ut 0 -tol 0.01 -s 8 -ch 1`;
rotate -r -os 90 0 0 $circleCurve2[0];
rotate -r -os 0 0 90 $circleCurve3[0];
select $circleCurve2[0];
select -add $circleCurve3[0];
makeIdentity -apply 1 -t 1 -r 1 -s 1;
string $relativeCurve2[] = `listRelatives -shapes $circleCurve2[0]`;
string $relativeCurve3[] = `listRelatives -shapes $circleCurve3[0]`;
parent -r -s $relativeCurve2[0] $circleCurve1[0];
parent -r -shape $relativeCurve3[0] $circleCurve1[0];
select $circleCurve2[0];
select -add $circleCurve3[0];
doDelete;
string $RenameCurve = `rename $circleCurve1[0] "jointCurve01"`;
select $RenameCurve;
}
proc sc_grpNodes()
{
group -em -w -n charNode01;
group -em -w -n globalMove01;
group -em -w -n joints01;
group -em -w -n iks01;
group -em -w -n controlObjects01;
group -em -w -n to_transform01;
group -em -w -n trns_toShow01;
group -em -w -n trns_toHide01;
group -em -w -n model01;
group -em -w -n blendShapes01;
group -em -w -n extraNodes01;
group -em -w -n xtra_toShow01;
group -em -w -n xtra_toHide01;
setAttr -lock true -keyable false -channelBox false "xtra_toHide01.tx";
setAttr -lock true -keyable false -channelBox false "charNode01.tx";
setAttr -lock true -keyable false -channelBox false "joints01.tx";
setAttr -lock true -keyable false -channelBox false "iks01.tx";
setAttr -lock true -keyable false -channelBox false "controlObjects01.tx";
setAttr -lock true -keyable false -channelBox false "to_transform01.tx";
setAttr -lock true -keyable false -channelBox false "trns_toShow01.tx";
setAttr -lock true -keyable false -channelBox false "trns_toHide01.tx";
setAttr -lock true -keyable false -channelBox false "model01.tx";
setAttr -lock true -keyable false -channelBox false "blendShapes01.tx";
setAttr -lock true -keyable false -channelBox false "extraNodes01.tx";
setAttr -lock true -keyable false -channelBox false "xtra_toShow01.tx";
setAttr -lock true -keyable false -channelBox false "xtra_toHide01.ty";
setAttr -lock true -keyable false -channelBox false "charNode01.ty";
setAttr -lock true -keyable false -channelBox false "joints01.ty";
setAttr -lock true -keyable false -channelBox false "iks01.ty";
setAttr -lock true -keyable false -channelBox false "controlObjects01.ty";
setAttr -lock true -keyable false -channelBox false "to_transform01.ty";
setAttr -lock true -keyable false -channelBox false "trns_toShow01.ty";
setAttr -lock true -keyable false -channelBox false "trns_toHide01.ty";
setAttr -lock true -keyable false -channelBox false "model01.ty";
setAttr -lock true -keyable false -channelBox false "blendShapes01.ty";
setAttr -lock true -keyable false -channelBox false "extraNodes01.ty";
setAttr -lock true -keyable false -channelBox false "xtra_toShow01.ty";
setAttr -lock true -keyable false -channelBox false "xtra_toHide01.tz";
setAttr -lock true -keyable false -channelBox false "charNode01.tz";
setAttr -lock true -keyable false -channelBox false "joints01.tz";
setAttr -lock true -keyable false -channelBox false "iks01.tz";
setAttr -lock true -keyable false -channelBox false "controlObjects01.tz";
setAttr -lock true -keyable false -channelBox false "to_transform01.tz";
setAttr -lock true -keyable false -channelBox false "trns_toShow01.tz";
setAttr -lock true -keyable false -channelBox false "trns_toHide01.tz";
setAttr -lock true -keyable false -channelBox false "model01.tz";
setAttr -lock true -keyable false -channelBox false "blendShapes01.tz";
setAttr -lock true -keyable false -channelBox false "extraNodes01.tz";
setAttr -lock true -keyable false -channelBox false "xtra_toShow01.tz";
setAttr -lock true -keyable false -channelBox false "xtra_toHide01.rx";
setAttr -lock true -keyable false -channelBox false "charNode01.rx";
setAttr -lock true -keyable false -channelBox false "joints01.rx";
setAttr -lock true -keyable false -channelBox false "iks01.rx";
setAttr -lock true -keyable false -channelBox false "controlObjects01.rx";
setAttr -lock true -keyable false -channelBox false "to_transform01.rx";
setAttr -lock true -keyable false -channelBox false "trns_toShow01.rx";
setAttr -lock true -keyable false -channelBox false "trns_toHide01.rx";
setAttr -lock true -keyable false -channelBox false "model01.rx";
setAttr -lock true -keyable false -channelBox false "blendShapes01.rx";
setAttr -lock true -keyable false -channelBox false "extraNodes01.rx";
setAttr -lock true -keyable false -channelBox false "xtra_toShow01.rx";
setAttr -lock true -keyable false -channelBox false "xtra_toHide01.ry";
setAttr -lock true -keyable false -channelBox false "charNode01.ry";
setAttr -lock true -keyable false -channelBox false "joints01.ry";
setAttr -lock true -keyable false -channelBox false "iks01.ry";
setAttr -lock true -keyable false -channelBox false "controlObjects01.ry";
setAttr -lock true -keyable false -channelBox false "to_transform01.ry";
setAttr -lock true -keyable false -channelBox false "trns_toShow01.ry";
setAttr -lock true -keyable false -channelBox false "trns_toHide01.ry";
setAttr -lock true -keyable false -channelBox false "model01.ry";
setAttr -lock true -keyable false -channelBox false "blendShapes01.ry";
setAttr -lock true -keyable false -channelBox false "extraNodes01.ry";
setAttr -lock true -keyable false -channelBox false "xtra_toShow01.ry";
setAttr -lock true -keyable false -channelBox false "xtra_toHide01.rz";
setAttr -lock true -keyable false -channelBox false "charNode01.rz";
setAttr -lock true -keyable false -channelBox false "joints01.rz";
setAttr -lock true -keyable false -channelBox false "iks01.rz";
setAttr -lock true -keyable false -channelBox false "controlObjects01.rz";
setAttr -lock true -keyable false -channelBox false "to_transform01.rz";
setAttr -lock true -keyable false -channelBox false "trns_toShow01.rz";
setAttr -lock true -keyable false -channelBox false "trns_toHide01.rz";
setAttr -lock true -keyable false -channelBox false "model01.rz";
setAttr -lock true -keyable false -channelBox false "blendShapes01.rz";
setAttr -lock true -keyable false -channelBox false "extraNodes01.rz";
setAttr -lock true -keyable false -channelBox false "xtra_toShow01.rz";
setAttr -lock true -keyable false -channelBox false "xtra_toHide01.sx";
setAttr -lock true -keyable false -channelBox false "charNode01.sx";
setAttr -lock true -keyable false -channelBox false "joints01.sx";
setAttr -lock true -keyable false -channelBox false "iks01.sx";
setAttr -lock true -keyable false -channelBox false "controlObjects01.sx";
setAttr -lock true -keyable false -channelBox false "to_transform01.sx";
setAttr -lock true -keyable false -channelBox false "trns_toShow01.sx";
setAttr -lock true -keyable false -channelBox false "trns_toHide01.sx";
setAttr -lock true -keyable false -channelBox false "model01.sx";
setAttr -lock true -keyable false -channelBox false "blendShapes01.sx";
setAttr -lock true -keyable false -channelBox false "extraNodes01.sx";
setAttr -lock true -keyable false -channelBox false "xtra_toShow01.sx";
setAttr -lock true -keyable false -channelBox false "xtra_toHide01.sy";
setAttr -lock true -keyable false -channelBox false "charNode01.sy";
setAttr -lock true -keyable false -channelBox false "joints01.sy";
setAttr -lock true -keyable false -channelBox false "iks01.sy";
setAttr -lock true -keyable false -channelBox false "controlObjects01.sy";
setAttr -lock true -keyable false -channelBox false "to_transform01.sy";
setAttr -lock true -keyable false -channelBox false "trns_toShow01.sy";
setAttr -lock true -keyable false -channelBox false "trns_toHide01.sy";
setAttr -lock true -keyable false -channelBox false "model01.sy";
setAttr -lock true -keyable false -channelBox false "blendShapes01.sy";
setAttr -lock true -keyable false -channelBox false "extraNodes01.sy";
setAttr -lock true -keyable false -channelBox false "xtra_toShow01.sy";
setAttr -lock true -keyable false -channelBox false "xtra_toHide01.sz";
setAttr -lock true -keyable false -channelBox false "charNode01.sz";
setAttr -lock true -keyable false -channelBox false "joints01.sz";
setAttr -lock true -keyable false -channelBox false "iks01.sz";
setAttr -lock true -keyable false -channelBox false "controlObjects01.sz";
setAttr -lock true -keyable false -channelBox false "to_transform01.sz";
setAttr -lock true -keyable false -channelBox false "trns_toShow01.sz";
setAttr -lock true -keyable false -channelBox false "trns_toHide01.sz";
setAttr -lock true -keyable false -channelBox false "model01.sz";
setAttr -lock true -keyable false -channelBox false "blendShapes01.sz";
setAttr -lock true -keyable false -channelBox false "extraNodes01.sz";
setAttr -lock true -keyable false -channelBox false "xtra_toShow01.sz";
setAttr -lock true -keyable false -channelBox false "globalMove01.visibility";
select -r trns_toShow01;
select -tgl trns_toHide01;
select -tgl to_transform01;
parent;
select -r joints01;
select -tgl iks01;
select -tgl controlObjects01;
select -tgl to_transform01;
select -tgl globalMove01;
parent;
select -r xtra_toShow01;
select -tgl xtra_toHide01;
select -tgl extraNodes01;
parent;
select -r globalMove01;
select -tgl model01;
select -tgl blendShapes01;
select -tgl extraNodes01;
select -tgl charNode01;
parent;
select -cl;
}

sc_gui()

Tuesday, 7 December 2010

The rig went down to Georgia

Today I shall continue building the rig, most of the prep work has been complete, so I'll start to build this today, and hopefully have something to show for it at the end of the day, I'll start with the left leg joint.

havent been ontop of updating this but have been grabing screenshots as I go, so 2 days late without further ado;


last time I got upto having everything set up to start the joint and skeleton;


So the first thing to do is add in some joints being careful to position them correctly or atleast as correct as can be managed.


Next I started to work on the joint orientation and zeroing them out;


Un parent the joints before orientating them,


correctly orientated joints ready for reparenting;


Re-parented joints with correct orientation;


Next rename them using that script I worked so hard on =D so much easier now, didnt use the convetion just the rename section, i'll add in the convention all in one go when the rigs complete.


Time to add in the IK handle


Mirror the left leg over to the right;


And boom both leg joints all working and assembled;

Friday, 3 December 2010

BAPS TIME!

I cant deny how forward I've been looking to getting stuck into this job and start to look more in depth at rigging a character and actually doing a live one, alot of this will more than likely be a trial by fire, with alot of debugging, and even more staring at lines of code, with paper everywhere and gallons of coffee consumed. Yes this is my idea of a fun time, and with that, lets begin.

The basics;

The basic setup will be essential to making a flexable rig, not just in the rig itself but also the file structure and how its all layed out, so I need to create some files and folders, to do this I'll set a new project and create a blank scene with nothing in it, called, "hunter_rig_02_12_10_0001" [this was the naming convention already used by the group] make sure we save this as an ascii file type, with all that done it should look like this;



Next I need to create a reference for the rig scene, I'll be using "Simon_hunter_25_11_10_0001" [I'll be changing that capitalisation on "Simon" at some point], doing it this way allows for high/low poly models and updated models to be switched out without too much work needed to be done, and I'll doing this in that blank scene;



With that done, the next step will be to edit these to be a little more flexable, considering that the aim of the game is ease of use, I'd like a file system that can be moved easily without any complications, so we open up the blank scene in crimson and aslong as its that ascii file type it shouldnt be a problem, and we edit the referenced file directory to be a little more intuative [props go to georg for showing me this] changing the directorys from c:/blah/blah/blah/file.ma to .//blah/file.ma;

And finally I'll open up the character model file, and apply some pruning and organisation selecting the character mesh and grouping it, then deleting everything that isnt in that group;

So now it's time to merge the files more intricatly, firstly I'll run a simple node script that sets up nodes and there attributes, ;


The script is pretty simple creating nodes for the different parts joints, ik's etc.



After this has been run the outliner will look like this;


And then to parent the model node into the script generated node;


And now for the rest of the day I shall be tackling my previously posted rename script, why? whats the point? in short I'm going to need it to rename the bones and other such things.

While it works as intended, it needs added functionality, it currently adds a prefix and suffix to the selected objects but I want to take it to the next step, and be able to change the actual name of objects, I've drawn up a rough design for what it will look like;


 the left hand box is as it is currently coded, on the left is the added section, I'm unsure if I want this to be apart of the same window or not, I will probably add in a button that brings it up, and if I do that, I will also have one for the prefix and sufix.

So I have a rough idea of what i'm aiming for, now to produce some test code;


I've added in a new procedure to the bottom of the current code and named it adv for the time being, this section will contain the code for the new window like so;

Here we have the basic implementation of the whole concept, it woks and is functional, but there is an issue with the coding, its in two seperate parts at the moment, and I want them as one so it runs automatically, the code itself is fairly simple;

proc sc_adv()
{
string $rnm_win = `window -t "Rename"`;
columnLayout -adj 1;
string $sel[] = `ls -sl`;
for ($each in $sel)
{
nameField -o $each;
}
showWindow $rnm_win;
}
sc_adv()

 It simply creates a window and adds a new text field for each object selected, I will need to bolt in an update selection feature to complete this side of the script, which off the top of my head will be somthing like "button -l "update" -c newproc;"
where new proc is I shall be shifting the for loop into a different proc and replacing it with the above button command.

And one heache later we have this;

and the code;

proc sc_gui()
{
    string $selection[] = (`ls -selection`);  
    if (`window -exists "sc_gui"`) deleteUI "sc_gui";
        window -w 150 -h 300 -t "GUI" -maximizeButton false -minimizeButton false sc_gui;            
        print "Selected: ";            
        print ($selection);         
            columnLayout;
                text -w 150 -al "left" -fn "boldLabelFont" -l "Prefix";
                textField -width 150 sc_preffix;
                text -w 150 -al "left" -fn "boldLabelFont" -l "Sufix";
                textField -width 150 -text `date -format "DDMMYY"` sc_suffix;
                button -label "Convention" -w 150 -command "sc_fix";
                separator -style "double" -w 150;
                       button -l "Rename" -w 150 -c "sc_rnm_win";
        showWindow "sc_gui";
}
proc sc_fix()
{
    string $marker = "nc_";
    string $prefix = `textField -q -text sc_preffix`;
    string $sufix = `textField -q -text sc_suffix`;   
    string $selection[] = (`ls -selection`);
    if (size($prefix) == 0 ||  size($prefix) < 1 )
        {
            print "\nNo Prefix defined\n";
        }
    else
        {
            print "\nPREFIX: ";
            print ($prefix + "\n");
        }
        if (size($selection) == 0 ||  size($selection) < 1 )
        {       
        print "No Objest selected\n";
        }
    else
        {  
        for ($items in $selection)
            {
                print ($items + "\n");
                string $matches = (`match $marker $items`);
                print ($matches + "\n");
                if ( $matches == $marker)
                    {
                     print "false \n ";
                    }
                else
                    {
                    //***********add the selected names to a seperate node***********
                    rename $items ("nc_" + $prefix + "_" + $items + "_" + $sufix);
                    //***********add the changed names to a seperate node***********
                    }
            }
        }
    string $selection[] = (`ls -selection`);
            print "Selected:\n";
            print $selection "\n";
}
proc sc_rnm_win()
{
    if (`window -exists "rnm_win"`) deleteUI "rnm_win";
        window -w 600 -h 300 -t "Rename" -maximizeButton false -minimizeButton false rnm_win;
    columnLayout -adj 1;
    string $sel[] = `ls -sl`;
    for ($each in $sel)
        {
            nameField -o $each;
        }
showWindow rnm_win;
}

sc_gui()


There are some things that need changing, but for the most part this works and is easier than the default way of renaming stuff, so I think its a success, I also previously posted this with a edit at the end about the proc()'s not working, this has been addressed and fix'd.


In between all that I drew up a quick front view of where the main joints on the rig are going or likely to be;


just need to do a side view, and add in the bones, but thats view is pretty much where I'm going to place them.
And with that I'm done for the day.


Wednesday, 3 November 2010

Update Time - This is how we MEL it.

This past week-ish I've been learning MEL scripting

I decided to write a naming script, firstly I had to outline the features and limitations of the script

i.e. what did it name
did it rename the whole object
how did it know what to call the objects

Next I identified the validation NEEDed [users are dumb and break things], the main body of validation would be in the actual naming section, the script will check for any previous naming applied. Secondary validation would be in the prefix and sufix default values applied if nothing is present in the user fields.

After I had a rough idea of what I wanted it to do I could start to piece together the different sections starting with a GUI window, [a good way to instantly feel like you've accomplished something is to make a window] and piece by piece I wrote this [with help from georg]:

Tuesday, 19 October 2010

Finished walkcycle

The walk cycle is finished to an extent, im happy with the fixes since the first version, although some errors still lingure, but overall I am happy with it.

video

Monday, 18 October 2010

My walk cycle: Updated

Updated version of the walk cycle, some major fixes, most notably in the arms and the sway, overlaped the swing in the arms to better match natural motion, and added a left and right sway to help add weight, some minor improvments are, a change to expression on face, and more emphasis on the hand animation, I also decided to hold the hand pose for considerably longer to help put the mood accross, I also fixed the foot problem from before, tweeked the spine rotation on the down pose's to ephasis the weight better.

 The video;

video

Some fixes are needed, spline editing the knees so theres a better phase in/out, theres alot of pop in the knees as it moves into the down pose, generally the remains tweeks will be spline tweeks.