timing
Class info¶
🛈 DocStrings¶
Duration detection and sample-time planning.
EPSILON
module-attribute
¶
One 60 fps frame: the last tile and the loop probe sit this far before the cycle end.
LCM_FACTOR
module-attribute
¶
Use the LCM of loop periods only if it is at most this many times the longest period.
detect_duration
¶
detect_duration(animations: list[AnimationTiming], override: float | None = None) -> DurationInfo
Pick the time span to sample.
- Infinite animations contribute their loop period (
duration, doubled foralternate). Several periods are combined with their least common multiple if that stays reasonable, otherwise the longest period wins. - A positive start (
begin/delay) of a looping animation is added, so the warm-up before the first iteration is visible. - Finite animations contribute their end time (delay + duration x iterations).
Source code in src/framesheet/timing.py
epsilon
¶
sample_times
¶
Evenly spaced times over [0, duration].
The last sample is taken one 60 fps frame before the end: at exactly t=end an
infinite animation has already wrapped to its first frame, which would make every
loop look seamless.