Saturday, October 22, 2011

DRIFT




  <Behind the Scene>



Movie Name - 'DRIFT.'
Genre Sci-fi, Action, Short.
Director/ Cinematographer/ Visual Effects Supervisor... etc Rumesh Tharanga.
Starring -  Amila Saranga.
              -  Rajitha Ayesh
              - Rumesh Tharanga.
Video documenting/ Photographing Behind the scene - Nuwan Kalansooriya
On location Lighting Assistance/ Behind the Scene Photography - Rajitha Ayesh

Behind The Scene


Thursday, May 26, 2011

HDR (32 bpc) Photography- My very first HDRI.


For CG visual effects of the Action/ Sci-Fi Short Movie I am producing nowadays needs some HDR Images. So, for the first time, I am in a need of shooting some Photographs and make some HDRIs out of 'em. Here is a successful test I've done using some images shot at one of a locations I used for filming the short movie.

It was a viable experiment for breaking the ice on HDR Photographing...

HDR (High Dynamic Range) Photography - 32bpc Images.

Basically (At least for years in Digital video/Photo-graphy) we used 8bpc (8 Bits Per Channel) images. Each channel of RGB (Red, Green, Blue) represented by a digital code length of 8-bits (255 possible colour values). And together all three RGB channels we could specify 16777216 (255 X 255 X 255) colours (SVGA or True Colours). In true colours computer uses 24 'bits per pixel' (bpp) to store an image (8bits per each indivdual RGB channels). 


HDR uses 32 bits per each individual RGB channel, allowing us to use very large dynamic amount of colours with greater contrast. 


Basically What I did was; I shot 5 different Photographs using 5 different exposure values. 
Ex -2, ISO 200. White Balance -Daylight Mood.
Ex -1, ISO 200. White Balance -Daylight Mood.
Ex 0, ISO 200. White Balance -Daylight Mood.
Ex 1, ISO 200. White Balance -Daylight Mood.
Ex 2, ISO 200. White Balance -Daylight Mood.
Then I stack them together. You can use software, such as; Photoshop or photomatix pro for this purpose. And refined image using available adjustment tools.

Here is the final HDR Image. (Click To Enlarge). 
HDRI - Click To Enlarge
Camera Used - Canon PowerShot A480.

At least you need 3 photos shot using 3 different Ex values to produce a HDRI but more photos you use the outcome will be stunning.

I thought of providing more information upon making HDRI. But, I am afraid, these days I am running around the clock to finish the post production of my short movie. 

I will Try to back with more details...

See you Later.

Saturday, May 21, 2011

'Behind The Scene' - Very First | Action||Sci-Fi|| Short Movie.






Movie Name - 'DRIFT.'
Genre - Sci-fi, Action, Short.
Director/ Cinematographer/ Visual Effects Supervisor... etc - Rumesh Tharanga.
Starring Amila Saranga.
            -  Rajitha Ayesh
            - Rumesh Tharanga.
Video documenting/ Photographing Behind the scene - Nuwan Kalansooriya
On location Lighting Assistance/ Behind the Scene Photography - Rajitha Ayesh


NEW- First And second Day at Second Location.


Breaking the Ice Early in the morning...
________________________________________
Recently, I started making an experimental Action, Sci-Fi Short movie.

My intention was, successfully test an action sequence of a movie composed with CG Visual Effects. And more especially I wanted to test intense Editing style to give the punch of rush. And here I tend to use some stylized/ dramatic camera angles.

Editing was successful. Everything worked out the way I expected.

After 3 Days of shooting in 4 Different locations, we filmed approximately 696 shots and 242 shots were in printable quality (Or usable for the way I liked to edit).

As this was a ZERO Budget Movie we only had minimal facilities to filmed these footages.

Equipments used:
  • Protax HD7000 - 720p HD 30fps camera - (Only changeable settings in the camera was 'Exposure'. So I had to be tricky to film with it. Without manual settings for ISO values, Shutter Speed, frame rate... it was so hard to get the desired look. We had to shoot some footages twice because camera's sensor has a problem [factory error] - if camera used in a wide opened area (In our case express Rail Road) and if it is cloudy and happen to film objects faced sun's opposite direction [Sun is in front of the camera] camera only illuminate sky and really far objects... Simply characters or objects near to camera get too much darken. I learned that fact in first day of shooting in the evening. So had to shoot 'em again in the next day in broad day light [Middle of the day]. Also NO especial Gears for Depth of Field. Without a way to control the aperture I simply would not be able to gave utmost cinematic look to most of footages, at the way I wanted it. Camera only had two inbuilt focusing levels - Infinite and Macro. No Manual Focusing. But I tried my best to get the best out of it. And also I didn't have much time to experiment with camera. But I believe I did my best, at least for the very first time.) 
  • Samsung C20 SD camcorder - Used to Video-graph behind the Scene. And Some Still photographed were shot as well.
  • Canon Powershot A480 - Used for HDRI photography.
  • Home Made Reflectors/ Diffusers - I bought 2 'Bristol boards' ($0.15 x 2) and stapled them together and bought a silver coloured paper (have no idea about the name of the paper and cost me $0.25) stapled it on to a one side of those stapled Bristol boards and made a cheapest 'Reflector'. And in most of the shots that were filmed in Rail Road and other open Areas,  foreground (Separated character from background) was illuminated by using "my home made reflector".
  • My Sister (Chanuka Lakmali Hettiarachchi) Provided me with some make-up kits. And her help for make-up as well.
  • A Green cloth as a green screen. 2.5 meters. $1.40 per a meter. 
  • ESP: Computer - A computer with "Intel Core 2 Duo" processor, "4GB" of Ram, And "On Board Graphic card" used for making every a bit of Computer Generated Visual Effects you see in this movie. 
