Page MenuHome

VSE: Make time operations self-contained
ClosedPublic

Authored by Richard Antalik (ISS) on May 20 2022, 2:09 AM.

Details

Summary

This patch makes it possible to manipulate strips without need to use
update functions to recalculate effect and meta strips.

Prior to this change function SEQ_time_update_sequence had to be used
to update mainly effects and meta strips. This was implemented in a way
that relied on sorted list of strips, which can't always be done and in
rare cases this approach failed.

In case of meta strips, seqbase had to be passed and compared with
"active" one to determine whether meta strip should be updated or not.
This is especially weak system that is prone to bugs when functions are
used by python API functions.

Finally, other strip types had startdisp` and enddisp fields updated
by this function and a lot of code relied on these fields even if strip
start, length and offsets are available. This is completely
unnecessary.

Implemented changes:
All effects and meta strips are updated when strip handles are moved or
strip is translated, without need to call any update function.

Function SEQ_time_update_sequence has been split to
SEQ_time_update_meta_strip_range and
seq_time_update_effects_strip_range. These functions should be only
used within sequencer module code. Meta update is used for versioning,
which is only reason for it not being declared internally.

Sequence fields startdisp and enddisp are now only used for
effects to store strip start and end points. These fields should be
used only internally within sequencer module code.
Use function SEQ_time_*_handle_frame_get to get strip start and end
points.

To update effects and meta strips with reasonable performance, cache
for "parent" meta strip and attached effects is added to
SequenceLookup cache, so it shares invalidation mechanisms.
All caches are populated during single iteration.

Example of current system failing to update strips correctly:

Diff Detail

Repository
rB Blender
Branch
nodisp2 (branched from master)
Build Status
Buildable 22337
Build 22337: arc lint + arc unit

Event Timeline

Richard Antalik (ISS) requested review of this revision.May 20 2022, 2:09 AM
Richard Antalik (ISS) created this revision.
  • Use meta parent cache in SEQ_get_seqbase_by_seq()
  • Add effects by seq cache to resolve O(n!) issue
  • Make seq_time_update_effects_strip_range intern
  • Fix meta transformation not working correctly
  • Resolve remaining issues
  • Make lookup functions intern
Richard Antalik (ISS) retitled this revision from [WIP] VSE: make time operations self-contained to VSE: Make time operations self-contained.May 31 2022, 3:59 AM
Richard Antalik (ISS) edited the summary of this revision. (Show Details)
Richard Antalik (ISS) edited the summary of this revision. (Show Details)
  • More cleanup
  • Remove XXX comments, since they are no longer relevant
Richard Antalik (ISS) edited the summary of this revision. (Show Details)May 31 2022, 4:28 AM
Richard Antalik (ISS) edited the summary of this revision. (Show Details)Jun 1 2022, 10:29 AM
This revision was not accepted when it landed; it landed in state Needs Review.Jun 2 2022, 3:17 AM
This revision was automatically updated to reflect the committed changes.