Skip to content

<Instances> whose placements change are frozen in a video but move in stills #85

Closed

Description

@SirSicard

Status: still present on main 3a70525 (re-tested 10 November).

What I ran

An <Instances> whose at list changes with the frame, rendered as a video and as stills of single frames:

import { AbsoluteFill, Composition, registerRoot, useCurrentFrame } from "raea";
import { Instances, Sphere, type Instance } from "raea/3d";
import { Camera3d } from "raea/camera";
import { AmbientLight, DirectionalLight } from "raea/light";
import { StandardMaterial } from "raea/pbr";
import { Transform } from "raea/transform";
// 20 spheres that slide right by 6 units over the shot: their `at` changes every frame
function M() {
  const f = useCurrentFrame();
  const at: Instance[] = Array.from({ length: 20 }, (_, i) => ({ position: [-8 + (i % 5) * 1.2 + f * 0.1, Math.floor(i / 5) * 1.2 - 2, 0], rotation: [0, 0, 0], scale: 0.4 }));
  return (
    <AbsoluteFill style={{ background: "#000" }}>
      <>
        <Camera3d transform={Transform.fromXyz(0, 0, 14).lookingAt([0, 0, 0])} />
        <AmbientLight brightness={300} />
        <DirectionalLight transform={Transform.fromXyz(2, 4, 6).lookingAt([0, 0, 0])} illuminance={9000} />
        <Instances name="dots" at={at} shadow={false}><Sphere radius={1} /><StandardMaterial base_color="#ffaa33" /></Instances>
      </>
    </AbsoluteFill>
  );
}
registerRoot(() => <Composition id="m" component={M} width={640} height={360} fps={30} durationInFrames={60} />);
raea render b3-move.tsx -o b3.mp4                 # frames 0 and 59 match
raea render b3-move.tsx --frame 59 -o f59.png     # moved

What happened

A test that slides 20 spheres to the right: in the video, frames 0 and 59 have the same x-centroid (35.3). --frame 59 on its own shows them moved (81.1). Stills from one --at 0,59 call are frozen too (35.3 both), so it's any multi-frame render, not only video. The only sign is a warning on stderr: WARN Instances <name>: its placements change over the shot; the first frame's are drawn.

What I expected

Either moving instances in the video, or a refusal. A warning among dozens of other stderr lines is easy to miss, and agents miss it.

Cause

instances_column writes only the first frame's at into the row's inst column (runtime/look/src/instances.rs:27-34, the warning at :30). The live path doesn't list inst as dynamic either (runtime/scene/src/live.rs, live_dynamic). The SDK documents the limit (sdk/render/src/3d/instances.tsx:20-23), but the video and the stills disagree.

A single still looks right because its own frame is its first frame.

Suggested fix

  • Now: make a changing at an error under raea render to a video (with an env opt-out), and have raea check --quick flag it.
  • Later: per-frame instance transforms, which is the same work as the memory fix in the instance memory issue.

raea 0.1.0 (installed) and main 3a70525 (source build); macOS on M5 Pro, 24 GB. File and line references are from 3a70525.


Generated by Claude Code

Activity

  1. shinyobjectz commented on Nov 12, 2026

    @shinyobjectz
    Owner

    Fixed on main in 6198166, and it ships in 0.1.2 (the release candidate has it). When an <Instances>'s at changes, every list it shows is now written once, and each frame says which list it draws, so the engine moves the copies frame by frame. The "first frame's are drawn" warning is gone.

    I checked it with your b3-move.tsx as written. In the video, the spheres' x-centroid is 143.4 at frame 0, 237.6 at frame 30 and 328.9 at frame 59. --frame 59 alone also gives 328.9, so the video and the stills now agree. One limit: a frame whose list has a different count from the first frame's holds the list before it.

  2. added a commit that references this issue on Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions