PDA

View Full Version : Easy MEL question about randomizing rotation


constantine1
04-15-2009, 04:22 PM
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?

sleepyfox
04-15-2009, 04:34 PM
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.

Robert Bateman
04-15-2009, 04:42 PM
Don't use expressions. Write a script to keyframe the random values.

constantine1
04-15-2009, 04:49 PM
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.

CGTalk Moderation
04-15-2009, 04:49 PM
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.