Though it was a almost ZERO budget movie, I believe I breath my unique style as possible as I could upon this small work of Art. Consider it as the VERY first Short movie made with Real Footages + Computer Generated Visual effects.


Now, I have the HARDEST part left with me; which is making Computer Generated Visual Effects. Which will be the most time consuming and self devoting part. 

People Who Behind this task force:

Rumesh Tharanga - Director/ Producer/ Screenplay Writer/ Director of photography/ Visual Effect Supervisor... Etc.


Amila Saranga - Actor/ Assistance in Location Choosing/ Public and Media relationship Manager.


Nuwan Kalansooriya - Videographer/ Video documenting Behind the scene/ Photographing Behind the scene/ On location Lighting Assistance. 


Rajitha Ayesh - Actor/ On location Lighting Assistance/ Behind the Scene Photography.




















I would like to thank Umesh Muthumala so very much for Providing His Movie Camera and equipments for us for shooting.
And Would like to thank so very much to Danuka Chamara for Providing Cameras and equipments as well and his help on this production.

I find it an immense pleasure to Thank "Nuwan Kalansooriya" and "Rajitha Ayesh". Without their friendship and mammoth help, this wouldn't be a success and I never could do this alone.

And I should appreciate Amila Saranga's Brilliant performances. In a very short time (In a matter of minutes) He grasps what I wanted from him and he gave his utmost to Breath the life in to his character. Amila Saranga got all it needs to be a marvelous actor. I love his dedication over this work and I owe him so much for being behind with me in this very especial task.
More exciting Behind the Scene Videos and stuff about to Come...

Keep your fingers crossed.

See you Next Time.






Friday, April 8, 2011

'Auto Building Maker' By Rumesh Tharanga - MEL Script.

Concept and Programme Logic Testing

I wrote this script to test the concept came into my mind about automating and instancing buildings in a 3D scene. And did this as a simple script to test basic work flow behind whole concept. I am about to develop some complex scripting system to make an entirely customizable object instancing interface, which  will be able to use for my movie 'Ananthavarthana (අනන්තාවර්තන) - curvedInfinity'. 'Ananthavarthana' literally has to be populated with thousands of objects. Even duplicating will not be an option for such complex situations. 

So I thought of developing some sort of system that will save my time and work as my guardian. 

So I will be able to - Populate any Scenery with Buildings or with any other object that is not Identical one to a another. Moreover that, I will be able to instantiate Characters and their animations as well. (Eg - Some robots in a hallway walking all around avoiding each other or standing randomly, random moments.) 

Hopefully the script system I am about to develop for 'Ananthavarthana (අනන්තාවර්තන) - curvedInfinity' will be available for everyone for free after the movie has been released.

So in this script you will see some basic work flow behind it. And please mind that, this is the first Script of its' kind written by me; it has a few bugs in it, which I didn't fix. My mere intention was to test the idea arouse in my mind.

You will get a basic idea how this script works by following  video.
 


Following video shows some example this script is in action.



Here are some of my original drawings and main flow chart that I used to develop some basic maths behind this process. These images present only about 20% of entire flow, I am sorry that I didn't draw flow charts for every possible solution as almost all the time I find it easy to keep the programme flow in my mind while I am coding rather than drawing on paper.
The Basic shape and Main parts in the building that is changeable. A cluster is the part that repeats.
The main flow chart. And please note that every command in square boxes are some other flow charts I only mentioned as single commands.
User inputs, which are used to automated creation of buildings.

Math design for duplication of windows and how they should be spread across a floor.

Inner extrude of Building base.
And, Here you go with the Script...
 /*
    Author: Rumesh Tharanga
    Script Name: skyscrapers_builderUI.mel
    Script Version: 1.0
    Maya Version:  2011

    usage:
*/



