Skip to content

Animate scalars that other attributes derive from #329

Description

@LeadcodeDev

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

Do NOT write: schema/scenario.rs (#336 registers the vars field), expr/** (#327 exposes $name lookup through a resolver).

Deliverables

  1. 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" }] }
    }
  2. 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.

  3. 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.

  4. 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-each over edges, with each edge's opacity an expression over a rotation variable, renders as a rotating wireframe
  • sin($T * 2) * 12 on 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions