HW

Parametric Sequencer

Algorithm and reasoning behind a CAD-like approach to defining 3D animation sequences.

The CAD-like Idea

Traditional animation tools use keyframes with absolute timestamps. Change one keyframe's timing and you must manually adjust everything that follows. The parametric sequencer instead uses declarative, constraint-based definitions—similar to CAD, where you define relationships (e.g. "this hole is concentric with that cylinder") rather than raw coordinates.

Why this matters for assembly animations:

  • Steps depend on other steps: "attach screw after body is in place"
  • Parts attach to specific points on other parts (markers)
  • Reordering or retiming one step should propagate automatically

The sequencer converts a declarative scene definition into a flat, time-resolved keyframe stream. You define what should happen and when relative to what; the reconciliation algorithm figures out when in absolute time and produces interpolated state for any playback time.

Models vs SceneObjects

Models are reusable 3D assets (e.g. main-body, m3x8-shcs screw). Each model can have multiple LODs and positional markers (insert points, attachment locations). Models are defined in Blender and exported via a headless script—markers are EMPTY objects in Blender, exported with location and rotation.

SceneObjects are instances in a scene that reference a model. Each SceneObject has position, markers, and animation nodes. SceneObjects are defined in the sequencer editor, not in Blender. One model can be used by many SceneObjects (e.g. multiple screws, each an instance of the same model).

Animation Reconciliation Algorithm

Reconciliation converts a declarative scene (nodes with relative timing and positioning) into a flat keyframe stream that can be sampled at any time.

Pipeline

  1. Nodes → keyframes — Each node produces one or more keyframes with position, rotation, opacity, camera state, etc.
  2. Resolve time — Convert relative timing (e.g. "start 0.5s after node X ends") to absolute start times. Process absolute times first; resolve dependents iteratively. Cycles and missing dependencies are detected and reported.
  3. Extend time — Ensure each keyframe has valid start/end times for interpolation boundaries.
  4. Sort for markers — Model keyframes that use marker-based positioning must be processed after their parent. Topological sort by marker dependencies; cycles are detected and reported.
  5. Animation state — For a given currentTime, walk keyframes and interpolate between previous and target state. Models start at default state (opacity 0); each keyframe applies its target values over its duration. Position/opacity use linear interpolation; rotation uses SLERP.

Two Separate Concepts

Relative timing and marker-based positioning are completely independent. One governs when keyframes occur; the other governs where objects are positioned.

1. Relative Timing (keyframe order)

Nodes can depend on other nodes for when they start (e.g. "start 0.5s after node1 ends"). Dependencies are resolved in topological order. This is purely about the temporal ordering of keyframes on the timeline.

2. Marker-Based Positioning (hierarchy-less spatial relationships)

Marker-based positioning answers: where is this object, relative to another object? It does not create a scene-graph hierarchy. Each keyframe can independently choose: position at a marker on object X, or position absolutely. That allows:

  • Combine — Move a screw to a marker on the main part → from that keyframe onward, they move together.
  • Separate — A later keyframe can give the screw or the part an absolute position → they now move independently. You can animate the main part without screws following, or vice versa.
  • Re-combine — A later keyframe can again position the screw at the marker → they move together from then on.

The goal: a reliable way to position objects relative to each other while being able to separate and combine them over time—without baking a real parent-child hierarchy into the scene. The "hierarchy" is per-keyframe, not structural.

Interpolation

All animated values are interpolated within each keyframe's duration. The result is continuous state for any playback time.