Introduction to Maya - Modeling Fundamentals Vol 2
This course will look in the fundamentals of modeling in Maya with an emphasis on creating good topology. It's aimed at people that have some modeling experience in Maya but are having trouble with complex objects.
# 1 24-09-2007 , 07:58 PM
Registered User
Join Date: Feb 2007
Location: India
Posts: 28

Rotating faces randomly

Hi
I am very new to mel commands,
I have split my polygon faces in to single pieces.now i have more the 1000 faces.
I want to animate them randomly (transformer effect) and combine to the shape. I cant do it manually. So some one help me how to rotate and transform all the faces on their local axes randomly .

Waiting for someones reply

# 2 21-10-2007 , 06:59 AM
BennyK's Avatar
Registered User
Join Date: Oct 2007
Location: IL
Posts: 738

# 3 23-02-2008 , 07:50 AM
Weyu's Avatar
Registered User
Join Date: Nov 2006
Location: Sweden
Posts: 482
I just started learning MEL and I came across this script on cgtalk, maybe it can give you a clue at least.

Going to try it when I get home.

{
string $obj[] = `ls -sl`;
float $RandomValue = .5;
for ($i=0; $i < size($obj);$i++)
{
setAttr ($obj[$i] + ".rotateX") `rand $RandomValue`;
setAttr ($obj[$i] + ".rotateY") `rand $RandomValue`;
// setAttr ($obj[$i] + ".rotateZ") `rand $RandomValue`;
}
}

Remember to change "float $RandomValue = .5;" to a number that is good for you- and I'm not certain that you need " string $obj[] = `ls -sl`;"

And have in mind that "// setAttr ($obj[$i] + ".rotateZ") `rand $RandomValue`;"
was writen like that becouse he didnt want it to rotate in the Z axis so just remove those slashes to active the Z axis to.

Good luck. user added image

Edit: And Benny have in mind that you need to know MEL to make scripts but not to copy them so just ask for help and things like this can be done.

You should be able to key it like usual to animate it.

Second edit: I tried the script and it worked perfectly just copy paste and change your attributes, it worked good when keyed to. user added image


Last edited by Weyu; 25-02-2008 at 10:16 AM.
Posting Rules Forum Rules
You may not post new threads | You may not post replies | You may not post attachments | You may not edit your posts | BB code is On | Smilies are On | [IMG] code is On | HTML code is Off

Similar Threads