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()

No comments:

Post a Comment