Maya Training

Creating characters In Maya and Zbrush

Maya Training

Creating character renders in Maya 2017 and Arnold

Maya Training

Spach-Alspaugh House the complete courseware
You are here > Home > SimplyMaya Community Forums

Welcome to Simply Maya

Please Sign in or Sign up for an account

Member Login

Lost your password?

Not a member yet? Sign Up!

Old 24-09-2007, 08:58 PM   #1
Registered User
Join Date: Feb 2007
Location: India
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default Rotating faces randomly

I am very new to mel commands,
I have split my polygon faces in to single 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
Nirmal_c is offline   Reply With Quote
Old 21-10-2007, 07:59 AM   #2
Registered User
BennyK's Avatar
Join Date: Oct 2007
Location: IL
Posts: 738
Thanks: 0
Thanked 3 Times in 3 Posts

I suggest you'll look through Maya help for Mel language first.
BennyK is offline   Reply With Quote
Old 23-02-2008, 07:50 AM   #3
Registered User
Weyu's Avatar
Join Date: Nov 2006
Location: Sweden
Posts: 482
Thanks: 0
Thanked 2 Times in 3 Posts

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.

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.

Last edited by Weyu : 25-02-2008 at 10:16 AM.
Weyu is offline   Reply With Quote

Similar Threads
Thread Thread Starter Forum Replies Last Post
Keep faces on Sircharles Maya Basics & Newbie Lounge 2 07-12-2010 01:20 PM

Thread Tools

A little bit about who we are
Links you might find useful
Catch up with SimplyMaya
SimplyMaya specialises in Maya tutorials. We offer over 1,000 individual Maya training videos, ranging from basic Maya tutorials through to intermediate Maya tutorials. Our tutorials are created by instructors with industry experience and are designed to get you up and running in Maya quickly without making it seem like hard work.

Copyright © 1999-2017 SimplyMaya - vBulletin® Copyright © 2000-2017, Jelsoft Enterprises Ltd.