RowRanges¶
Qualified name: algan.animation\_timeline.timeline.RowRanges
- class RowRanges(pairs, tensor=None)[source]¶
Bases:
objectA set of attribute-buffer rows stored as ordered [begin, end) runs.
Every mob’s rows are allocated as one contiguous block (
AttributeTimeline.add()), so the union of a subtree’s rows is usually a handful of runs. Storing runs instead of one index per row keeps the per-mob descendant caches O(runs) rather than O(rows), and a single-run set lets the attribute buffers be read and written through plain slices instead of index gathers/scatters (seeAttributeTimeline.get()/AttributeTimeline.modify()).pairsmay be None for an uncompressible index set, in which case the materializedtensor()is the only representation. Adjacent runs are merged by the builders; duplicate or out-of-order runs are kept verbatim so the materialized tensor always equals the uncompressed concatenation.Methods
Build from per-mob index tensors, each of which is a contiguous arange (how
AttributeTimeline.addallocates).Build from a list of already-known
(begin, end)integer runs (e.g. each mob's cached single-run range).tensorAttributes
pairsnumel- static from_contiguous_blocks(inds_list)[source]¶
Build from per-mob index tensors, each of which is a contiguous arange (how
AttributeTimeline.addallocates). Returns None when a block is not contiguous (caller falls back to plain concatenation).
- static from_runs(runs)[source]¶
Build from a list of already-known
(begin, end)integer runs (e.g. each mob’s cached single-run range). Coalesces adjacent runs, equivalent tofrom_contiguous_blocks()but without any per-row tensor indexing/conversion.runsmust contain no empty runs.