# Anim8or Community

• October 18, 2017, 03:56:43 am
• Welcome, Guest

### News:

An update to Anim8or, v1.00b, is available with a few bug fixes. Get your copy HERE. See the "ReadMe" file for details.

Pages: [1]

### AuthorTopic: Loop?  (Read 2528 times)

#### Mreenav D

• Full Member
• Posts: 117
• Anim8or and Mental Ray=Super Cool combo
##### Loop?
« on: August 06, 2009, 07:28:03 am »

Is there a way to make a sequence loop over and over again.I'm making a wheel rotate but after a few seconds (about 2) the wheel keeps on moving but it no longer rotates.Help is appreciated. I tried the loop option in the options menu but instead of continuously rotating it just restarts the animation from the beginning
« Last Edit: August 06, 2009, 07:31:02 am by Mreenav D »
Logged

• Sr. Member
• Posts: 600
##### Re: Loop?
« Reply #1 on: August 06, 2009, 10:46:16 am »

hmm

you should be  able to do it without a script but .... search for ensonique and script
Logged

#### ENSONIQ5

• Sr. Member
• Posts: 925
##### Re: Loop?
« Reply #2 on: August 06, 2009, 12:21:51 pm »

Hi Mreenav D.  Below is an extract from a previous post where I explained the use of scripts to generate rotation:

The following script defines a rotation using quaternions, without a RPY conversion (I did not write this):

float \$speed;
\$speed=-.5;
\$orientation = (sin(\$speed*time),0,0,cos(\$speed*time));

Adjusting the \$speed variable alters the speed (obviously), and the rotation axis can be changed by changing which of the first 3 quaternion values are affected by the "sin" function.  For example, the script below rotates in a different axis to the one above:

float \$speed;
\$speed=-.5;
\$orientation = (0,sin(\$speed*time),0,cos(\$speed*time));

I have to admit that I struggle a bit with the quaternion concept, but this script does the job nicely and that's all I really care about!!

EDIT:  This basic script can be modified to get different effects.  For example, I wrote the script below for a Solar system model, which I wanted to run at a certain speed for a given time, and subsequently accelerate for the remainder of the animation:

float \$speed;
float \$trigger;
float \$rate;
\$speed=0.004155;
\$trigger = max(time, 29);
\$rate=(\$trigger*3.5)-100.5;
\$orientation = (0,sin((\$speed*\$rate*\$rate*time)+2.5),0,cos((\$speed*\$rate*\$rate*time)+2.5));

The \$speed variable sets the initial speed of rotation (in this case it's Mercury's orbit I think); the \$trigger variable is either the time, or a preset figure, whichever is higher, which sets the trigger time for acceleration; and the values in the \$rate calculation were chosen so that \$rate would equal 1 for the initial period, and increase in a linear fashion thereafter.  Since \$rate is squared in the \$orientation calculations the result is an acceleration.  The values of "2.5" in the \$orientation calculation set the starting rotation of the object being affected by this script.
Logged

#### kreator

• Hero Member
• Posts: 1113
• Anim8or, Blender, & Carrara. A Great Combination!
##### Re: Loop?
« Reply #3 on: August 06, 2009, 11:15:26 pm »

Just an Observation Tony here,  there is no mention of where to place the script, so ....I made a little video,,,

http://www.animanon.com/TUTORIALS/Controller_scripts1.wmv

Logged
O

#### johnar

• Sr. Member
• Posts: 812
• Make it, Move it--Give it Life
##### Re: Loop?
« Reply #4 on: August 07, 2009, 01:09:32 am »

If scripts are a bit confusing for you, a perfect, continuous rotation can be done with keyframes.
This can be done in sequence or scene mode, but if you're using version 0.97d, it should be done in sequence mode, because you can't drag select multiple kerys in Scene mode.
0.95 is good for this, and it will be reintroduced into 1 of the next anim8or updates. (thanks Steve).

I'll try to explain here, in the 5 minutes that i've got on the internet today.

Lets say your rotation is 96 frames long, for 1 rotation. (4x24 frames per sec).
You first key should be '0' degrees.
Your last frame should be blank, and your 2nd to last key should be 359 degrees.
(leave last key blank, so that when you copy and paste the rotation sequence, paste the sequence onto the last frame of the 1st sequence. Therfore, in scene mode, the sequence degrees will go from 359 to 0, and will continue on)
Your middle key should be 180.
Now you need to force some keys. Possibly every key for the first 24 frames, and every key for the last 24 frames.  Thats ok, coz you'll only need to do it once.

Some maths here, so i hope i get it right.
Divide the number of degrees by the number of frames.  360 divided by 96 = 3.75.
To make it easier, we'll say 4.  So, what that means is the object rotates at approximately 4 degrees per frame.
So, frame 1, (after frame 0, which is 0 degrees,), shoulkd be set at 4 degress. Frame 2 at 8 degrees, frame 3 at 12 degrees and so on. Stop at frame 24.
Now go to frame 72. (at 3/4 of the length of the rotation)
At this frame, rotation should be at about 270 degrees.
Next frame set at 274 degrees, then 278, and so on.
Remember that the exact division was 3.75 degrees per frame, so during these last 24 frames, adding 4 will not be exactly right. You need to make a few frames advance by only 3 degrees to compensate. Make sure that the 2nd to last frame is 356 degrees, and the very last frame is 0.

If you've done this in sequnce mode, then when you're in scene mode, simpley continue to add the sequence onto the last frame of the already added sequence.
Anim8or will say something like, " you've pasted a sequence onto a sequence, would you like to turn these into normal keys'. Click yes.

Good luck.

Btw.  Save/Export the sequnce. It could come in handy in the future.
« Last Edit: August 07, 2009, 01:12:00 am by johnar »
Logged
%

#### ENSONIQ5

• Sr. Member
• Posts: 925
##### Re: Loop?
« Reply #5 on: August 07, 2009, 02:41:36 am »

Just an Observation Tony here,  there is no mention of where to place the script, so ....I made a little video,,,

http://www.animanon.com/TUTORIALS/Controller_scripts1.wmv

Quite right, thanks Kev!
Logged

#### Mreenav D

• Full Member
• Posts: 117
• Anim8or and Mental Ray=Super Cool combo
##### Re: Loop?
« Reply #6 on: August 07, 2009, 06:08:11 pm »

Thanks for the help it worked
Logged
Pages: [1]