SimplyMaya Forums

Welcome to the forum, feel free to ask questions here.

Home / forum / Animation / Mel Scripts & Programming / Rotating faces randomly
Register FAQ Members List Calendar Mark Forums Read

New Thread
 
Thread Tools
Old 24-09-2007, 07:58 PM   #1
Nirmal_c
Registered User
 
Join Date: Feb 2007
Location: India
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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
Nirmal_c is offline   Reply With Quote
Old 21-10-2007, 06:59 AM   #2
BennyK
Registered User
 
BennyK's Avatar
 
Join Date: Oct 2007
Location: IL
Posts: 738
Thanks: 0
Thanked 3 Times in 3 Posts
Default

I suggest you'll look through Maya help for Mel language first.
http://www.highend3d.com/maya/tutori...g-MEL-264.html
BennyK is offline   Reply With Quote
Old 23-02-2008, 06:50 AM   #3
Weyu
Registered User
 
Weyu's Avatar
 
Join Date: Nov 2006
Location: Sweden
Posts: 482
Thanks: 0
Thanked 2 Times in 3 Posts
Default

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 09:16 AM.
Weyu is offline   Reply With Quote
New Thread

« Previous Thread | Next Thread »

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

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

1 Month

$34

Month-to-month billing
$34/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
 
 

3 months

$87

Billing every 3 months
$29/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $5 per month or $15 in total compared to monthly billing with this package.

12 months

$288

Billing every 12 months
$24/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $10 per month or $120 in total compared to monthly billing with this package.

Your plan will automatically renew. You can cancel at any time via your PayPal account to avoid being charged again.

You can view the FAQ on our video plans here. You can contact us directly here. By clicking one of the buttons above, you agree to our Terms and Privacy Policy.