//string $shadertype = "lambert"; //string $shader = "SC1_lambert"+2; //string $shaderSG = $shader+"SG"; //string $shaderoutcolor = $shader+".color"; //string $shaderSGsS = $shaderSG+".surfaceShader"; //shadingNode -asShader $shadertype -n $shader; //sets -renderable true -noSurfaceShader true -empty -name $shaderSG; //connectAttr -f $shaderoutcolor $shaderSGsS; //setAttr $shaderoutcolor -type double3 1 0 0 ; $counter1 = 1; polyCube -d 1 -h 1 -w 1 -n boxa1; scale -r 12 12 12 boxa1; do { do { float $numa1 = `rand $counter1`; float $numa2 = rand(-1.1,1.1); float $numa3 = ($numa1 * $numa2); float $Xa1 = (3 * $numa1); float $Xa2 = (2 * $numa2); float $Xa3 = ($numa3 / 2); string $LarrPrea[] = `ls-tr "boxa*"`; select -r $LarrPrea[0]; float $depth1prea = `getAttr($LarrPrea[0]+".scaleZ")`; float $height1prea = `getAttr($LarrPrea[0]+".scaleY")`; float $width1prea = `getAttr($LarrPrea[0]+".scaleX")`; duplicate -rr; string $childa[] = `ls-sl`; float $hha = `getAttr($childa[0]+".scaleZ")`; setAttr ($childa[0]+".scaleZ") ($depth1prea+$numa2); setAttr ($childa[0]+".scaleY") ($height1prea+$numa2); setAttr ($childa[0]+".scaleZ") ($width1prea+$numa2); string $Larra[] = `ls-tr "boxa*"`; float $deptha1 = `getAttr($Larra[0]+".scaleZ")`; float $deptha2 = `getAttr($Larra[1]+".scaleZ")`; if ($deptha1 < $deptha2) { delete $Larra[1]; } else { delete $Larra[0]; } print ("Image " + $counter1); string $name = "NP_" + $counter1; setAttr defaultRenderGlobals.imageFilePrefix -type "string" $name; render -x 720 -y 480 persp; $counter1++; currentTime $counter1; } while ($counter1 <= 10); string $Abox[] = `ls-tr "boxa*"`; float $ddeptha = `getAttr($Abox[0]+".scaleZ")`; float $hheighta = `getAttr($Abox[0]+".scaleY")`; float $wwidtha = `getAttr($Abox[0]+".scaleX")`; if (4 > $ddeptha || 4 > $hheighta || 4 > $wwidtha || 16 < $ddeptha || 16 < $hheighta || 16 < $wwidtha) { select -r $Abox; //sets -e -forceElement $shaderSG; delete; string $tickerA = "no"; } else { string $tickerA = "yes"; } } while ($tickerA = "no"); string $boxFinalA[] = `ls-tr "boxa*"`; float $ddepthaFinal = `getAttr($boxFinalA[0]+".scaleZ")`; float $alta1 = ($ddepthaFinal / 2); float $alta2 = ($alta1 + 6); float $budgea = rand ($alta1, $alta2); select $boxFinalA[0]; move -r 0 0 $budgea; float $counter2 = 1; polyCube -d 1 -h 1 -w 1 -n boxb1; scale -r 5 5 5 boxb1; move -r 10 0 0; do { do { float $numb1 = `rand $counter2`; float $numb2 = rand(-1.5,1.5); float $numb3 = ($numb1 * $numb2); float $Xb1 = (3 * $numb1); float $Xb2 = (2 * $numb2); float $Xb3 = ($numb3 / 2); string $LarrPreb[] = `ls-tr "boxb*"`; select -r $LarrPreb[0]; float $width1preb = `getAttr($LarrPreb[0]+".scaleX")`; float $height1preb = `getAttr($LarrPreb[0]+".scaleY")`; float $depth1preb = `getAttr($LarrPreb[0]+".scaleZ")`; duplicate -rr; string $childb[] = `ls-sl`; float $hhb = `getAttr($childb[0]+".scaleX")`; setAttr ($childb[0]+".scaleX") ($width1preb+$numb2); setAttr ($childb[0]+".scaleY") ($height1preb+$numb2); setAttr ($childb[0]+".scaleZ") ($depth1preb+$numb2); string $Larrb[] = `ls-tr "boxb*"`; float $widthb1 = `getAttr($Larrb[0]+".scaleX")`; float $widthb2 = `getAttr($Larrb[1]+".scaleX")`; if ($widthb1 < $widthb2) { delete $Larrb[0]; } else { delete $Larrb[1]; } print ("Image " + $counter1); string $name = "NP_" + $counter1; setAttr defaultRenderGlobals.imageFilePrefix -type "string" $name; render -x 720 -y 480 persp; $counter2++; currentTime $counter2; } while ($counter2 <= 10); string $Bbox[] = `ls-tr "boxb*"`; float $ddepthb = `getAttr($Bbox[0]+".scaleZ")`; float $hheightb = `getAttr($Bbox[0]+".scaleY")`; float $wwidthb = `getAttr($Bbox[0]+".scaleX")`; if (4 > $ddepthb || 4 > $hheightb || 4 > $wwidthb || 16 < $ddepthb || 16 < $hheightb || 16 < $wwidthb) { select -tgl $Bbox; //sets -e -forceElement $shaderSG; delete; string $tickerB = "no"; } else { string $tickerB = "yes"; } } while ($tickerB = "no"); string $boxFinalB[] = `ls-tr "boxb*"`; float $ddepthbFinal = `getAttr($boxFinalB[0]+".scaleZ")`; float $altb1 = ($ddepthbFinal / 2); float $altb2 = ($altb1 + 6); float $budgeb = rand ($altb1, $altb2); select $boxFinalB[0]; move -r 0 0 $budgeb; float $counter3 = 1; polyCube -d 1 -h 1 -w 1 -n boxc1; scale -r 12 12 12 boxc1; move -r 20 0 0; do{ do { float $numc1 = `rand $counter3`; float $numc2 = rand(-1.3,1.4); float $numc3 = ($numc1 * $numc2); float $Xc1 = (3 * $numc1); float $Xc2 = (2 * $numc2); float $Xc3 = ($numc3 / 2); string $LarrPrec[] = `ls-tr "boxc*"`; select -r $LarrPrec[0]; float $height1prec = `getAttr($LarrPrec[0]+".scaleY")`; float $depth1prec = `getAttr($LarrPrec[0]+".scaleZ")`; float $width1prec = `getAttr($LarrPrec[0]+".scaleX")`; duplicate -rr; string $childc[] = `ls-sl`; float $hhc = `getAttr($childc[0]+".scaleY")`; float $hhhc = `getAttr($childc[0]+".scaleZ")`; float $hhhwc = `getAttr($childc[0]+".scaleX")`; setAttr ($childc[0]+".scaleY") ($height1prec+$numc2); setAttr ($childc[0]+".scaleZ") ($depth1prec+$numc2); setAttr ($childc[0]+".scaleY") ($width1prec+$numc2); string $Larrc[] = `ls-tr "boxc*"`; float $heightc1 = `getAttr($Larrc[0]+".scaleY")`; float $heightc2 = `getAttr($Larrc[1]+".scaleY")`; if ($heightc1 < $heightc2) { delete $Larrc[1]; } else { delete $Larrc[0]; } print ("Image " + $counter1); string $name = "NP_" + $counter1; setAttr defaultRenderGlobals.imageFilePrefix -type "string" $name; render -x 720 -y 480 persp; $counter3++; currentTime $counter3; } while ($counter3 <= 10); string $Cbox[] = `ls-tr "boxc*"`; float $ddepthc = `getAttr($Cbox[0]+".scaleZ")`; float $hheightc = `getAttr($Cbox[0]+".scaleY")`; float $wwidthc = `getAttr($Cbox[0]+".scaleX")`; if (4 > $ddepthc || 4 > $hheightc || 4 > $wwidthc || 16 < $ddepthc || 16 < $hheightc || 16 < $wwidthc) { select -tgl $Cbox; //sets -e -forceElement $shaderSG; delete; string $tickerC = "no"; } else { string $tickerC = "yes"; } } while ($tickerC = "no"); string $boxFinalC[] = `ls-tr "boxc*"`; float $ddepthcFinal = `getAttr($boxFinalC[0]+".scaleZ")`; float $altc1 = ($ddepthcFinal / 2); float $altc2 = ($altc1 + 6); float $budgec = rand ($altc1, $altc2); select $boxFinalC[0]; move -r 0 0 $budgec; float $counter4 = 1; polyCube -d 1 -h 1 -w 1 -n boxd1; scale -r 4 2 2 boxd1; move -r 30 0 0; do { do { float $numd1 = `rand $counter4`; float $numd2 = rand(-0.9,2); float $numd3 = ($numd1 * $numd2); float $Xd1 = (3 * $numd1); float $Xd2 = (2 * $numd2); float $Xd3 = ($numd3 / 2); string $LarrPred[] = `ls-tr "boxd*"`; select -r $LarrPred[0]; float $depth1pred = `getAttr($LarrPred[0]+".scaleZ")`; float $height1pred = `getAttr($LarrPred[0]+".scaleY")`; float $width1pred = `getAttr($LarrPred[0]+".scaleX")`; duplicate -rr; string $childd[] = `ls-sl`; float $hhd = `getAttr($childd[0]+".scaleZ")`; float $hhhd = `getAttr($childd[0]+".scaleY")`; float $hhwd = `getAttr($childd[0]+".scaleX")`; setAttr ($childd[0]+".scaleZ") ($depth1pred+$numd2); setAttr ($childd[0]+".scaleY") ($height1pred+$numd2); setAttr ($childd[0]+".scaleX") ($width1pred+$numd2); string $Larrd[] = `ls-tr "boxd*"`; float $depthd1 = `getAttr($Larrd[0]+".scaleZ")`; float $depthd2 = `getAttr($Larrd[1]+".scaleZ")`; if ($depthd1 < $depthd2) { delete $Larrd[0]; } else { delete $Larrd[1]; } print ("Image " + $counter1); string $name = "NP_" + $counter1; setAttr defaultRenderGlobals.imageFilePrefix -type "string" $name; render -x 720 -y 480 persp; $counter4++; currentTime $counter4; } while ($counter4 <= 10); string $Dbox[] = `ls-tr "boxd*"`; float $ddepthd = `getAttr($Dbox[0]+".scaleZ")`; float $hheightd = `getAttr($Dbox[0]+".scaleY")`; float $wwidthd = `getAttr($Dbox[0]+".scaleX")`; if (4 > $ddepthd || 4 > $hheightd || 4 > $wwidthd || 16 < $ddepthd || 16 < $hheightd || 16 < $wwidthd) { select -tgl $Dbox; //sets -e -forceElement $shaderSG; delete; string $tickerD = "no"; } else { string $tickerD = "yes"; } } while ($tickerD = "no"); string $boxFinalD[] = `ls-tr "boxd*"`; float $ddepthdFinal = `getAttr($boxFinalD[0]+".scaleZ")`; float $altd1 = ($ddepthdFinal / 2); float $altd2 = ($altd1 + 6); float $budged = rand ($altd1, $altd2); select $boxFinalD[0]; move -r 0 0 $budged; float $counter5 = 1; polyCube -d 1 -h 1 -w 1 -n boxe1; scale -r 5 5 5 boxe1; move -r 40 0 0; do { do { float $nume1 = `rand $counter5`; float $nume2 = rand(-1,1.2); float $nume3 = ($nume1 * $nume2); float $Xe1 = (3 * $nume1); float $Xe2 = (2 * $nume2); float $Xe3 = ($nume3 / 2); string $LarrPree[] = `ls-tr "boxe*"`; select -r $LarrPree[0]; float $depth1pree = `getAttr($LarrPree[0]+".scaleZ")`; float $height1pree = `getAttr($LarrPree[0]+".scaleY")`; float $width1pree = `getAttr($LarrPree[0]+".scaleX")`; duplicate -rr; string $childe[] = `ls-sl`; float $hhe = `getAttr($childe[0]+".scaleZ")`; float $hhhe = `getAttr($childe[0]+".scaleY")`; float $hhwe = `getAttr($childe[0]+".scaleX")`; setAttr ($childe[0]+".scaleZ") ($depth1pree+$nume2); setAttr ($childe[0]+".scaleY") ($height1pree+$nume2); setAttr ($childe[0]+".scaleX") ($width1pree+$nume2); string $Larre[] = `ls-tr "boxe*"`; float $widthe1 = `getAttr($Larre[0]+".scaleX")`; float $widthe2 = `getAttr($Larre[1]+".scaleX")`; if ($widthe1 < $widthe2) { delete $Larre[0]; } else { delete $Larre[1]; } print ("Image " + $counter1); string $name = "NP_" + $counter1; setAttr defaultRenderGlobals.imageFilePrefix -type "string" $name; render -x 720 -y 480 persp; $counter5++; currentTime $counter5; } while ($counter5 <= 10); string $Ebox[] = `ls-tr "boxe*"`; float $ddepthe = `getAttr($Ebox[0]+".scaleZ")`; float $hheighte = `getAttr($Ebox[0]+".scaleY")`; float $wwidthe = `getAttr($Ebox[0]+".scaleX")`; if (4 > $ddepthe || 4 > $hheighte || 4 > $wwidthe || 16 < $ddepthe || 16 < $hheighte || 16 < $wwidthe) { select -tgl $Ebox; delete; //sets -e -forceElement $shaderSG; string $tickerE = "no"; } else { string $tickerE = "yes"; } } while ($tickerE = "no"); string $boxFinalE[] = `ls-tr "boxe*"`; float $ddeptheFinal = `getAttr($boxFinalE[0]+".scaleZ")`; float $alte1 = ($ddeptheFinal / 2); float $alte2 = ($alte1 + 6); float $budgee = rand ($alte1, $alte2); select $boxFinalE[0]; move -r 0 0 $budgee; select -r ($boxFinalA[0]+".f[3]") ; float $hheightaFinal = `getAttr($boxFinalA[0]+".scaleY")`; float $plya = ($hheightaFinal -.75); polyExtrudeFacet -s .75 1 .75 ; select -r ($boxFinalA[0]+".f[3]") ; polyExtrudeFacet -s 1 1 1; move -r 0 $plya 0; select -r ($boxFinalB[0]+".f[3]") ; float $hheightbFinal = `getAttr($boxFinalB[0]+".scaleY")`; float $plyb = ($hheightbFinal -.75); polyExtrudeFacet -s .75 1 .75 ; select -r ($boxFinalB[0]+".f[3]") ; polyExtrudeFacet -s 1 1 1; move -r 0 $plyb 0; select -r ($boxFinalC[0]+".f[3]") ; float $hheightcFinal = `getAttr($boxFinalC[0]+".scaleY")`; float $plyc = ($hheightcFinal -.75); polyExtrudeFacet -s .75 1 .75 ; select -r ($boxFinalC[0]+".f[3]") ; polyExtrudeFacet -s 1 1 1; move -r 0 $plyc 0; select -r ($boxFinalD[0]+".f[3]") ; float $hheightdFinal = `getAttr($boxFinalD[0]+".scaleY")`; float $plyd = ($hheightdFinal -.75); polyExtrudeFacet -s .75 1 .75 ; select -r ($boxFinalD[0]+".f[3]") ; polyExtrudeFacet -s 1 1 1; move -r 0 $plyd 0; select -r ($boxFinalE[0]+".f[3]") ; float $hheighteFinal = `getAttr($boxFinalE[0]+".scaleY")`; float $plye = ($hheighteFinal -.75); polyExtrudeFacet -s .75 1 .75 ; select -r ($boxFinalE[0]+".f[3]") ; polyExtrudeFacet -s 1 1 1; move -r 0 $plye 0;