Tuesday, 5 April 2011

Backup :~

int $i;
// the starting TreeType1Proxy
int $treeNum = 103;
for($i=1; $i<=1035; ++$i)
{
// create a new locator and point constraint it to a PlaceholderTree.
spaceLocator -p 0 0 0;
eval("select -r PlaceholderTree" + $i);
eval select -add locator1;
doCreatePointConstraintArgList 1 { "0","0","0","0","0","0","0","1","","1" };
pointConstraint -offset 0 0 0 -weight 1;
// get the x, y, z coords for the locator. Set these to proxyTx, proxyTy and proxyTz variables.
float $proxyTx = eval("getAttr locator1.tx");
float $proxyTy = eval("getAttr locator1.ty");
float $proxyTz = eval("getAttr locator1.tz");
// generate a "random" number for use as the y axis rotation for the new tree
float $randomRot = rand(0 - 360);
// duplicate the last tree
eval("duplicate TreeType1Proxy__" + $treeNum);
// increment treeNum to the duplicated tree
++$treeNum;
// select the new tree and then move this to the position of the locator and rotate the in the y axis
eval("select TreeType1Proxy__" + $treeNum);
move $proxyTx $proxyTy $proxyTz;
rotate -p 0 $randomRot 0;
// delete the locator
delete locator1;
}


int $a;
int $i = 1;
for($a=1; $a<=21; ++$a)
{
select -r EnvGroundTarget EnvGroundFlat ;
blendShape -frontOfChain;
int $j;
eval("select -r PlaceholderTree" + $i);
++$i;
for($j=1; $j<=49; ++$j)
{
eval("select -tgl PlaceholderTree" + $i);
++$i;
}
select -tgl EnvGroundFlat;
CreateWrap;
setAttr "blendShape1.EnvGroundTarget" 1;
DeleteHistory;
setAttr "blendShape1.EnvGroundTarget" 0;

DeleteAllHistory;
file -force -save -options "v=0";
}
quit()

No comments:

Post a Comment