Repository navigation
Description
Part of #326. Batch 3 — depends on #336 and #327.
This workstream closes no wall of its own, and it is the one that makes the others compose. Asked how the SVG reel was built, its author describes the mechanism plainly: GSAP animates a plain JavaScript object, {x, y, s, r}, and a function translates those values into attributes on every frame. That single indirection is what produces the hand-rolled 3D wireframe crystal, the stones floating on a sine, the commit counter, and a typewriter driven by a character count. None of it is reachable from presets, and none of it is reachable from expressions alone, because an expression has nothing time-varying of its own to read.
Owned files
crates/rustmotion-core/src/schema/vars.rs(new)crates/rustmotion-core/src/engine/animator.rs(variable track resolution only — coordinate with repeat, yoyo, steps easing, and a declarative camera shake #330, which owns the modifier work in the same file)
Do NOT write: schema/scenario.rs (#336 registers the vars field), expr/** (#327 exposes $name lookup through a resolver).
Deliverables
-
Declared and animated on the absolute timeline, which is only coherent because Place scenes on an absolute timeline with a beat grid #336 exists:
"vars": { "keyDraw": { "default": 0, "animation": [{ "at": "@4.85s", "to": 1, "duration": "3b", "easing": "ease_in_out" }] } }
-
Any expression reads
$keyDraw. Resolution happens before the node expressions that consume it, in the same topological pass Let a node read another node's geometry and a text's measurements #328 builds. -
Two scopes — scenario level, visible everywhere, and scene level, which shadows it. A scene-level variable referenced from another scene is the same error as a cross-scene node reference.
-
Variables participate in static folding. A variable with no animation is a constant and folds at load like any other.
Acceptance
- A wireframe drawn as
for-eachover edges, with each edge's opacity an expression over a rotation variable, renders as a rotating wireframe sin($T * 2) * 12on a translate produces a float that survives a scene boundary, unlike a per-scene preset- A variable with no animation costs nothing per frame
Activity
[-]WS-3 references: node identity, cross-node reads and text measurement[/-][+]WS-4 variables: animated scalars that attributes derive from[/+][-]WS-4 variables: animated scalars that attributes derive from[/-][+]Animate scalars that other attributes derive from[/+]LeadcodeDev commentedon Sep 26, 2026
Delivered on
mainat 187cf7c (squash of #340). Verified present onmain, not taken on the PR's word.