View Single Post
# 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.