Easy MEL question about randomizing rotation

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 04 April 2009   #1
Easy MEL question about randomizing rotation

I've set up this simple script for the rotation on each access to happen every 10 frames with values of -10, 10:

if (frame%10==0)
{
scanner.rotateZ = rand(-10,10);
}


The problem I have is the object pops to the next rotation when it hits that 10th frame versus animating over time to the next rotation. What do I need to add to this to make it animate over time, if it's at all possible? I'm assuming it needs to come up with the randomized values first then plot a course using all 3 axis to get to the next value @ the next 10th frame?


 
Old 04 April 2009   #2
that depends on what you need as your result... you have two options:

1. create an animation and set keyframes with random values.

2. you can script an procedural animation, which implements some kind of counter and updates the rotation each frame.
 
Old 04 April 2009   #3
Don't use expressions. Write a script to keyframe the random values.
 
Old 04 April 2009   #4
Originally Posted by Robert Bateman: Don't use expressions. Write a script to keyframe the random values.


ahh didn't think of that. I'll have to noodle through how to do that. Thanks.
 
Old 04 April 2009   #5
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



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
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 12:41 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.