timeline¶
The per-Scene timeline: where every recorded animation is stored.
Mobs hold no animation storage of their own. Each Scene’s TimelineManager
owns one AttributeTimeline per animatable attribute (location, basis,
color, opacity, …), and each of those is a shared [1, N, W] buffer of every
Mob’s current values – each Mob owning rows keyed by its id – plus a log of
timestamped EditRecord entries describing how those rows changed.
set_state_to_times(times) materializes the whole Scene at the requested frame
times in one batched pass per attribute: a flat searchsorted selects each
row’s state, recorded function applications are re-executed with per-frame
interpolated arguments, and updaters run last.
Edits of the same rows may overlap in time, so replay windows are resolved rather than assumed: an edit’s effective end is extended over the windows of earlier-executed edits that overlap it, transitively, and functions replay through that extended window held at their final parameters. That is what makes overlapping and same-end edits rematerialize in execution order.
Lifespan is a Mob’s [spawn, despawn) interval; opacity is zeroed
outside it during materialization. Sub-Mobs obtained by indexing share their
source’s id, and therefore its rows and its lifespan; a clone gets a new id.
Classes
A Scene-owned timeline recording every Mob row for one attribute. |
|
Search structure over one attribute's edit log, on |
|
One recorded modification of an attribute's buffer rows. |
|
The [spawn, despawn) interval of one mob on its Scene timeline. |
|
A set of attribute-buffer rows stored as ordered [begin, end) runs. |
|
One mob's rows of one attribute over one frame window, described as endpoint states plus per-frame interpolation instead of a materialized |
|
One timestamp on the timeline, resolved through its span's rescaling. |
|
Per-scene animation timeline. |
|
An updater: |
|
The [added, removed) interval of one updater. |
Functions
- bump_hierarchy_version()[source]¶
Bump both the hierarchy and structure versions. Call this (instead of
bump_structure_version()) for any change to a mob’schildren: it invalidates both the descendant-list cache and the descendant-row-index caches, since a hierarchy change alters both.
- clear_wide_attribute_device_pin()[source]¶
Forget the pin, because the timelines holding it are gone.
Called from
SceneManager.reset(), which is what tears every Scene – and so everyAttributeTimeline– down. The daemon runs it between scripts, so one script’s texture cannot freeze the next one’s device.
- generate_array_states(times, N, edits, *, active_rows=None, prepared=None)[source]¶
Generates the state of an array given its history of edits.
- Parameters:
times (torch.Tensor) – Shape [T], the inquiry times.
N (int) – Length of the output vector.
edits (list of dict) – Each dict contains ‘indexes’ (tensor of shape [M_i], values in [0, N-1]), ‘values’ (tensor of shape [M_i, D]) and ‘timestamp’ (float scalar). Timestamps must be non-decreasing along every row (i.e. among the edits containing any given index) — the per-row upper-bound search relies on it. prepare_for_queries guarantees this by passing edits in execution order with their replay-extended end times.