Monday, November 26, 2012

Simple Mel Loop Example

Here is an example of a simple "for each" loop:
string $mySel[] = `ls -sl`;

//print $mySel;

for ($each in $mySel){

float $posX = rand(-1.5,1.5);

float $posY = rand(-1.5,1.5);

float $posZ = rand(-1.5,1.5);

float $scaleX = rand(-1,1);

float $scaleY = rand(-1,1);

float $scaleZ = rand(-1,1);

float $rotX = rand(0,360);

float $rotY = rand(0,360);

float $rotZ = rand(0,360);

select -r $each;

move -r $posX $posY $posZ;

scale $scaleX $scaleY $scaleZ;

rotate $rotX $rotY $rotZ;

}

select $mySel;

1 comment:

  1. Very enlightening stuff. Just wish to say your article is as astonishing.

    BEST Podiatry Websites Design for Your Podiatry Clinic.

    ReplyDelete