global proc buttonActionEx(string $val1, string $val2, string $val3, string $val4, string $val0, string $val5, string $val6, string $val7, string $val8, string $val9, string $val10, string $val11, string $val12, string $val13, string $val14, string $val15, string $val16, string $val17, string $val18, string $val19) {

    string $temVal1 = `intFieldGrp -q -v1 $val1`;
    string $temVal2 = `intFieldGrp -q -v2 $val2`;
    string $temVal3 = `checkBoxGrp -q -value1 $val3`;
    string $temVal4 = `intSliderGrp -q -v $val4`;
    string $temVal0 = `intSliderGrp -q -v $val0`;
    string $temVal5 = `intSliderGrp -q -v $val5`;
    string $temVal6 = `intSliderGrp -q -v $val6`;
    string $temVal7 = `intSliderGrp -q -v $val7`;
    string $temVal8 = `intSliderGrp -q -v $val8`;
    string $temVal9 = `intSliderGrp -q -v $val9`;
    string $temVal10 = `intSliderGrp -q -v $val10`;
    string $temVal11 = `intSliderGrp -q -v $val11`;
    string $temVal12 = `checkBoxGrp -q -value1 $val12`;
    string $temVal13 = `intSliderGrp -q -v $val13`;
    string $temVal14 = `intSliderGrp -q -v $val14`; //Disabled
    string $temVal15 = `intSliderGrp -q -v $val15`; //Disabled
    string $temVal16 = `checkBoxGrp -q -value1 $val16`;
    string $temVal17 = `intSliderGrp -q -v $val17`;
    string $temVal18 = `intSliderGrp -q -v $val18`;
    string $temVal19 = `intSliderGrp -q -v $val19`;
  
    // Call Main Proceeders.
    createRequiredNodes();
  
    float $TEMx = $temVal1;
    float $TEMy = $temVal2;
    float $TEMz = $temVal4;
    float $widthScale = $TEMx*($TEMz/100);
    float $depthScale = $TEMy*($TEMz/100);
  
        float $startingHeightTem;
        if ($temVal3 == "1") {
            makeBase($temVal1, $temVal2, $temVal0, $temVal4);
            $startingHeightTem = $temVal0;
        } else { $startingHeightTem = 0;
                 spaceLocator -n locObj_moveRotate; // This locator will be used
                                       // to Move and Rotate respective Building.      
         }
      
        /*
        string $baseSt;
        if ($temVal3 == "1") {
            $baseSt = "true";
        } else { $baseSt = "false"; }
      
        */
      
        string $floorDivSt;
        if ($temVal12 == "1") {
            $floorDivSt = "true";
        } else { $floorDivSt = "false"; }
      
        string $hasTopSt;
        if ($temVal16 == "1") {
            $hasTopSt = "true";
        } else { $hasTopSt = "false"; }
  
    makeClusters($temVal7, $widthScale, $depthScale, $startingHeightTem, $temVal8, $temVal9, $floorDivSt, $temVal3, $temVal4, $temVal10, $temVal11, $hasTopSt, $temVal17, $temVal18, $temVal19);
}


//***************************************************************************************************************
// User Interface.
global proc  skyscrapers_builderUI() {
    
    string $mainDialog = `window
                        -title "skyscrapers Builder By Rumesh Tharanga- [Testing Concept and Programme Logic]"
                        -widthHeight 1000 800`;
  
    columnLayout;
        frameLayout -collapsable true
                        -label "Building Width And Depth" -width 700;
            rowColumnLayout -nc 1;
                global string $buildingWidthDepth;
                $buildingWidthDepth = `intFieldGrp -numberOfFields 2
                                       -label "Building Width And Depth"
                                       -value1 10 -value2 10`; 
            //setParent;
        //setParent;
    
        rowColumnLayout -nc 1;
            global string $hasBase;
            $hasBase = `checkBoxGrp -label "Make a Base" -v1 1`;
            //-onCommand "frameLayout -edit -en true $buildingWD"
            //-offCommand "frameLayout -edit -en false $buildingWD"`;
        //setParent;
      
        frameLayout -collapsable true -label "Values for Making Base" -width 700;
            rowColumnLayout -nc 1;
                 global string $inwardExtrudePrecentage;
                 $inwardExtrudePrecentage = `intSliderGrp -label "Inward Extrude Precentage"
                                        -minValue 10 -maxValue 100 -field true
                                        -fieldMinValue -10 -fieldMaxValue 100
                                        -value 70`;    
                 global string $baseHeight;
                 $baseHeight = `intSliderGrp -label "Base Height"
                                        -minValue 0 -maxValue 100 -field true
                                        -fieldMinValue -0 -fieldMaxValue 100
                                        -value 4`;
                global string $amountOfBaseConsPerWidth;
                $amountOfBaseConsPerWidth = `intSliderGrp -label "Amount of Base Cons per Width" -en false
                                        -minValue 0 -maxValue 100 -field true
                                        -fieldMinValue -0 -fieldMaxValue 100
                                        -value 10`;
                global string $amountOfBaseConsPerDepth;
                $amountOfBaseConsPerDepth = `intSliderGrp -label "Amount of Base Cons per Depth" -en false
                                        -minValue 0 -maxValue 100 -field true
                                        -fieldMinValue -0 -fieldMaxValue 100
                                        -value 10`;
            //setParent;
        //setParent;
      
        frameLayout -collapsable true -label "Values For Making A Clusters and Floors" -width 700;
            rowColumnLayout -nc 1;
                global string $amountOfClusters;
                $amountOfClusters = `intSliderGrp -label "Amount of clusters Building Has"
                                        -minValue 0 -maxValue 1000 -field true
                                        -fieldMinValue -0 -fieldMaxValue 700
                                        -value 5`;
                global string $heightOfAFloor;
                $heightOfAFloor = `intSliderGrp -label "Height of a single floor"
                                        -minValue 0 -maxValue 100 -field true
                                        -fieldMinValue -0 -fieldMaxValue 100
                                        -value 2`;
                global string $amountOfFloorPerACluster;
                $amountOfFloorPerACluster = `intSliderGrp -label "Amount of floor per a cluster"
                                        -minValue 0 -maxValue 100 -field true
                                        -fieldMinValue -0 -fieldMaxValue 100
                                        -value 3`;
                global string $amountOfWindowsPerWidth;
                $amountOfWindowsPerWidth = `intSliderGrp -label "Amount of Windows per width"
                                        -minValue 0 -maxValue 100 -field true
                                        -fieldMinValue -0 -fieldMaxValue 100
                                        -value 5`;
                global string $amountOfWindowsPerDepth;
                $amountOfWindowsPerDepth = `intSliderGrp -label "Amount of Windows per Depth"
                                        -minValue 0 -maxValue 100 -field true
                                        -fieldMinValue -0 -fieldMaxValue 100
                                        -value 5`;
                global string $hasClusterDividers;
                $hasClusterDividers = `checkBoxGrp -label "Make Cluster Dividers" -v1 1`;
                global string $clusterDividersHeight;
                $clusterDividersHeight = `intSliderGrp -label "Cluster Dividers Height"
                                        -minValue 0 -maxValue 100 -field true
                                        -fieldMinValue -0 -fieldMaxValue 100
                                        -value 2`;
                global string $midExtrudeHeight;
                $midExtrudeHeight = `intSliderGrp -label "Mid Extrude Height" -en false
                                        -minValue 0 -maxValue 100 -field true
                                        -fieldMinValue -0 -fieldMaxValue 100
                                        -value 2`;
                global string $midExtrudeAmount;
                $midExtrudeAmount = `intSliderGrp -label "Mid Extrude Amount" -en false
                                        -minValue 0 -maxValue 100 -field true
                                        -fieldMinValue -0 -fieldMaxValue 100
                                        -value 2`;          
            //setParent;
        //setParent;
      
        frameLayout -collapsable true -label "Building Floor And Tip" -width 700;
            rowColumnLayout -nc 1;
                global string $hasATip;
                $hasATip = `checkBoxGrp -label "Make A Building Tip" -v1 1`;
                global string $topHeight;
                $topHeight = `intSliderGrp -label "Building Top Height"
                                        -minValue 0 -maxValue 100 -field true
                                        -fieldMinValue -0 -fieldMaxValue 100
                                        -value 3`;
                global string $topInwardExtrudePrecentage;
                $topInwardExtrudePrecentage = `intSliderGrp -label "Top Inward extrude precentage"
                                        -minValue 10 -maxValue 100 -field true
                                        -fieldMinValue -10 -fieldMaxValue 100
                                        -value 60`;
                global string $tipHeight;
                $tipHeight = `intSliderGrp -label "Tip Height"
                                        -minValue 0 -maxValue 100 -field true
                                        -fieldMinValue -0 -fieldMaxValue 100
                                        -value 4`;
            //setParent;
        //setParent;
      
        rowColumnLayout -nc 2;
            //string $buildIt =
            button -label "Buil It" -command "buttonActionEx($buildingWidthDepth, $buildingWidthDepth, $hasBase, $inwardExtrudePrecentage, $baseHeight, $amountOfBaseConsPerWidth, $amountOfBaseConsPerDepth, $amountOfClusters, $heightOfAFloor, $amountOfFloorPerACluster, $amountOfWindowsPerWidth, $amountOfWindowsPerDepth, $hasClusterDividers, $clusterDividersHeight, $midExtrudeHeight, $midExtrudeAmount, $hasATip, $topHeight, $topInwardExtrudePrecentage, $tipHeight)";
            //string $cancelThis =
            button -label "Cancel";
        //setParent;
    //setParent;        
    showWindow $mainDialog;
} //End of making UI.


// Make Required Nodes for grouping Objects.
global proc createRequiredNodes () {
  
    if (!`objExists skyScrapers_grp`) {
  
        createNode "transform" -n "skyScrapers_grp"; //Global Node.
      
        createNode "transform" -n "basesGrp" -p "|skyScrapers_grp";
            createNode "transform" -n "baseConsGrp" -p "|skyScrapers_grp|basesGrp";
            createNode "transform" -n "baseSolidsGrp" -p "|skyScrapers_grp|basesGrp";
        createNode "transform" -n "clustersGrp" -p "|skyScrapers_grp";
            createNode "transform" -n "floorsGrp" -p "|skyScrapers_grp|clustersGrp";
                createNode "transform" -n "floorWallsGrp" -p "|skyScrapers_grp|clustersGrp|floorsGrp";
                createNode "transform" -n "floorWindowsGrp" -p "|skyScrapers_grp|clustersGrp|floorsGrp";
            createNode "transform" -n "floorDividersGrp" -p "|skyScrapers_grp|clustersGrp";
        createNode "transform" -n "roofTopsGrp" -p "|skyScrapers_grp";
            createNode "transform" -n "topBasesGrp" -p "|skyScrapers_grp|roofTopsGrp";
            createNode "transform" -n "topSolidsGrp" -p "|skyScrapers_grp|roofTopsGrp";
            createNode "transform" -n "tipsGrp" -p "|skyScrapers_grp|roofTopsGrp";

        createNode "transform" -n "objectMoveRotateLocatorsGrp";
      
        shadingNode -asShader blinn -n blinn_baseSolid;
        setAttr "blinn_baseSolid.color" 0 .5 0;
      
        shadingNode -asShader blinn -n blinn_baseCons;
        setAttr "blinn_baseCons.color" 0 0 1;
      
        shadingNode -asShader blinn -n blinn_floor;
        setAttr "blinn_floor.color" 0 1 0;
      
        shadingNode -asShader blinn -n blinn_floorWall;
        setAttr "blinn_floorWall.color" 0 1 1;
      
        shadingNode -asShader blinn -n blinn_window;
        setAttr "blinn_window.color" 1 0 0;
      
      
        shadingNode -asShader blinn -n blinn_floorDivider;
        setAttr "blinn_floorDivider.color" 1 0 1;
      
        shadingNode -asShader blinn -n blinn_topSolid;
        setAttr "blinn_topSolid.color" 1 1 1;
      
        shadingNode -asShader blinn -n blinn_tip;
        setAttr "blinn_tip.color" .5 0 .5;
    }
}

// Proceeder for Making The BASE.
global proc makeBase(float $baseWidth, float $baseDepth, float $baseHeight, float $inwardExtrudePrecentage) {

    spaceLocator -n locObj_moveRotate; // This locator will be used
                                       // to Move and Rotate respective Building.
 
// This proceeder will make the base of the building.
    polyCube -n baseSolid -ch off;
  
    hyperShade -a blinn_baseSolid;
  
     string $selected[] = `ls -sl`;
     string $temEval = "move 0 -0.5 0 "+ $selected[0] +".scalePivot "+ $selected[0] +".rotatePivot";
    eval($temEval);
    scale -a $baseWidth 0.5 $baseDepth;
    select -r |baseSolid.f[1];
    polyExtrudeFacet -ch off -ws on -ty ($baseHeight/2);
    float $inwardXScale = $baseWidth*($inwardExtrudePrecentage/100);
    float $inwardZScale = $baseDepth*($inwardExtrudePrecentage/100);
    print ($inwardXScale + "\n" + $inwardZScale +  "\n");
    polyExtrudeFacet -ch off -ws on -ty ($baseHeight/2);
  
    parentConstraint -mo |locObj_moveRotate |baseSolid;

//move most upper vertices inward.   
        //cordination for +/-values in Z direciotn will store in '$zDepthCord'.
    float $zDepthCord = ($baseDepth * $inwardExtrudePrecentage)/200;
        //cordination for +/-values in X direciotn will store in '$xWidthCord'.
    float $xWidthCord = ($baseWidth * $inwardExtrudePrecentage)/200;
        // Setting vertices inward.
    select -r |baseSolid.vtx[12];
        move -a (-$xWidthCord) 4 ($zDepthCord);
    select -r |baseSolid.vtx[13];
        move -a ($xWidthCord) 4 ($zDepthCord);
    select -r |baseSolid.vtx[14];
        move -a ($xWidthCord) 4 (-$zDepthCord);
    select -r |baseSolid.vtx[15];
        move -a (-$xWidthCord) 4 (-$zDepthCord);
  
    parent |baseSolid |skyScrapers_grp|basesGrp|baseSolidsGrp;
  
//Building 'Base Cons'.
     polyCube -n baseCon0 -ch off;
  
     hyperShade -a blinn_baseCons;
   
     string $selected[] = `ls -sl`;
     $temEval = "move 0 -0.5 0 "+ $selected[0] +".scalePivot "+ $selected[0] +".rotatePivot";
    eval($temEval);
    move ($baseWidth/2) (.5) ($baseDepth/2);
    float $conWidth;
  
    if ($baseWidth >= $baseDepth){
        $conWidth = ($baseWidth/$baseDepth);
    }
    else {
        $conWidth = ($baseDepth/$baseWidth);
    }
    scale -a (.5) (($baseHeight/2)-.2) ($conWidth-.2);

    select -tgl |skyScrapers_grp|basesGrp|baseConsGrp;
    parent;
  
    parentConstraint -mo |locObj_moveRotate `ls -sl`;

    int $x=0;
    for ($x = ($baseDepth/$conWidth); $x > 0; $x--) { //Loop
        duplicate;
        move -r 0 0 (-$conWidth);
      
        parentConstraint -mo |locObj_moveRotate `ls -sl`;
    }
    duplicate;
    rotate -r 0 90 0;
  
    parentConstraint -mo |locObj_moveRotate `ls -sl`;
  
    for ($x = ($baseWidth/$conWidth); $x > 0; $x--) { //Loop
        duplicate;
        move -r (-$conWidth) 0 0;
      
        parentConstraint -mo |locObj_moveRotate `ls -sl`;
    }
    duplicate;
    rotate -r 0 90 0;
  
    parentConstraint -mo |locObj_moveRotate `ls -sl`;
  
    for ($x = ($baseDepth/$conWidth); $x > 0; $x--) { //Loop
        duplicate;
        move -r 0 0 ($conWidth);
      
        parentConstraint -mo |locObj_moveRotate `ls -sl`;
    }
    duplicate;
    rotate -r 0 90 0;
  
    parentConstraint -mo |locObj_moveRotate `ls -sl`;
  
    for ($x = ($baseWidth/$conWidth); $x > 0; $x--) { //Loop
        duplicate;
        move -r ($conWidth) 0 0;
      
        parentConstraint -mo |locObj_moveRotate `ls -sl`;
    }
   // select -cl;
 }
 // EnD of Proceeder, Making The Base.

//************************************************************************************************
 //Proceeder for Making A Cluster.
global proc makeClusters(int $amountOfClusters, float $clusterWidth, float $clusterDepth, float $startingHeight, float $heightOfAFloor, float $amountOfFloorsPerCluster, string $hasFloorDivider, float $floorDividerHeight, float $floorDividerMidExtrudePrecentage, float $windowsPerFloorWidth, float $windowsPerFloorDepth, string $hasATop, float $topHeight, float $topInwardExtrudePrecentage, float $tipHeight) {

    float $currStartingHeight = $startingHeight;
    string $temEval;
    int $y=0;
    for ($y=$amountOfClusters; $y>0; $y--) {  
// Make Floors.
        int $x=0;
        for ($x = $amountOfFloorsPerCluster; $x > 0; $x--) {
            makeAFloor($clusterWidth, $clusterDepth, $heightOfAFloor, $windowsPerFloorWidth, $windowsPerFloorDepth, $currStartingHeight);
            $currStartingHeight += $heightOfAFloor;
        } //EnD Making Floors.
      
        // Make a Divider
        if ($hasFloorDivider == "true") {
            polyCube -n floorDivider -ch off -sy 3;
          
            hyperShade -a blinn_floorDivider;
          
            string $selected[] = `ls -sl`;
            $temEval = "move 0 -0.5 0 "+ $selected[0] +".scalePivot "+ $selected[0] +".rotatePivot";
            eval($temEval);
            move 0 ($currStartingHeight + 0.5) 0;
            scale ($clusterWidth+0.2) $floorDividerHeight ($clusterDepth+0.2);
            $currStartingHeight += $floorDividerHeight;
          
            select -tgl |skyScrapers_grp|clustersGrp|floorDividersGrp;
            parent;
          
            parentConstraint -mo |locObj_moveRotate `ls -sl`;
          
            //select -r floorDivider.f[12];
            //select -tgl floorDivider.f[5];
            //select -tgl floorDivider.f[1];
            //select -tgl floorDivider.f[9];
  
            //scale -r -.1 0 -.1;
        }
    }
    if ($hasATop == "true") {
            polyCube -n topSolid -ch off;
          
            hyperShade -a blinn_topSolid;
          
            string $selected[] = `ls -sl`;
            $temEval = "move 0 -0.5 0 "+ $selected[0] +".scalePivot "+ $selected[0] +".rotatePivot";
            eval($temEval);
            move 0 ($currStartingHeight + 0.5) 0;   
            scale ($clusterWidth-0.2) (($topHeight*10)/100) ($clusterDepth-0.2);
          
            parentConstraint -mo |locObj_moveRotate `ls -sl`;

            //string $selectedFace[] =`ls -sl`;
            select -r |topSolid.f[1];
            polyExtrudeFacet -ch off -ws on -ty ($topHeight-0.2);
      
        //move most upper vertices inward.   
                //cordination for +/-values in Z direciotn will store in '$zDepthCord'.
            float $zDepthCord = ($clusterDepth * $topInwardExtrudePrecentage)/200;
                //cordination for +/-values in X direciotn will store in '$xWidthCord'.
            float $xWidthCord = ($clusterWidth * $topInwardExtrudePrecentage)/200;
                // Setting vertices inward.
            select -r |topSolid.vtx[8];
                move -a (-$xWidthCord) ($currStartingHeight+$topHeight) ($zDepthCord);
            select -r |topSolid.vtx[9];
                move -a ($xWidthCord) ($currStartingHeight+$topHeight) ($zDepthCord);
            select -r |topSolid.vtx[10];
                move -a ($xWidthCord) ($currStartingHeight+$topHeight) (-$zDepthCord);
            select -r |topSolid.vtx[11];
                move -a (-$xWidthCord) ($currStartingHeight+$topHeight) (-$zDepthCord);
          
            parent |topSolid |skyScrapers_grp|roofTopsGrp|topSolidsGrp;
          
            $currStartingHeight += $topHeight;
          
            polyCube -n tip -ch off;
          
            hyperShade -a blinn_tip;
          
            string $selected[] = `ls -sl`;
            $temEval = "move 0 -0.5 0 "+ $selected[0] +".scalePivot "+ $selected[0] +".rotatePivot";
            eval($temEval);
            move 0 ($currStartingHeight + 0.5) 0;   
            scale ($xWidthCord/2) ($tipHeight) ($zDepthCord/2);
          
            select -tgl |skyScrapers_grp|roofTopsGrp|tipsGrp;
            parent;
          
            parentConstraint -mo |locObj_moveRotate `ls -sl`;              
     }
     parent |locObj_moveRotate |objectMoveRotateLocatorsGrp;
     select -clear;
}
// EnD of Proceeder, Making The Cluster.

//************************************************************************************************
// Proceeder Making A Floor.

