diff options
author | Richard Antalik <richardantalik@gmail.com> | 2021-03-02 14:34:03 +0300 |
---|---|---|
committer | Richard Antalik <richardantalik@gmail.com> | 2021-03-02 14:54:45 +0300 |
commit | e1f3996d740cf8c0299ce6ea76362648f421fa41 (patch) | |
tree | 2b57608b797f81bd0989b9d820a826fe9b2dab5b /source/blender/blenloader/intern/versioning_290.c | |
parent | b3005bf6881f37fb4ed34c3f3b2db4cf4530814e (diff) |
VSE: Refactor meta operators
Move low level logic to module code and versioning logic to versioning code.
Metas strip position was handled in diffrent way compared to other strips.
This was introduced in c8b0d25794be as bugfix for T28158.
I disagree with such design. Meta strips should be handled in same way as
any other strips.
I have tested this change and haven't found any problems.
No problems after checking T28158 as well.
There should be no functional changes on user level.
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D9972
Diffstat (limited to 'source/blender/blenloader/intern/versioning_290.c')
-rw-r--r-- | source/blender/blenloader/intern/versioning_290.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/versioning_290.c b/source/blender/blenloader/intern/versioning_290.c index 5e2582a184a..c576e99a663 100644 --- a/source/blender/blenloader/intern/versioning_290.c +++ b/source/blender/blenloader/intern/versioning_290.c @@ -69,6 +69,8 @@ #include "SEQ_proxy.h" #include "SEQ_render.h" #include "SEQ_sequencer.h" +#include "SEQ_time.h" +#include "SEQ_transform.h" #include "BLO_readfile.h" #include "readfile.h" @@ -332,6 +334,33 @@ static void seq_convert_transform_crop_lb_2(const Scene *scene, } } +static void seq_update_meta_disp_range(Scene *scene, Editing *ed) +{ + LISTBASE_FOREACH_BACKWARD (MetaStack *, ms, &ed->metastack) { + /* Update ms->disp_range from meta. */ + if (ms->disp_range[0] == ms->disp_range[1]) { + copy_v2_v2_int(ms->disp_range, &ms->parseq->startdisp); + } + + /* Update meta strip endpoints. */ + SEQ_transform_set_left_handle_frame(ms->parseq, ms->disp_range[0]); + SEQ_transform_set_right_handle_frame(ms->parseq, ms->disp_range[1]); + SEQ_transform_fix_single_image_seq_offsets(ms->parseq); + + /* Recalculate effects using meta strip. */ + LISTBASE_FOREACH (Sequence *, seq, ms->oldbasep) { + if (seq->seq2) { + seq->start = seq->startdisp = max_ii(seq->seq1->startdisp, seq->seq2->startdisp); + seq->enddisp = min_ii(seq->seq1->enddisp, seq->seq2->enddisp); + } + } + + /* Ensure that active seqbase points to active meta strip seqbase. */ + MetaStack *active_ms = SEQ_meta_stack_active_get(ed); + SEQ_seqbase_active_set(ed, &active_ms->parseq->seqbase); + } +} + void do_versions_after_linking_290(Main *bmain, ReportList *UNUSED(reports)) { if (!MAIN_VERSION_ATLEAST(bmain, 290, 1)) { @@ -606,6 +635,10 @@ void do_versions_after_linking_290(Main *bmain, ReportList *UNUSED(reports)) */ { /* Keep this block, even when empty. */ + + LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) { + seq_update_meta_disp_range(scene, SEQ_editing_get(scene, false)); + } } } |