proc sc_pRiggerCreate()
//proc for the initial creation of the rig, taking the UI and implementing, shape is set at square.
{
//counter is based upon, the UI field "numOfEmits" where the user decideds how many to rig.
int $counter = (`textFieldGrp -q -tx numOfEmits`);
//not sure if this int is needed.
int $cubeSubCounter = $counter + 1;
//if the input contained in the $counter var. is greater than 0 then create the root,
//rename it, contain it and move it to the 0 0 0 coord's and perform the while loop.
if ($counter>0)
{
polyCube -n "pRigRoot";
move -r -os -wd 0 0 0 ;
string $pRigRoot[] = `ls -sl`;
int $vertCount = $counter;
spaceLocator -n "locGrouper";
group -n pSet "locGrouper";
string $pSet[] = `ls -sl`;
print $pSet;
select -cl;
select locGrouper;
delete "locGrouper";
int $pRigRootCheck = `objExists "root"`;
//if the root group exists then move the new root to the group.
if($pRigRootCheck == 0)
{
spaceLocator -n "locGrouper";
select -cl;
group -n "root" "locGrouper";
delete "locGrouper";
}
// while the counter is greater than 0, create a locator, emitter, and particals,
//linking the partical to the emitter, and containing each in a var.
//lastly subtracting 1 from the counter
while ($counter>0)
{
//locator creation
spaceLocator;
rename pRigLoc;
scale -r 1 1 1;
string $pRigLoc[] = (`ls -sl`);
//emitter creation
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 ;
string $pRigEmit[] = (`ls -sl`);
//partical creation
particle;
rename pRigPart;
string $pRigPart[] = (`ls -sl`);
//dynamic connection for the emiter and partical
connectDynamic -em $pRigEmit $pRigPart;
//parent constraints for the loc, emit, part and all parented to the root.
select $pRigLoc;
select -add $pRigEmit;
parentConstraint -mo -weight 1;
select -r $pRigEmit;
select $pRigLoc;
select -add $pRigPart;
parentConstraint -mo -weight 1;
select $pRigRoot;
select -add $pRigLoc;
doCreateParentConstraintArgList 1 { "1","0","0","0","0","0","0","1","","1" };
parentConstraint -mo -weight 1;
parent $pRigEmit $pRigLoc;
parent $pRigPart $pRigLoc;
parent $pRigLoc $pSet;
//counter for the while loop
$counter = ($counter-1);
}
//parents the final pieces of the hierachy to the root.
parent $pRigRoot $pSet;
parent $pSet "root";
}
}
sc_pRiggerCreate()