Hi everyone,
Tomorrow we'll be going through the script file that I gave out for the last session as well as looking at this:
//tower maker
//create and closed curve and select it
//input: height of the tower
// number of floors
// amount of twist
global proc makeTower(float $height, float $floors, float $twist)
{
int $increment = 100/$floors;
int $i;
string $sel[] = `ls -sl`;
string $top[] = `duplicate -rr $sel[0]`;
xform -cp $sel[0] $top[0];
move -r 0 $height 0 $top[0];
rotate -r 0 $twist 0 $top[0];
string $blendName[] = `blendShape -origin world -tc 0 $top[0] $sel[0]`;
setKeyframe -at $top -v 0 -t 0 $blendName[0];
setKeyframe -at $top -v 1 -t 100 $blendName[0];
string $snaps[] = `snapshot -increment $increment -constructionHistory 1 -startTime 1 -endTime 100 -update animCurve $sel[0]`;
setAttr ($snaps[1]+".update") 1;
string $floorCurves[] = `listRelatives $snaps[0]`;
for($curve in $floorCurves)
{
string $floorPlate[] = `planarSrf -ch 1 -d 3 -ko 0 -tol 0.01 -rn 0 -po 1 $curve`;
rename $floorPlate[0] ("floor_"+$i);
parent ("|floor_"+$i) $snaps[0];
$i++;
}
string $roof[] = `planarSrf -ch 1 -d 3 -ko 0 -tol 0.01 -rn 0 -po 1 $top[0]`;
rename $roof[0] "roof";
parent "|roof" $snaps[0];
select $top[0];
}
Tuesday, 21 October 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment