Cl_pyramid_02.mel

[index]

3th April 2009   5:9pm 27sec
/home/cleong20/Desktop/vsfx705/mel/Cl_pyramid_02.mel


Pyramid_creation_mel



//DECLARE Global NAMES//
  
global string $Xslider ;
global string $Yslider ;
global string $Zslider ;
  
//END of Global Declaration//
//Geting Value of sliders//
  
global proc float getSliderValueX()
{
global string $Xslider ;
  
float     $XunitValue = `floatSliderGrp -q -v  $Xslider`;
return     $XunitValue;
}
//---------------------------------//
global proc float getSliderValueY()
{
  
global string $Yslider ;
  
float      $YunitValue = `floatSliderGrp -q -v  $Yslider`;
return  $YunitValue;
}
//--------------------------------//
global proc float getSliderValueZ()
{
  
global string $Zslider ;
  
float     $ZunitValue = `floatSliderGrp -q -v  $Zslider`;
return     $ZunitValue;
}
  
  
//MAKING THE PYRAMID//-----------------------------
  
global proc Pyr1 ()
{
for ($x =0 ; $x < getSliderValueX(); $x++) {
for ($y =0 ; $y < getSliderValueY(); $y++) {
for ($z = 0; $z <  getSliderValueZ(); $z++) {
if($x >= -5 && $x <=5 || $y >= 0 && $y <= 5) 
    {
    float $cSize = rand(0,0.5);
    polyCube  -h $cSize ;
  
        move     ($x * 0.1) ($y * -0.5) ($z * 0.1);
         scale   ($y * (rand (0.1,0.5))) ($y * (rand(0.1,0.5)) ) ($y * (rand (0.1,0.5)));
            
    }
else 
    /*nothing*/    ;
    }
    }
    }         
}
//Groupin the Pyramid//-------------------------
global proc makePyr1()
{
Pyr1();
//polyPlane;
//scale 100 100 100;
}
//-----------------------------------
global proc deletestuff()
{
select -all;
delete;
}
//------------------------------------
/*global proc copyPyr()
    {
    //    string $masterPyr[];
        select -all
        group;
        ls 
        instance;
    
    for ( $x = 0; $x <= 5; $x++){
        //for ( $z = 0: $z <= 5; $z++){
            
            move (0.5 * $x) (0.5 * $x) 0;
            
            //}
        }
for ($i=1; $i<=5; ++$i) instance -st;
  
}*/
//--------------------------------------------
// makeGrid.mel
//global string $master[];
//global string $groupName;
  
global proc Dup_Pyr()
{ 
string $master[];
string $selectall;
// Create the master sphere
select -all;
polyUnite;
string     $list[];
int        $n = 0;
for($x = 0; $x < 8; $x++) {
    for($z = 0; $z < 8; $z++) {
        $inst = `instance`;
        $list[$n] = $inst[0];
        move (rand(1,5) * $x) (rand(1,5)) (1 * $z);
        $n++;
        }
    }
  
string $groupName = `group $list`;
move 0 2 0;
}