FireSkull
06-03-2009, 12:23 PM
Hi MEL Masters,
I have a query for all MEL experts. I am new to MEL, so I am in a learning phase right now.
The problem is that I have created a polyCube in Maya. Like all cubes, it has 8 vertices. What I'm trying to do is that I want each and every vertex of the polyCube to move at a random X,Y,Z position thereby creating a deformed cube.
The solution in my mind is that first i create three variables as;
float $Xpos = rand(-12,12)
float $Ypos = rand(-12,12)
float $Zpos = rand(-12,12)
and then assign these variables as X,Y,Z position of each vertex like;
move $Xpos $Ypos $Zpos;
I understand that for this I have to use the for() loop so that each time a distorted cube is created it will have a different shape.
Finally i will make a procedure that will accept the number of distorted cubes as input form the user and gives the result. Something like;
global proc CreateDistortedCubes(int $NoOfCubes)
If anyone can write me a MEL for this or at least give me a clue in the form of a chunk of code, i'll be greatful.
I can handle the for() loop on my own. I just want to know how to access each vertex of a polyCube through MEL, and move each vertex dynamically through rand() command.
Thank you.
I have a query for all MEL experts. I am new to MEL, so I am in a learning phase right now.
The problem is that I have created a polyCube in Maya. Like all cubes, it has 8 vertices. What I'm trying to do is that I want each and every vertex of the polyCube to move at a random X,Y,Z position thereby creating a deformed cube.
The solution in my mind is that first i create three variables as;
float $Xpos = rand(-12,12)
float $Ypos = rand(-12,12)
float $Zpos = rand(-12,12)
and then assign these variables as X,Y,Z position of each vertex like;
move $Xpos $Ypos $Zpos;
I understand that for this I have to use the for() loop so that each time a distorted cube is created it will have a different shape.
Finally i will make a procedure that will accept the number of distorted cubes as input form the user and gives the result. Something like;
global proc CreateDistortedCubes(int $NoOfCubes)
If anyone can write me a MEL for this or at least give me a clue in the form of a chunk of code, i'll be greatful.
I can handle the for() loop on my own. I just want to know how to access each vertex of a polyCube through MEL, and move each vertex dynamically through rand() command.
Thank you.