global proc makeAFloor(float $floorWidth, float $floorDepth, float $floorHeight, float $windowsPerWidth, float $windowsPerDepth, float $floorStartingHeight) {
// Making wall...
     polyCube -n floorWall -ch off;
   
     hyperShade -a blinn_floorWall;
   
     string $selected[] = `ls -sl`;
     $temEval = "move 0 -0.5 0 "+ $selected[0] +".scalePivot "+ $selected[0] +".rotatePivot";
    eval($temEval);
    move -a 0 ($floorStartingHeight + 0.5) 0;
    scale -a $floorWidth $floorHeight $floorDepth;
  
    select -tgl |skyScrapers_grp|clustersGrp|floorsGrp|floorWallsGrp;
    parent;
  
    parentConstraint -mo |locObj_moveRotate `ls -sl`;
  
// End of Making wall.
//Making floor of floor...
    polyCube -n floor -ch off;
  
    hyperShade -a blinn_floor;
  
    move -a 0 ($floorStartingHeight) 0;
    scale -a ($floorWidth + 0.2) (($floorHeight*5)/100) ($floorDepth + 0.2);

    select -tgl |skyScrapers_grp|clustersGrp|floorsGrp|floorWallsGrp;
    parent;
  
    parentConstraint -mo |locObj_moveRotate `ls -sl`;
  
// EnDing Making floor of floor.

    float $widthOfAWindow = ($floorDepth - ((0.3 * $windowsPerDepth) + 0.3))/$windowsPerDepth;
    float $heightOfAWindow = $floorHeight - 0.6;
  
// Building Windows on a side...
    polyCube -n aWindow -ch off;
  
    hyperShade -a blinn_window;
  
    move -a ($floorWidth/2) ($floorStartingHeight + ($floorHeight/2)) (($floorDepth/2)-(($heightOfAWindow/2) + 0.3));
    scale -a 0.3 ($heightOfAWindow) ($widthOfAWindow);
  
    select -tgl |skyScrapers_grp|clustersGrp|floorsGrp|floorWindowsGrp;
    parent;
  
    parentConstraint -mo |locObj_moveRotate `ls -sl`;
  
    int $x=0;
    for ($x = $windowsPerDepth; $x > 1; $x--) {
        duplicate;
        move -r 0 0 (-($widthOfAWindow+0.3));
      
        parentConstraint -mo |locObj_moveRotate `ls -sl`;
    }
// Building Windows on This Side Completed.

// Building Windows on a side...
    duplicate;
    rotate -r 0 90 0;
  
    $widthOfAWindow = ($floorWidth - ((0.3 * $windowsPerWidth) + 0.3))/$windowsPerWidth;
    $heightOfAWindow = $floorHeight - 0.6;
  
    move -a (($floorWidth/2)-(($widthOfAWindow/2)+0.3)) ($floorStartingHeight + ($floorHeight/2)) ($floorDepth/2);
    scale -a 0.3 ($heightOfAWindow) ($widthOfAWindow);
  
    parentConstraint -mo |locObj_moveRotate `ls -sl`;
  
    $x=0;
    for ($x = $windowsPerWidth; $x >1; $x--) {
        duplicate;
        move -r (-($widthOfAWindow+0.3)) 0 0;
      
        parentConstraint -mo |locObj_moveRotate `ls -sl`;
    }
// Building Windows on This Side Completed.

// Building Windows on a side...
    duplicate;
    rotate -r 0 90 0;  

    $widthOfAWindow = ($floorDepth - ((0.3 * $windowsPerDepth) + 0.3))/$windowsPerDepth;
    $heightOfAWindow = $floorHeight - 0.6;
  
    move -a (-($floorWidth/2)) ($floorStartingHeight + ($floorHeight/2)) (($floorDepth/2)-(($heightOfAWindow/2) + 0.3));
    scale -a 0.3 ($heightOfAWindow) ($widthOfAWindow);
  
    parentConstraint -mo |locObj_moveRotate `ls -sl`;
  
    for ($x = $windowsPerDepth; $x > 1; $x--) {
        duplicate;
        move -r 0 0 (-($widthOfAWindow+0.3));
      
        parentConstraint -mo |locObj_moveRotate `ls -sl`;
    }
// Building Windows on This Side Completed.

// Building Windows on a side...
    duplicate;
    rotate -r 0 90 0;
  
    $widthOfAWindow = ($floorWidth - ((0.3 * $windowsPerWidth) + 0.3))/$windowsPerWidth;
    $heightOfAWindow = $floorHeight - 0.6;
  
    move -a (-(($floorWidth/2)-(($widthOfAWindow/2)+0.3))) ($floorStartingHeight + ($floorHeight/2)) (-($floorDepth/2));
    scale -a 0.3 ($heightOfAWindow) ($widthOfAWindow);
  
    parentConstraint -mo |locObj_moveRotate `ls -sl`;
  
    $x=0;
    for ($x = $windowsPerWidth; $x >1; $x--) {
        duplicate;
        move -r ($widthOfAWindow+0.3) 0 0;
      
        parentConstraint -mo |locObj_moveRotate `ls -sl`;
    }
// Building Windows on This Side Completed.

}
// EnD of Proceeder, Making A Floor.
//***************************************************************************************************************


Some possible bugs:  Windows duplicating math should be refined. I have seen some offsets of window placements with some values.
Higher File size in Hard Disk and takes a lot virtual Memory(RAM)-  I have used Maya "Parent Constraint" to parent every piece in respective building to a locator, which you will be using to move buildings. But Constraints takes a lot capacity in hard driver to save the file as well as a lot memory in RAM. So you will run out of memory after you created some buildings. So the recommended solution to get rid of this bug is; after you created and moved the building to the desired location you can delete all the 'Constraints' by - "Edit >Delete All by type > Constraints" or Select "skyScrapers_grp" group in outliner and then "Edit > Delete by type > Constraints". That will take care of your problem but you will loos the ability of moving and rotating your building.


Anyway I have thought of some solutions to get rid of above bugs but unfortunately I won't be fixing this particular script as this was only a test.

If you would like to test this script, copy and past above script in to a text editor and save it by giving "skyscrapers_builderUI.mel" as the file name in "maya\scripts" folder. (You will find "maya\scripts" folder in your documents folder) And restart Maya. In Maya 'Command Line' type "skyscrapers_builderUI" and hit 'Enter' on the keyboard. If you did everything fine you Should see following dialog box.
After you hit "Built It" button script will built your building. (Please be Patience, sometimes script takes a few seconds, maybe minutes, depending on higher values you entered, to build up meshes.). After building was made you will see a locator has been created in global 0, 0, 0 position. Select the locator and it will allow you to Move or Rotate your Building. I am afraid for this version Scaling doesn't available, but you can be clever and change the script for your need.

See you Next time...

Happy Scripting...

Rumesh Tharanga.