Wednesday 18 May 2011

soFar;

For the most part this works, the "set" button which sets a new position for emitters only works if one pSet is present in a scene, thats an issue im trying to sort out, the emitter panal needs some formating and tidying up, but it works and will hopefully help me correct the set button issue.

Friday 13 May 2011

pRigger - procedure pRiggerCreate

Finished my first alpha procedure for the partical rigger, in short what it does when placed in the master script, is create locators, emitters and particals along with a root control for the rig, which it then parents them all up every creation cycle (cc).

emitters & particals >>>> locators >>>> rootControl >>>> pSet(group)>>>>root(group)

only one "pSet" and "rootControl" is created per cc and only one "root" is created per scene but the number of emitters attached to to a rootControl is currently unlimited.
Some minor tweaks need to the code itself, mostly renaming variables and such, formating and ive probably missed a couple of random variables that need deleting, its only an alpha code at the moment so it shouldnt matter too much, enjoy;
 

Thursday 5 May 2011

here brian

proc sc_pRigger_GUI()
{
if (`window -exists "sc_pRig_gui"`) deleteUI "sc_pRig_gui";
window -w 150 -h 300 -t "pRigger" -maximizeButton false -minimizeButton false sc_pRig_gui;
string $layout = `formLayout`;
string $layoutTabs = `tabLayout -innerMarginWidth 5 -innerMarginHeight 5`;
formLayout -edit
-attachForm $layoutTabs "top" 0
-attachForm $layoutTabs"left" 0
-attachForm $layoutTabs "bottom" 0
-attachForm $layoutTabs "right" 0
$layout;
string $base = `rowColumnLayout -numberOfColumns 3
-columnWidth 1 5
-columnWidth 2 200
-columnWidth 3 5`;
button -vis 0;
textFieldGrp -l "Number of Emitters: " -cw2 100 100 -tx 1 numOfEmits;
button -vis 0;
button -vis 0;
textFieldGrp -l "Rig Type: " -cw2 100 100 rigType;
button -vis 0;
button -vis 0;
button -l "Create" -c sc_pRigger_cube;
button -vis 0;
setParent..;
string $geo = `rowColumnLayout -numberOfColumns 5`;
setParent..;
string $forces = `rowColumnLayout -numberOfColumns 5`;
setParent..;
tabLayout -edit
-tabLabel $base "Emitters" -tabLabel $geo "Geometry" -tabLabel $forces "Forces" $layoutTabs;
showWindow sc_pRig_gui;
}
proc sc_pRigger_cube()
{
int $counter = (`textFieldGrp -q -tx numOfEmits`);
print ("numberOfEmitters:" + " " + $counter + "\n");
int $cubeSubCounter = $counter + 1;
print ("subDivisions:" + " " + $cubeSubCounter + "\n");
if ($counter>0)
{
polyCube -sy $cubeSubCounter -sx 2;
rename pRigCube;
move -r -os -wd 0 0.5 0 ;
int $vertCount = $counter;
while ($counter>0)
{
$vertCount = (($counter - 1)*3+13);
//this now equals the assumption that there is atleast one emitter being rigged.
emitter -pos 0 0 0 -type omni -r 100 -sro 0 -nuv 0 -cye none -cyi 1 -spd 1 -srn 0 -nsp 1 -tsp 0 -mxd
0 -mnd 0 -dx 1 -dy 0 -dz 0 -sp 0 ;
rename pRigEmit;
move -r -os -wd 0 0 -0.5 ;
string $pRigEmit[] = (`ls -sl`);
//creates renames moves and contains the emitter in a variable.
particle;
rename pRigPart;
string $pRigPart[] = (`ls -sl`);
connectDynamic -em $pRigEmit $pRigPart;
//creates renames moves and contains and links the emitter to the emitter whilst containing the partical in a variable.
$counter = ($counter-1);
//deducts the values for the while loop, prevents infinite loops.
print ("startingVert:" + " " + $vertCount + "\n");
}
}
}
sc_pRigger_GUI()

