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 |
I suggest you'll look through Maya help for Mel language first.
http://www.highend3d.com/maya/tutori...g-MEL-264.html |
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. :) |
All times are GMT. The time now is 08:52 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Simply Maya 2018