How Maya counts time

 
 
 

Behind the scenes, Maya converts each frame value to a 32-bit integer representation, called a tick. Ticks are the smallest increment of time in Maya. Each tick represents 1/6000 of a second. So Maya counts 6000 ticks per second [tps], and at a rate of 24 frames per second [fps] that's 250 ticks per frame [tpf].

Although all scenes use the same tps, the number of tpf varies depending on the playback speed you specify. To determine the number of tpf at your selected playback speed, divide the tps (6000) by the playback speed you're using. For example, at 15 fps, you have 400 tpf (6000/15).

Since ticks are integers, fps must also be an integer number. This means certain fractional frame values that would require non-integer tick values can't be represented exactly in Maya. Although the times that can be represented exactly depend on the playback speed, all playback speeds have accuracy limits based on the conversion between frames and ticks.

For example: At a playback speed of 24 fps, you are limited to 1 tick every 0.004 frames. If you execute currentTime 25.55 at 24 fps, Maya rounds the value to the nearest tick, setting the current time to 25.552. (See Predicting exact frame values, below, for more.)

Boundaries of the timeline

To avoid issues with numerical flow, ticks are forced to lie in the range of 32-bit (signed) integers. This limits the minimum/maximum frame number that can be represented in your scene to: int32_min/tpf and int32_max/tpf.

For example, if your scene playback speed is 24 fps, which limits the tpf to 250, you have approximately 8 589 934 positive frames. The same applies to negative frame values, meaning that at a rate of 250 tpf you have a total of approximately 16 million frames. Time is clamped to these limits if you attempt to set a frame outside of the maximum/minimum range:

currentTime 10e6;
// Result: 8589934.588 //

Predicting exact frame values

To predict whether frame values are rounded up or down, you can convert values between the various representations Maya uses:

  1. To convert the frame value to ticks, multiply the frame value (for example, 25.55) by your tpf.

    25.55 x 250 tpf = 6387.5 ticks

    If the tick decimal value is 0.5 or greater, Maya rounds this value up, and if the decimal value is less than 0.5, the value is rounded down.

    In this example, frame 25.55 is equivalent to tick 6387.5, which is rounded up to 6388.

  2. Divide the rounded tick value by tpf to get the exact frame value.

    6388/250 tpf = 25.552 seconds

Creative Commons License Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License