Wednesday 4 May 2011

script dump

proc sc_pRigger_GUI()
{
if (`window -exists "sc_pRig_gui"`) deleteUI "sc_pRig_gui";
window -w 150 -h 300 -t "Locator Randomiser" -maximizeButton false -minimizeButton false sc_pRig_gui;
string $layout = `formLayout`;
string $layoutTabs = `tabLayout -innerMarginWidth 5 -innerMarginHeight 5`;
formLayout -edit
    -attachForm $layoutTabs "top"    0
     -attachForm $layoutTabs"left"   0
     -attachForm $layoutTabs "bottom" 0
     -attachForm $layoutTabs "right"  0
     $layout;


string $base = `rowColumnLayout -numberOfColumns 3
                -columnWidth 1 5
                -columnWidth 2 200
                -columnWidth 3 5`;
button -vis 0;
textFieldGrp -l "Number of Emitters: " -cw2 100 100 -tx 1 numOfEmits;
button -vis 0;

button -vis 0;
textFieldGrp -l "Rig Type: " -cw2 100 100 rigType;
button -vis 0;

button -vis 0;
button -l "Create" -c sc_pRigger_cube;
button -vis 0;

setParent..;

string $geo = `rowColumnLayout -numberOfColumns 5`;

setParent..;

string $forces = `rowColumnLayout -numberOfColumns 5`;

setParent..;

tabLayout -edit
          -tabLabel $base "Emitters" -tabLabel $geo "Geometry" -tabLabel $forces "Forces" $layoutTabs;


showWindow sc_pRig_gui;
}


proc sc_pRigger_cube()

{
int $counter = (`textFieldGrp -q -tx numOfEmits`);

    if ($counter>0)
    {
    polyCube -sx $counter;
    rename pRigCube;

    emitter -pos 0 0 0 -type omni -r 100 -sro 0 -nuv 0 -cye none -cyi 1 -spd 1 -srn 0 -nsp 1 -tsp 0 -mxd 0 -mnd 0 -dx 1 -dy 0 -dz 0 -sp 0 ;
        rename pRigEmit;
        particle;
        rename pRigPart;


    }
}
sc_pRigger_GUI()

Sunday 3 April 2011

why so FK?

quick shot of what an fkik joint should look like in the hyper shader once everything is hooked up, this is only one joint, for each corosponding joint the same thing should be applied, all the connections should be labeled in the picture. fairly simple concept combined with some shared attr's it becomes a simple yet effective feature of any rig.

Wednesday 16 March 2011

Partical Rig

So for the post production brief, our groups project is a space invaders theme, and the way we are generating our space invaders is through geometry instancing in the partical systems, this is one of my jobs, and so as a rigger I set about setting up a partical rig and an easier way of manipulating them, its fairly simple, you manipulate the gridReference box to effect the way the particals behave in space, scale it up to make them spread out, or scale it down to condense them, for the most part it works a charm, the only issue so far is the translate aspect, as its done in world space it produces weird results when moving the main box, but this has given me an idea, sometime in the future I'll be designing a partical rigging system, a way to manage multiple partical systems in different ways. heres a video;

Monday 28 February 2011

Winrar just finished the min max UI its all now based around variables the user has input and has fully broken away from hard coded values, those values are still coded but now they are defaults for the UI as apposed to the only value usable, the break away from hard code to a fully UI orientated script probably means this is now in beta, but I wont class it as such, until I've created an origin lock on each axis, which in theory will be pretty straight forward but may require more than a few sleepless nights, by and large all the functions currently doable are finalised including the GUI theres a few minor graphical outputs i wish to implement and rearrange the GUI slightly, which i shall change before i continue on with the things i wish to include so it feels complete and easy to use. Also with code formating and the few notes included it hit over 500 lines! 


CODE;

