Building ConstructionThis page provides a technical breakdown of an animation of building construction). |
//---Building construction animation Version 1 //make sure to select the objects first
proc builder () { //-------construction sequence auto keyframe int $startFrame = `intSliderGrp -q -v startFrame`; string $list[] = {}; //define the start frame of animtion //define the time length between two structures generation //define the time length of drop translation //define the distance of movement //define the axis of movement
//string $profile;
//-------don't change the code below $i = 0; setAttr ($list[$i] + ".visibility") 0; //set visiblility and the first keyframe //set visibility and the second keyframe setKeyframe ($list[$i]+".v"); //set move values select -r ($list[$i]); //set move values for the third keyframe
$i++; //--------------------------- //--------create break proc breakIt () { //print ("the quary name is" + $myobject[0]); $item = $myobject[0] + ".f[0:9999]"; select -cl; select -r $item; polyChipOff -kft 0 -dup 0 -ls 0.95 0.95 0.95; //find the root node of a curve transformation node string $shape[] = `listRelatives -shapes $myobject[0]`; polySeparate -ch 1 $shape[0]; //------------create window global proc construction () if (`window -exists constructionWindow`) { deleteUI constructionWindow; }
window columnLayout; intSliderGrp -label "start Frame" intSliderGrp -label "internal Frame" intSliderGrp -label "drop duration" intSliderGrp -label "drop Height" text -l ""; button -label "Animate Construction" button -label "break components" showWindow; construction;
|
this is an early version rendered.
Latest version.
Window
|
|
//---Building construction animation Version 2
//version II: you can skip the "create beams" option
proc builder () { //-------construction sequence auto keyframe int $startFrame = `intSliderGrp -q -v startFrame`; string $list[] = {}; //define the start frame of animtion //define the time length between two structures generation //define the time length of drop translation //define the distance of movement //define the axis of movement
//string $profile;
//-------don't change the code below $i = 0; setAttr ($list[$i] + ".visibility") 0; //set visiblility and the first keyframe //set visibility and the second keyframe setKeyframe ($list[$i]+".v"); //set move values select -r ($list[$i]); //set move values for the third keyframe
$i++; //---change the time line //--------------------------- //--------create break proc breakIt () { string $myobject[] = `ls -sl`; //---assign a transparent glass //print ("the quary name is" + $myobject[0]); $item = "roof_panel" + ".f[0:9999]"; select -cl; select -r $item; polyChipOff -kft 0 -dup 0 -ls 0.95 0.95 0.95; //find the root node of a curve transformation node string $shape[] = `listRelatives -shapes roof_panel`; polySeparate -ch 1 $shape[0]; } //-----proc building beams string $myobject[] = `ls -sl`; print ("the quary name is" + $myobject[0]); //---duplicate the roof-- $item = $myobject[0] + ".f[0:9999]"; select -cl; select -r $item; //extrude along y to get the height, double faces were made polyExtrudeFacet -ch 1 -kft 0 -t 0 -1 0; doDelete; select -r $item ; //triangulate the beam into a diagonal structure polyTriangulate -ch 1 $item ; //create the hole inside the beams polyExtrudeFacet -ch 1 -kft 0 -lsx 0.8 -lsy 0.8 -lsz 0.8; doDelete; //extrude the beam to create thickness select -r $item ; polyExtrudeFacet -ch 1 -kft 0 -ltx 0 -lty 0 -ltz 0.02; //----rename the beam //----reselect the roof for the next operation
//------------create UI window global proc construction () if (`window -exists constructionWindow`) { deleteUI constructionWindow; }
window columnLayout; intSliderGrp -label "start Frame" intSliderGrp -label "internal Frame" intSliderGrp -label "drop duration" intSliderGrp -label "drop Height" text -l ""; //---create button 1 //---create button 2 //---create button 3
showWindow; construction; |
||
//version 3: Final GUI
proc builder () { //-------construction sequence auto keyframe int $startFrame = `intSliderGrp -q -v startFrame`; string $list[] = {}; //define the start frame of animtion //define the time length between two structures generation //define the time length of drop translation //define the distance of movement //define the axis of movement
//string $profile;
//-------don't change the code below $i = 0; setAttr ($list[$i] + ".visibility") 0; //set visiblility and the first keyframe //set visibility and the second keyframe setKeyframe ($list[$i]+".v"); //set move values select -r ($list[$i]); //set move values for the third keyframe $i++; //builder; //--------------------------- //--------create break proc breakIt () { string $myobject[] = `ls -sl`; //---assign a transparent glass //print ("the quary name is" + $myobject[0]); $item = "roof_panel" + ".f[0:9999]"; select -cl; select -r $item; polyChipOff -kft 0 -dup 0 -ls 0.95 0.95 0.95; //find the root node of a curve transformation node string $shape[] = `listRelatives -shapes roof_panel`; polySeparate -ch 1 $shape[0]; } //-----proc building beams string $myobject[] = `ls -sl`; print ("the quary name is" + $myobject[0]); //---duplicate the roof-- $item = $myobject[0] + ".f[0:9999]"; select -cl; select -r $item; //extrude along y to get the height, double faces were made polyExtrudeFacet -ch 1 -kft 0 -t 0 -1 0; doDelete; select -r $item ; //triangulate the beam into a diagonal structure polyTriangulate -ch 1 $item ; //create the hole inside the beams polyExtrudeFacet -ch 1 -kft 0 -lsx 0.8 -lsy 0.8 -lsz 0.8; doDelete; //extrude the beam to create thickness select -r $item ; polyExtrudeFacet -ch 1 -kft 0 -ltx 0 -lty 0 -ltz 0.02; //----rename the beam //----reselect the roof for the next operation
//------------create UI window global proc construction () if (`window -exists constructionWindow`) { deleteUI constructionWindow; }
window
//scrollLayout; intSliderGrp -label "start Frame" intSliderGrp -label "internal Frame" intSliderGrp -label "drop duration" /* //break //add three drop values rowColumnLayout -numberOfColumns 2 |