FunctionTimeline

Qualified name: algan.animation\_timeline.timeline.FunctionTimeline

class FunctionTimeline[source]

Bases: object

Methods

add

add_updater

events_for_caller

The recorded events whose caller is caller (identity).

get_functions_for_times

get_updaters_for_times

invalidate_window_cache

Drop cached event bounds from from_index on.

retarget_caller

Hand one recorded event to a different caller, keeping the index.

events_for_caller(caller)[source]

The recorded events whose caller is caller (identity).

invalidate_window_cache(from_index=0)[source]

Drop cached event bounds from from_index on.

from_index is the lowest position in function_applications whose window may have moved; everything before it keeps its bounds and _windows() rebuilds only the tail. None means no function window changed at all.

This exists because the resolver runs on every batch of a render (a render records edits of its own, which un-resolves the timeline), so a full invalidation meant re-walking every recorded event’s span every batch – 58 ms a batch at 26 000 events, which was the entire cost of the function lookup and swamped the query it feeds.

The updater cache is dropped wholesale regardless: the resolver does not touch updater spans, but a context exit can rescale them without changing their count, and the resolver running is the signal that authoring happened. Rebuilding it is O(updaters), which is why this stays cheap in practice and would want the same treatment on a scene with very many updaters.

retarget_caller(event, new_caller)[source]

Hand one recorded event to a different caller, keeping the index.