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

1 comment:

  1. You sir are a god amongst men, thank you so much :D

    ReplyDelete