From e2daafff2ed8cc20438d05722575db69fa9ba823 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 17 Nov 2026 02:19:28 -0300 Subject: anim: play's .lag staggers its animations, manim's lag ratio, 0 by default The option was read into every key (default 0.08) and never used. Now animation i of a play of n starts i * lag * each after the play does, each = seconds / (1 + lag * (n - 1)), so the last still ends with the play and the play keeps its length: manim's AnimationGroup run to a run_time. A lag of 1 is one after another. An object two animations of one play change moves with the first (Change.at); the camera with the first camera animation. Compiled and live scenes agree: a live play shows an animation from its own key's start, as the compiled lookup does. Default 0, so every key of a scene without .lag is the bits it was (start + 0, seconds / 1). What changes: examples/manual.zig, slide 1: 83, C0, 01 and add eax, 1 were written all at once over 1.5 s, now one after another (0.79 s each, 0.24 s apart); the six labels and three bytes of the flight played together, now in order, 0.12 s apart, 0.58 s each (exported frames 22.0- 23.4 s and 25.1-26.4 s). vecanim's intro passes .lag to a play of one write: unchanged. Tests: anim: a lagged play (four at 0.5, then two at 1) live against compiled at 16 instants, and its times. test-anim, test-talk, test-manual pass; the compiled scene's export (92 frames), the talk's two (364) and every scene screenshot are byte-identical to before, but for the player bar's wall-clock record time; manual's exports differ in those 29 frames only, its screenshots not at all. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T --- README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 042a261..7d8b1a9 100644 --- a/README.md +++ b/README.md @@ -559,8 +559,13 @@ were added; each call returns a handle. Animations are methods of the handle: `w `fadeIn`, `fadeOut`, `transformInto`, `move(.{ .x, .y, .scale, .rotation, .opacity })`, `scaleTo`, `rotate`, `indicate`; plus `anim.camera(...)` and `value.to(x)`. `play` runs a tuple (or array) of them together; its -options are `.seconds`, `.ease` (any `fn (f32) f32`) and `.lag` (manim's -lag ratio). `wait` moves time on; in a live scene, `pause()` makes what +options are `.seconds`, `.ease` (any `fn (f32) f32`) and `.lag`, manim's +lag ratio (0 by default, all at once): each animation starts `lag` of its +own length after the one before, in the order given, and the play still +lasts `.seconds`, the last ending with it, so each of n lasts +`seconds / (1 + lag * (n - 1))`; a lag of 1 plays them one after +another. An object two animations of one play change is timed by the +first. `wait` moves time on; in a live scene, `pause()` makes what follows wait for a click (see Talks). Positions are scene units: 1280x720 of them show at camera zoom 1, the origin in the middle, y down. The page behind them is the scene file's `pub const background = 0xRRGGBB` (manim's grey without -- cgit v1.3