diff options
author | FĂ©lix <Miadim> | 2022-06-27 20:29:41 +0300 |
---|---|---|
committer | Richard Antalik <richardantalik@gmail.com> | 2022-06-27 20:44:16 +0300 |
commit | 6b35d9e6fbef49d4ce61604c27393425c16cd7a6 (patch) | |
tree | ad67b3e9f1c1ea448f04aeb15f295b332a4824d8 /source/blender/editors | |
parent | a2b9b9d3c48f302fd28042299d73ea0634a210f3 (diff) |
VSE: Add API function to select displayed meta strip
Use function `sequence_editor.display_stack(meta_strip)` to set
displayed timeline content.
To view top-level timeline, that does not belong to any meta strip, pass
`None` as argument.
Differential Revision: https://developer.blender.org/D12048
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_edit.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index 16f663110ec..76dd43586d1 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -1911,11 +1911,9 @@ static int sequencer_meta_toggle_exec(bContext *C, wmOperator *UNUSED(op)) SEQ_prefetch_stop(scene); if (active_seq && active_seq->type == SEQ_TYPE_META && active_seq->flag & SELECT) { - /* Enter meta-strip. */ - SEQ_meta_stack_alloc(ed, active_seq); - SEQ_seqbase_active_set(ed, &active_seq->seqbase); - SEQ_channels_displayed_set(ed, &active_seq->channels); + /* Deselect active meta seq. */ SEQ_select_active_set(scene, NULL); + SEQ_meta_stack_set(scene, active_seq); } else { /* Exit meta-strip if possible. */ @@ -1923,14 +1921,12 @@ static int sequencer_meta_toggle_exec(bContext *C, wmOperator *UNUSED(op)) return OPERATOR_CANCELLED; } - MetaStack *ms = SEQ_meta_stack_active_get(ed); - SEQ_seqbase_active_set(ed, ms->oldbasep); - SEQ_channels_displayed_set(ed, ms->old_channels); - SEQ_select_active_set(scene, ms->parseq); - SEQ_meta_stack_free(ed, ms); + /* Display parent meta. */ + Sequence *meta_parent = SEQ_meta_stack_pop(ed); + SEQ_select_active_set(scene, meta_parent); } - DEG_id_tag_update(&scene->id, ID_RECALC_SEQUENCER_STRIPS); + // DEG_id_tag_update(&scene->id, ID_RECALC_SEQUENCER_STRIPS); WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene); return OPERATOR_FINISHED; |