Project 1 - Looping geometry Mel Statements


This page shows the process of using loops and if statements to make certain patterns of geometry.

The code I used is pretty simple, instead of translating a MEL generated primitive, I decided to use an existing model within Maya, and duplicate it and translate it with MEL commands.

Here is the code that I used for the following images.

master = `ls -sl`;
  
for($x = 0; $x < 15; $x++) { 
    for($y = 0; $y < 30; $y++) {
  
        //apply tnode (tranformation node array) to selection instance...
        string $tnode[] = `instance $master`;
        
        //insert tnode array into tranformation loops...
        move (sin($x)*($x*5)*sin($y) ) ($y*10) (cos($x)*($x*5)*sin($y)) $tnode[0];
        scale ($x*0.03) ($x*0.03) ($x*0.03) $tnode[0];
    }
}