diff options
author | Richard Antalik <richardantalik@gmail.com> | 2022-06-02 02:39:40 +0300 |
---|---|---|
committer | Richard Antalik <richardantalik@gmail.com> | 2022-06-02 04:16:20 +0300 |
commit | 7afcfe111aacc8bc3f456a3287d3cc34765b798a (patch) | |
tree | a67d26f084938bf9f05289e756654a7b5387d9d1 /source/blender/sequencer/SEQ_transform.h | |
parent | 604409b8c7071920e6cc7a672571449070375919 (diff) |
VSE: Make time operations self-contained
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.
There should be no functional changes.
Differential Revision: https://developer.blender.org/D14990
Diffstat (limited to 'source/blender/sequencer/SEQ_transform.h')
-rw-r--r-- | source/blender/sequencer/SEQ_transform.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/sequencer/SEQ_transform.h b/source/blender/sequencer/SEQ_transform.h index bd4258bfdb1..93ce6873d3b 100644 --- a/source/blender/sequencer/SEQ_transform.h +++ b/source/blender/sequencer/SEQ_transform.h @@ -21,14 +21,17 @@ struct Sequence; * Use to impose limits when dragging/extending - so impossible situations don't happen. * Can't use the #SEQ_LEFTSEL and #SEQ_LEFTSEL directly because the strip may be in a meta-strip. */ -void SEQ_transform_handle_xlimits(struct Sequence *seq, int leftflag, int rightflag); +void SEQ_transform_handle_xlimits(const struct Scene *scene, + struct Sequence *seq, + int leftflag, + int rightflag); bool SEQ_transform_sequence_can_be_translated(struct Sequence *seq); /** * Used so we can do a quick check for single image seq * since they work a bit differently to normal image seq's (during transform). */ bool SEQ_transform_single_image_check(struct Sequence *seq); -void SEQ_transform_fix_single_image_seq_offsets(struct Sequence *seq); +void SEQ_transform_fix_single_image_seq_offsets(const struct Scene *scene, struct Sequence *seq); bool SEQ_transform_test_overlap(struct ListBase *seqbasep, struct Sequence *test); bool SEQ_transform_test_overlap_seq_seq(struct Sequence *seq1, struct Sequence *seq2); void SEQ_transform_translate_sequence(struct Scene *scene, struct Sequence *seq, int delta); |