[Home]

[Dave G's Animation System]

[Hints and Tricks]

Multiple TimeLines
in a Single Scene

When I wrote the particle animation system I assumed that a "RESET" command would be useful. Having multiple options within the system, and most likely having many objects in a scene, it made sense to be able to "RESET" the particle system back to a default.

I took the same approach with the bezier curve system. It made sense to automatically reset all variables to a default value.

However I assumed that most scenes would have only a single TimeLine. There didn't seem to be much of a need for multiple TimeLines.

But there is nothing stopping you from having as many TimeLines as you wish running through your scene. There are just a few things to keep in mind.

  1. The values of the DGTL variables will reflect the last TimeLine calculated by including DGTL.INC.
  2. If you want a second TimeLine with fewer segments you must redeclare all unwanted segments with a duration of zero
  3. If you don't re-declare a segment's duration DGTL will use the value you declared for the previous TimeLine.
  4. To get back to previously declared TimeLine values you must either store them in variables yourself or re-declare and calculate the whole TimeLine.

Let me give a short example. Here is the first TimeLine in my scene:

#declare DGTLSegment01 = 1
#declare DGTLSegment02 = 2
#declare DGTLSegment03 = 3
#declare DGTLSegment04 = 4
#include "DGTL.INC"

The total duration of all segments in the TimeLine is 10 units.

If I want a second TimeLine that is also 10 units long, with 5 units in the first segment and 5 units in the second segment, here is the code:

#declare DGTLSegment01 = 5
#declare DGTLSegment02 = 5
#declare DGTLSegment03 = 0
#declare DGTLSegment04 = 0
#include "DGTL.INC"

If I don't redeclare segments 3 and 4 then they will still have a duration for the second TimeLine.

I don't have to make the different timelines have the same total duration. Here is a third TimeLine with a total duration of 5.

#declare DGTLSegment01 = 0
#declare DGTLSegment02 = 1
#declare DGTLSegment03 = 1
#declare DGTLSegment04 = 3
#include "DGTL.INC"

If I animated a 10 frame animation of these three timelines, (assuming no cyclical animation) the segments would progress as follows:

Frame Number

Current Segment for
TimeLine #1

Current Segment for
TimeLine #2

Current Segment for
TimeLine #3

1

1

1

2

2

2

1

2

3

2

1

3

4

3

1

3

5

3

1

4

6

3

2

4

7

4

2

4

8

4

2

4

9

4

2

4

10

4

2

4

The only thing I want to make perfectly clear is that the DGTL returned variables only reflect the last TimeLine that was calculated. To calculate a new TimeLine simply declare the variables and include DGTL.INC.

Make sure you perform all the animation you want to for one TimeLine before you let DGTL calculate the next TimeLine.

Hosted by Geocities, your free personal home page on the web.

This page copyright David Govoni 1997

Any comments, or suggestions?
E-mail me
.

1