proc sc_gui()
{
if (`window -exists "sc_gui"`) deleteUI "sc_gui";
window -w 150 -h 300 -t "Locator Randomiser" -
maximizeButton false -minimizeButton false sc_gui;
columnLayout;
string $sel[] = (`ls -sl`);
separator;
separator;
textFieldButtonGrp -label "Object:"
-text $sel
-buttonLabel "<<<"
-cw3 50 165 10
-ct3 "left" "both" "left"
-buttonCommand "sc_getObj()" selObj;
separator;
separator;
separator -style "double" -w 265;
rowColumnLayout -numberOfColumns 11
-columnWidth 1 5
-columnWidth 2 10
-columnWidth 3 5
-columnWidth 4 45
-columnWidth 5 5
-columnWidth 6 130
-columnWidth 7 5
-columnWidth 8 45
-columnWidth 9 5
-columnWidth 10 5
-columnWidth 11 5
;
button -vis 0;
button -vis 0;
button -vis 0;
button -vis 0;
button -vis 0;
text "Frame Settings";
button -vis 0;
button -vis 0;
button -vis 0;
button -vis 0;
setParent..;
rowColumnLayout -numberOfColumns 11
-columnWidth 1 5
-columnWidth 2 5
-columnWidth 3 5
-columnWidth 4 100
-columnWidth 5 5
-columnWidth 6 5
-columnWidth 7 5
-columnWidth 8 100
-columnWidth 9 5
-columnWidth 10 5
-columnWidth 11 5
;
button -vis 0;
button -vis 0;
button -vis 0;
textFieldGrp -l "Start:" -cw2 50 165 -text 1 start;
button -vis 0;
button -vis 0;
button -vis 0;
textFieldGrp -l "Min:" -cw2 50 165 -text 1 minFrame;
button -vis 0;
button -vis 0;
setParent..;
rowColumnLayout -numberOfColumns 11
-columnWidth 1 5
-columnWidth 2 5
-columnWidth 3 5
-columnWidth 4 100
-columnWidth 5 5
-columnWidth 6 5
-columnWidth 7 5
-columnWidth 8 100
-columnWidth 9 5
-columnWidth 10 5
-columnWidth 11 5
;
button -vis 0;
button -vis 0;
button -vis 0;
textFieldGrp -l "Finish:" -cw2 50 165 -text 100 finish;
button -vis 0;
button -vis 0;
button -vis 0;
textFieldGrp -l "Max:" -cw2 50 165 -text 10 maxFrame;
button -vis 0;
button -vis 0;
setParent..;
separator;
separator;
separator;
separator;separator;
separator;
separator -style "double" -w 265;
rowColumnLayout -numberOfColumns 11
-columnWidth 1 5
-columnWidth 2 10
-columnWidth 3 5
-columnWidth 4 45
-columnWidth 5 5
-columnWidth 6 130
-columnWidth 7 5
-columnWidth 8 45
-columnWidth 9 5
-columnWidth 10 5
-columnWidth 11 5
;
button -vis 0;
button -vis 0;
button -vis 0;
text "Min";
button -vis 0;
text "Movement Parameters";
button -vis 0;
text "Max";
button -vis 0;
button -vis 0;
setParent ..;
rowColumnLayout -numberOfColumns 11
-columnWidth 1 5
-columnWidth 2 10
-columnWidth 3 5
-columnWidth 4 45
-columnWidth 5 5
-columnWidth 6 130
-columnWidth 7 5
-columnWidth 8 45
-columnWidth 9 5
-columnWidth 10 5
-columnWidth 11 5
;
button -vis 0; //1
text "X:"; //2
button -vis 0; //3
textField -text -10 -aie true -ec sc_minMaxUpdateX minFltSldX;//4
button -vis 0;//5
floatSlider -min -10 -max 10 tranX;//6
button -vis 0;//7
textField -text 10 -aie true -ec sc_minMaxUpdateX maxFltSldX;//8
button -vis 0 ;//9
button -vis 0;//10
button -vis 0;//11
setParent..;
rowColumnLayout -numberOfColumns 11
-columnWidth 1 5
-columnWidth 2 10
-columnWidth 3 5
-columnWidth 4 45
-columnWidth 5 5
-columnWidth 6 130
-columnWidth 7 5
-columnWidth 8 45
-columnWidth 9 5
-columnWidth 10 5
-columnWidth 11 5
;
button -vis 0;//1
button -vis 0;//2
button -vis 0;//3
text "Random:";//4
button -vis 0;//5
checkBox -l " " randChkX;//6
button -vis 0;//7
button -vis 0;//8
button -vis 0;//9
button -vis 0;//10
button -vis 0;//11
setParent..;
separator;
separator;
separator -style "single" -w 265;
separator;
separator;
rowColumnLayout -numberOfColumns 11
-columnWidth 1 5
-columnWidth 2 10
-columnWidth 3 5
-columnWidth 4 45
-columnWidth 5 5
-columnWidth 6 130
-columnWidth 7 5
-columnWidth 8 45
-columnWidth 9 5
-columnWidth 10 5
-columnWidth 11 5
;
button -vis 0; //1
text "Y:"; //2
button -vis 0; //3
textField -text -10 -aie true -ec sc_minMaxUpdateY minFltSldY;//8//4
button -vis 0;//5
floatSlider -min -10 -max 10 tranY;//6
button -vis 0;//7
textField -text 10 -aie true -ec sc_minMaxUpdateY maxFltSldY;//8
button -vis 0 ;//9
button -vis 0;//10
button -vis 0;//11
setParent..;
rowColumnLayout -numberOfColumns 9
-columnWidth 1 5
-columnWidth 2 50
-columnWidth 3 5
-columnWidth 4 20
-columnWidth 5 45
-columnWidth 6 75
-columnWidth 7 5
-columnWidth 8 45
-columnWidth 9 5
;
button -vis 0;//1
text "Random:";//2
button -vis 0;//3
checkBox -l " Y" randChkY;//4
button -vis 0;//5
button -vis 0;//6
button -vis 0;//7
button -vis 0;//8
button -vis 0;//9
setParent..;
separator;
separator;
separator -style "single" -w 265;
separator;
separator;
rowColumnLayout -numberOfColumns 11
-columnWidth 1 5
-columnWidth 2 10
-columnWidth 3 5
-columnWidth 4 45
-columnWidth 5 5
-columnWidth 6 130
-columnWidth 7 5
-columnWidth 8 45
-columnWidth 9 5
-columnWidth 10 5
-columnWidth 11 5
;
button -vis 0; //1
text "Z:"; //2
button -vis 0; //3
textField -text -10 -aie true -ec sc_minMaxUpdateZ minFltSldZ;//4
button -vis 0;//5
floatSlider -min -10 -max 10 tranZ;//6
button -vis 0;//7
textField -text 10 -aie true -ec sc_minMaxUpdateZ maxFltSldZ;//8
button -vis 0 ;//9
button -vis 0;//10
button -vis 0;//11
setParent..;
rowColumnLayout -numberOfColumns 9
-columnWidth 1 5
-columnWidth 2 50
-columnWidth 3 5
-columnWidth 4 20
-columnWidth 5 45
-columnWidth 6 75
-columnWidth 7 5
-columnWidth 8 45
-columnWidth 9 5
;
button -vis 0;//1
text "Random:";//2
button -vis 0;//3
checkBox -l " Z" randChkZ;//4
button -vis 0;//5
button -vis 0;//6
button -vis 0;//7
button -vis 0;//8
button -vis 0;//9
setParent..;
separator;
separator;
separator -style "single" -w 265;
separator;
separator;
rowColumnLayout -numberOfColumns 3;
button -vis 0 -w 160;
button -l "Key" -c sc_frameCount;
button -vis 0;
setParent ..;
separator;
separator;
showWindow "sc_gui";
}
proc sc_getObj()
{
string $sel[] = (`ls -sl`);
string $firstObj = $sel[0];
textFieldButtonGrp -edit -text $firstObj selObj;
print $firstObj;
}
proc sc_applyMinMax()
{
int $minX = (`textField -query -text minFltSldX`);
int $maxX = (`textField -query -text maxFltSldX`);
print ($minX + "\n");
print ($maxX + "\n\n");
}
proc sc_minMaxUpdateX()
{
float $minX;
float $maxX;
$minX = (`textField -q -text minFltSldX`);
$maxX = (`textField -q -text maxFltSldX`);
floatSlider -edit -min $minX -max $maxX tranX;
}
proc sc_minMaxUpdateY()
{
float $minY;
float $maxY;
$minY = (`textField -q -text minFltSldY`);
$maxY = (`textField -q -text maxFltSldY`);
floatSlider -edit -min $minY -max $maxY tranY;
}
proc sc_minMaxUpdateZ()
{
float $minZ;
float $maxZ;
$minZ = (`textField -q -text minFltSldZ`);
$maxZ = (`textField -q -text maxFltSldZ`);
floatSlider -edit -min $minZ -max $maxZ tranZ;
}
proc sc_frameCount()
{
int $start = (`textFieldGrp -query -text start`);
int $end = (`textFieldGrp -query -text finish`);
int $min = (`textFieldGrp -query -text minFrame`);
int $max = (`textFieldGrp -query -text maxFrame`);
int $randMoveX;
int $randMoveY;
int $randMoveZ;
string $objAttrX;
string $objAttrY;
string $objAttrZ;
int $finalMoveX;
int $finalMoveY;
int $finalMoveZ;
int $objAttrGetX;
int $objAttrGetY;
int $objAttrGetZ;
string $sel[] = (`select`);
string $Ty = "ty";
int $currentFrame = $start;
for ($currentFrame > $start; $currentFrame < $end;)
{
int $randGen = rand($min,$max);
string $selObj = (`textFieldButtonGrp -query -text selObj`);
int $minFltSldX = (`textField -q -text minFltSldX`);
int $minFltSldY = (`textField -q -text minFltSldY`);
int $minFltSldZ = (`textField -q -text minFltSldZ`);
int $maxFltSldX = (`textField -q -text maxFltSldX`);
int $maxFltSldY = (`textField -q -text maxFltSldY`);
int $maxFltSldZ = (`textField -q -text maxFltSldZ`);
currentTime -edit $currentFrame;
$currentFrame = ($currentFrame + $randGen);
//~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~~~~~~~~~~~~~~X~
//~~~~~~~~~~~~~~~~~~~~~~
if (`checkBox -q -v randChkX`)
{
$randMoveX = rand($minFltSldX,$maxFltSldX);
}
else
{
$randMoveX = (`floatSlider -query -value tranX`);
}
$objAttrX = $selObj + ".translateX";
$objAttrGetX = `getAttr $objAttrX`;
$finalMoveX = ($objAttrGetX + $randMoveX);
setAttr $objAttrX $finalMoveX;
//~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~~~~~~~~~~~~~~Y~
//~~~~~~~~~~~~~~~~~~~~~~
if (`checkBox -q -v randChkY`)
{
$randMoveY = rand($minFltSldY,$maxFltSldY);
}
else
{
$randMoveY = (`floatSlider -query -value tranY`);
}
$objAttrY = $selObj + ".translateY";
$objAttrGetY = `getAttr $objAttrY`;
$finalMoveY = ($objAttrGetY + $randMoveY);
setAttr $objAttrY $finalMoveY;
//~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~~~~~~~~~~~~~~Z~
//~~~~~~~~~~~~~~~~~~~~~~
if (`checkBox -q -v randChkZ`)
{
$randMoveZ = rand($minFltSldZ,$maxFltSldZ);
}
else
{
$randMoveZ = (`floatSlider -query -value tranZ`);
}
$objAttrZ = $selObj + ".translateZ";
$objAttrGetZ = `getAttr $objAttrZ`;
$finalMoveZ = ($objAttrGetZ + $randMoveZ);
setAttr $objAttrZ $finalMoveZ;
//~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~~~~~~~~~~~~End~
//~~~~~~~~~~~~~~~~~~~~~~
setKeyframe `textFieldButtonGrp -query -text selObj`;
}
}
sc_gui()