diff --git a/source/blender/blenkernel/intern/ipo.cc b/source/blender/blenkernel/intern/ipo.cc index 89d3eb26819..a735348db8a 100644 --- a/source/blender/blenkernel/intern/ipo.cc +++ b/source/blender/blenkernel/intern/ipo.cc @@ -2387,7 +2387,7 @@ void do_versions_ipos_to_layered_actions(Main *bmain) for (id = static_cast(bmain->scenes.first); id; id = static_cast(id->next)) { Scene *scene = (Scene *)id; Editing *ed = scene->ed; - if (ed && ed->seqbasep) { + if (ed && ed->current_strips()) { Seq_callback_data cb_data = {bmain, scene, BKE_animdata_ensure_id(id)}; seq::for_each_callback(&ed->seqbase, strip_convert_callback, &cb_data); } diff --git a/source/blender/editors/animation/anim_deps.cc b/source/blender/editors/animation/anim_deps.cc index 7d2733c78d7..ebdd21c0fbe 100644 --- a/source/blender/editors/animation/anim_deps.cc +++ b/source/blender/editors/animation/anim_deps.cc @@ -198,7 +198,7 @@ static void animchan_sync_fcurve_scene(bAnimListElem *ale) * strip, or even the sequencer itself. */ return; } - strip = blender::seq::get_strip_by_name(ed->seqbasep, strip_name, false); + strip = blender::seq::get_strip_by_name(ed->current_strips(), strip_name, false); if (strip == nullptr) { return; } diff --git a/source/blender/editors/animation/anim_filter.cc b/source/blender/editors/animation/anim_filter.cc index 3b622fad815..d7bc4456cfd 100644 --- a/source/blender/editors/animation/anim_filter.cc +++ b/source/blender/editors/animation/anim_filter.cc @@ -1022,7 +1022,7 @@ static bool skip_fcurve_selected_data(bAnimContext *ac, /* Get strip name, and check if this strip is selected. */ Editing *ed = blender::seq::editing_get(scene); if (ed) { - strip = blender::seq::get_strip_by_name(ed->seqbasep, strip_name, false); + strip = blender::seq::get_strip_by_name(ed->current_strips(), strip_name, false); } /* Can only add this F-Curve if it is selected. */ diff --git a/source/blender/editors/screen/screen_context.cc b/source/blender/editors/screen/screen_context.cc index db3607ffa33..0027a521913 100644 --- a/source/blender/editors/screen/screen_context.cc +++ b/source/blender/editors/screen/screen_context.cc @@ -688,7 +688,7 @@ static eContextResult screen_ctx_sequences(const bContext *C, bContextDataResult Scene *scene = WM_window_get_active_scene(win); Editing *ed = blender::seq::editing_get(scene); if (ed) { - LISTBASE_FOREACH (Strip *, strip, ed->seqbasep) { + LISTBASE_FOREACH (Strip *, strip, ed->current_strips()) { CTX_data_list_add(result, &scene->id, &RNA_Strip, strip); } CTX_data_type_set(result, CTX_DATA_TYPE_COLLECTION); @@ -702,7 +702,7 @@ static eContextResult screen_ctx_selected_sequences(const bContext *C, bContextD Scene *scene = WM_window_get_active_scene(win); Editing *ed = blender::seq::editing_get(scene); if (ed) { - LISTBASE_FOREACH (Strip *, strip, ed->seqbasep) { + LISTBASE_FOREACH (Strip *, strip, ed->current_strips()) { if (strip->flag & SELECT) { CTX_data_list_add(result, &scene->id, &RNA_Strip, strip); } @@ -723,7 +723,7 @@ static eContextResult screen_ctx_selected_editable_sequences(const bContext *C, } ListBase *channels = blender::seq::channels_displayed_get(ed); - LISTBASE_FOREACH (Strip *, strip, ed->seqbasep) { + LISTBASE_FOREACH (Strip *, strip, ed->current_strips()) { if (strip->flag & SELECT && !blender::seq::transform_is_locked(channels, strip)) { CTX_data_list_add(result, &scene->id, &RNA_Strip, strip); } @@ -1153,7 +1153,7 @@ static eContextResult screen_ctx_strips(const bContext *C, bContextDataResult *r Scene *scene = WM_window_get_active_scene(win); Editing *ed = blender::seq::editing_get(scene); if (ed) { - LISTBASE_FOREACH (Strip *, strip, ed->seqbasep) { + LISTBASE_FOREACH (Strip *, strip, ed->current_strips()) { CTX_data_list_add(result, &scene->id, &RNA_Strip, strip); } CTX_data_type_set(result, CTX_DATA_TYPE_COLLECTION); @@ -1167,7 +1167,7 @@ static eContextResult screen_ctx_selected_strips(const bContext *C, bContextData Scene *scene = WM_window_get_active_scene(win); Editing *ed = blender::seq::editing_get(scene); if (ed) { - LISTBASE_FOREACH (Strip *, strip, ed->seqbasep) { + LISTBASE_FOREACH (Strip *, strip, ed->current_strips()) { if (strip->flag & SELECT) { CTX_data_list_add(result, &scene->id, &RNA_Strip, strip); } @@ -1188,7 +1188,7 @@ static eContextResult screen_ctx_selected_editable_strips(const bContext *C, } ListBase *channels = blender::seq::channels_displayed_get(ed); - LISTBASE_FOREACH (Strip *, strip, ed->seqbasep) { + LISTBASE_FOREACH (Strip *, strip, ed->current_strips()) { if (strip->flag & SELECT && !blender::seq::transform_is_locked(channels, strip)) { CTX_data_list_add(result, &scene->id, &RNA_Strip, strip); } diff --git a/source/blender/editors/space_outliner/outliner_select.cc b/source/blender/editors/space_outliner/outliner_select.cc index 94425273666..a95fabc350c 100644 --- a/source/blender/editors/space_outliner/outliner_select.cc +++ b/source/blender/editors/space_outliner/outliner_select.cc @@ -738,7 +738,7 @@ static void tree_element_strip_activate(bContext *C, Strip *strip = &te_strip->get_strip(); Editing *ed = seq::editing_get(scene); - if (BLI_findindex(ed->seqbasep, strip) != -1) { + if (BLI_findindex(ed->current_strips(), strip) != -1) { if (set == OL_SETSEL_EXTEND) { seq::select_active_set(scene, nullptr); } @@ -763,7 +763,7 @@ static void tree_element_strip_dup_activate(Scene *scene, TreeElement * /*te*/) #if 0 select_single_seq(strip, 1); #endif - Strip *p = static_cast(ed->seqbasep->first); + Strip *p = static_cast(ed->current_strips()->first); while (p) { if ((!p->data) || (!p->data->stripdata) || (p->data->stripdata->filename[0] == '\0')) { p = p->next; diff --git a/source/blender/editors/space_outliner/outliner_tools.cc b/source/blender/editors/space_outliner/outliner_tools.cc index 1abd6c7665a..27ba9b2f57c 100644 --- a/source/blender/editors/space_outliner/outliner_tools.cc +++ b/source/blender/editors/space_outliner/outliner_tools.cc @@ -2148,7 +2148,7 @@ static void sequence_fn(int event, TreeElement *te, TreeStoreElem * /*tselem*/, Strip *strip = &te_strip->get_strip(); Scene *scene = (Scene *)scene_ptr; Editing *ed = seq::editing_get(scene); - if (BLI_findindex(ed->seqbasep, strip) != -1) { + if (BLI_findindex(ed->current_strips(), strip) != -1) { if (event == OL_DOP_SELECT) { vse::select_strip_single(scene, strip, true); } diff --git a/source/blender/editors/space_outliner/tree/tree_display_sequencer.cc b/source/blender/editors/space_outliner/tree/tree_display_sequencer.cc index 9d3155d17f6..ae63797ba93 100644 --- a/source/blender/editors/space_outliner/tree/tree_display_sequencer.cc +++ b/source/blender/editors/space_outliner/tree/tree_display_sequencer.cc @@ -37,7 +37,7 @@ ListBase TreeDisplaySequencer::build_tree(const TreeSourceData &source_data) return tree; } - for (Strip *strip : List(ed->seqbasep)) { + for (Strip *strip : List(ed->current_strips())) { StripAddOp op = need_add_strip_dup(strip); if (op == StripAddOp::None) { add_element(&tree, nullptr, strip, nullptr, TSE_STRIP, 0); diff --git a/source/blender/editors/space_sequencer/sequencer_add.cc b/source/blender/editors/space_sequencer/sequencer_add.cc index c0dc1e3b45a..3be67cfb335 100644 --- a/source/blender/editors/space_sequencer/sequencer_add.cc +++ b/source/blender/editors/space_sequencer/sequencer_add.cc @@ -239,11 +239,11 @@ static int sequencer_generic_invoke_xy_guess_channel(bContext *C, int type) int timeline_frame = scene->r.cfra; int proximity = INT_MAX; - if (!ed || !ed->seqbasep) { + if (!ed || !ed->current_strips()) { return 1; } - LISTBASE_FOREACH (Strip *, strip, ed->seqbasep) { + LISTBASE_FOREACH (Strip *, strip, ed->current_strips()) { const int strip_end = seq::time_right_handle_frame_get(scene, strip); if (ELEM(type, -1, strip->type) && (strip_end <= timeline_frame) && (timeline_frame - strip_end < proximity)) @@ -539,7 +539,7 @@ static void seq_load_apply_generic_options(bContext *C, wmOperator *op, Strip *s } if (RNA_boolean_get(op->ptr, "overlap") == true || - !seq::transform_test_overlap(scene, ed->seqbasep, strip) || + !seq::transform_test_overlap(scene, ed->current_strips(), strip) || RNA_boolean_get(op->ptr, "move_strips")) { /* No overlap should be handled or the strip is not overlapping, exit early. */ @@ -554,11 +554,11 @@ static void seq_load_apply_generic_options(bContext *C, wmOperator *op, Strip *s ScrArea *area = CTX_wm_area(C); const bool use_sync_markers = (((SpaceSeq *)area->spacedata.first)->flag & SEQ_MARKER_TRANS) != 0; - seq::transform_handle_overlap(scene, ed->seqbasep, strip_col, use_sync_markers); + seq::transform_handle_overlap(scene, ed->current_strips(), strip_col, use_sync_markers); } else { /* Shuffle strip channel to fix overlaps. */ - seq::transform_seqbase_shuffle(ed->seqbasep, strip, scene); + seq::transform_seqbase_shuffle(ed->current_strips(), strip, scene); } } @@ -579,7 +579,7 @@ static bool seq_load_apply_generic_options_only_test_overlap(bContext *C, seq::select_active_set(scene, strip); } - return seq::transform_test_overlap(scene, ed->seqbasep, strip); + return seq::transform_test_overlap(scene, ed->current_strips(), strip); } static bool seq_effect_add_properties_poll(const bContext * /*C*/, @@ -629,7 +629,7 @@ static wmOperatorStatus sequencer_add_scene_strip_exec(bContext *C, wmOperator * load_data_init_from_operator(&load_data, C, op); load_data.scene = sce_seq; - Strip *strip = seq::add_scene_strip(scene, ed->seqbasep, &load_data); + Strip *strip = seq::add_scene_strip(scene, ed->current_strips(), &load_data); seq_load_apply_generic_options(C, op, strip); DEG_id_tag_update(&scene->id, ID_RECALC_SEQUENCER_STRIPS); @@ -647,7 +647,7 @@ static void sequencer_disable_one_time_properties(bContext *C, wmOperator *op) { Editing *ed = seq::editing_get(CTX_data_sequencer_scene(C)); /* Disable following properties if there are any existing strips, unless overridden by user. */ - if (ed && ed->seqbasep && ed->seqbasep->first) { + if (ed && ed->current_strips() && ed->current_strips()->first) { if (RNA_struct_find_property(op->ptr, "use_framerate")) { RNA_boolean_set(op->ptr, "use_framerate", false); } @@ -740,7 +740,7 @@ static wmOperatorStatus sequencer_add_scene_strip_new_exec(bContext *C, wmOperat } load_data.scene = scene_new; - Strip *strip = seq::add_scene_strip(scene, ed->seqbasep, &load_data); + Strip *strip = seq::add_scene_strip(scene, ed->current_strips(), &load_data); seq_load_apply_generic_options(C, op, strip); DEG_id_tag_update(&scene->id, ID_RECALC_SEQUENCER_STRIPS); @@ -812,7 +812,7 @@ static wmOperatorStatus sequencer_add_movieclip_strip_exec(bContext *C, wmOperat } load_data.clip = clip; - Strip *strip = seq::add_movieclip_strip(scene, ed->seqbasep, &load_data); + Strip *strip = seq::add_movieclip_strip(scene, ed->current_strips(), &load_data); seq_load_apply_generic_options(C, op, strip); DEG_id_tag_update(&scene->id, ID_RECALC_SEQUENCER_STRIPS); @@ -888,7 +888,7 @@ static wmOperatorStatus sequencer_add_mask_strip_exec(bContext *C, wmOperator *o load_data_init_from_operator(&load_data, C, op); load_data.mask = mask; - Strip *strip = seq::add_mask_strip(scene, ed->seqbasep, &load_data); + Strip *strip = seq::add_mask_strip(scene, ed->current_strips(), &load_data); seq_load_apply_generic_options(C, op, strip); DEG_id_tag_update(&scene->id, ID_RECALC_SEQUENCER_STRIPS); @@ -1045,14 +1045,14 @@ static void sequencer_add_movie_multiple_strips(bContext *C, Strip *strip_movie = nullptr; Strip *strip_sound = nullptr; - strip_movie = seq::add_movie_strip(bmain, scene, ed->seqbasep, load_data); + strip_movie = seq::add_movie_strip(bmain, scene, ed->current_strips(), load_data); if (strip_movie == nullptr) { BKE_reportf(op->reports, RPT_ERROR, "File '%s' could not be loaded", load_data->path); } else { if (RNA_boolean_get(op->ptr, "sound")) { - strip_sound = seq::add_sound_strip(bmain, scene, ed->seqbasep, load_data); + strip_sound = seq::add_sound_strip(bmain, scene, ed->current_strips(), load_data); sequencer_add_movie_sync_sound_strip(bmain, scene, strip_movie, strip_sound, load_data); added_strips.append(strip_movie); @@ -1090,7 +1090,7 @@ static void sequencer_add_movie_multiple_strips(bContext *C, ScrArea *area = CTX_wm_area(C); const bool use_sync_markers = (((SpaceSeq *)area->spacedata.first)->flag & SEQ_MARKER_TRANS) != 0; - seq::transform_handle_overlap(scene, ed->seqbasep, added_strips, use_sync_markers); + seq::transform_handle_overlap(scene, ed->current_strips(), added_strips, use_sync_markers); } } } @@ -1108,14 +1108,14 @@ static bool sequencer_add_movie_single_strip(bContext *C, Strip *strip_sound = nullptr; blender::Vector added_strips; - strip_movie = seq::add_movie_strip(bmain, scene, ed->seqbasep, load_data); + strip_movie = seq::add_movie_strip(bmain, scene, ed->current_strips(), load_data); if (strip_movie == nullptr) { BKE_reportf(op->reports, RPT_ERROR, "File '%s' could not be loaded", load_data->path); return false; } if (RNA_boolean_get(op->ptr, "sound")) { - strip_sound = seq::add_sound_strip(bmain, scene, ed->seqbasep, load_data); + strip_sound = seq::add_sound_strip(bmain, scene, ed->current_strips(), load_data); sequencer_add_movie_sync_sound_strip(bmain, scene, strip_movie, strip_sound, load_data); added_strips.append(strip_movie); @@ -1146,7 +1146,7 @@ static bool sequencer_add_movie_single_strip(bContext *C, ScrArea *area = CTX_wm_area(C); const bool use_sync_markers = (((SpaceSeq *)area->spacedata.first)->flag & SEQ_MARKER_TRANS) != 0; - seq::transform_handle_overlap(scene, ed->seqbasep, added_strips, use_sync_markers); + seq::transform_handle_overlap(scene, ed->current_strips(), added_strips, use_sync_markers); } } else { @@ -1381,7 +1381,7 @@ static void sequencer_add_sound_multiple_strips(bContext *C, RNA_string_get(&itemptr, "name", file_only); BLI_path_join(load_data->path, sizeof(load_data->path), dir_only, file_only); STRNCPY(load_data->name, file_only); - Strip *strip = seq::add_sound_strip(bmain, scene, ed->seqbasep, load_data); + Strip *strip = seq::add_sound_strip(bmain, scene, ed->current_strips(), load_data); if (strip == nullptr) { BKE_reportf(op->reports, RPT_ERROR, "File '%s' could not be loaded", load_data->path); } @@ -1400,7 +1400,7 @@ static bool sequencer_add_sound_single_strip(bContext *C, wmOperator *op, seq::L Scene *scene = CTX_data_sequencer_scene(C); Editing *ed = seq::editing_ensure(scene); - Strip *strip = seq::add_sound_strip(bmain, scene, ed->seqbasep, load_data); + Strip *strip = seq::add_sound_strip(bmain, scene, ed->current_strips(), load_data); if (strip == nullptr) { BKE_reportf(op->reports, RPT_ERROR, "File '%s' could not be loaded", load_data->path); return false; @@ -1639,7 +1639,7 @@ static wmOperatorStatus sequencer_add_image_strip_exec(bContext *C, wmOperator * char vt_old[64]; STRNCPY_UTF8(vt_old, scene->view_settings.view_transform); - Strip *strip = seq::add_image_strip(CTX_data_main(C), scene, ed->seqbasep, &load_data); + Strip *strip = seq::add_image_strip(CTX_data_main(C), scene, ed->current_strips(), &load_data); if (!STREQ(vt_old, scene->view_settings.view_transform)) { BKE_reportf(op->reports, @@ -1789,7 +1789,7 @@ static wmOperatorStatus sequencer_add_effect_strip_exec(bContext *C, wmOperator } } - Strip *strip = seq::add_effect_strip(scene, ed->seqbasep, &load_data); + Strip *strip = seq::add_effect_strip(scene, ed->current_strips(), &load_data); seq_load_apply_generic_options(C, op, strip); if (strip->type == STRIP_TYPE_COLOR) { @@ -1984,7 +1984,7 @@ static wmOperatorStatus sequencer_add_scene_asset_invoke(bContext *C, load_data_init_from_operator(&load_data, C, op); load_data.scene = scene_asset; - Strip *strip = seq::add_scene_strip(scene, ed->seqbasep, &load_data); + Strip *strip = seq::add_scene_strip(scene, ed->current_strips(), &load_data); seq_load_apply_generic_options(C, op, strip); DEG_id_tag_update(&scene->id, ID_RECALC_SEQUENCER_STRIPS); diff --git a/source/blender/editors/space_sequencer/sequencer_clipboard.cc b/source/blender/editors/space_sequencer/sequencer_clipboard.cc index 6f83ef9d2ee..dab4b04ec30 100644 --- a/source/blender/editors/space_sequencer/sequencer_clipboard.cc +++ b/source/blender/editors/space_sequencer/sequencer_clipboard.cc @@ -172,7 +172,7 @@ static bool sequencer_write_copy_paste_file(Main *bmain_src, scene_src, scene_dst, &scene_dst->ed->seqbase, - scene_src->ed->seqbasep, + scene_src->ed->current_strips(), seq::StripDuplicate::Selected, 0); @@ -317,7 +317,7 @@ wmOperatorStatus sequencer_clipboard_copy_exec(bContext *C, wmOperator *op) Scene *scene = CTX_data_sequencer_scene(C); Editing *ed = seq::editing_get(scene); - blender::VectorSet selected = seq::query_selected_strips(ed->seqbasep); + blender::VectorSet selected = seq::query_selected_strips(ed->current_strips()); if (selected.is_empty()) { return OPERATOR_CANCELLED; @@ -325,7 +325,8 @@ wmOperatorStatus sequencer_clipboard_copy_exec(bContext *C, wmOperator *op) blender::VectorSet effect_chain; effect_chain.add_multiple(selected); - seq::iterator_set_expand(scene, ed->seqbasep, effect_chain, seq::query_strip_effect_chain); + seq::iterator_set_expand( + scene, ed->current_strips(), effect_chain, seq::query_strip_effect_chain); blender::VectorSet expanded; for (Strip *strip : effect_chain) { diff --git a/source/blender/editors/space_sequencer/sequencer_drag_drop.cc b/source/blender/editors/space_sequencer/sequencer_drag_drop.cc index 140d3bf2bce..4556a9e63f9 100644 --- a/source/blender/editors/space_sequencer/sequencer_drag_drop.cc +++ b/source/blender/editors/space_sequencer/sequencer_drag_drop.cc @@ -238,7 +238,8 @@ static float update_overlay_strip_position_data(bContext *C, const int mval[2]) Editing *ed = seq::editing_ensure(scene); for (int i = 0; i < coords->channel_len && !coords->is_intersecting; i++) { - coords->is_intersecting = seq::transform_test_overlap(scene, ed->seqbasep, &dummy_strip); + coords->is_intersecting = seq::transform_test_overlap( + scene, ed->current_strips(), &dummy_strip); seq::strip_channel_set(&dummy_strip, dummy_strip.channel + 1); } diff --git a/source/blender/editors/space_sequencer/sequencer_edit.cc b/source/blender/editors/space_sequencer/sequencer_edit.cc index e2109f452ea..12dde44918d 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.cc +++ b/source/blender/editors/space_sequencer/sequencer_edit.cc @@ -303,7 +303,7 @@ static wmOperatorStatus sequencer_gap_remove_exec(bContext *C, wmOperator *op) const bool do_all = RNA_boolean_get(op->ptr, "all"); const Editing *ed = seq::editing_get(scene); - seq::edit_remove_gaps(scene, ed->seqbasep, scene->r.cfra, do_all); + seq::edit_remove_gaps(scene, ed->current_strips(), scene->r.cfra, do_all); WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene); DEG_id_tag_update(&scene->id, ID_RECALC_SEQUENCER_STRIPS); @@ -342,7 +342,7 @@ static wmOperatorStatus sequencer_gap_insert_exec(bContext *C, wmOperator *op) Scene *scene = CTX_data_sequencer_scene(C); const int frames = RNA_int_get(op->ptr, "frames"); const Editing *ed = seq::editing_get(scene); - seq::transform_offset_after_frame(scene, ed->seqbasep, frames, scene->r.cfra); + seq::transform_offset_after_frame(scene, ed->current_strips(), frames, scene->r.cfra); WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene); @@ -394,7 +394,7 @@ static wmOperatorStatus sequencer_snap_exec(bContext *C, wmOperator *op) snap_frame = RNA_int_get(op->ptr, "frame"); /* Check meta-strips. */ - LISTBASE_FOREACH (Strip *, strip, ed->seqbasep) { + LISTBASE_FOREACH (Strip *, strip, ed->current_strips()) { if (strip->flag & SELECT && !seq::transform_is_locked(channels, strip) && seq::transform_strip_can_be_translated(strip)) { @@ -416,17 +416,17 @@ static wmOperatorStatus sequencer_snap_exec(bContext *C, wmOperator *op) } /* Test for effects and overlap. */ - LISTBASE_FOREACH (Strip *, strip, ed->seqbasep) { + LISTBASE_FOREACH (Strip *, strip, ed->current_strips()) { if (strip->flag & SELECT && !seq::transform_is_locked(channels, strip)) { strip->runtime.flag &= ~STRIP_OVERLAP; - if (seq::transform_test_overlap(scene, ed->seqbasep, strip)) { - seq::transform_seqbase_shuffle(ed->seqbasep, strip, scene); + if (seq::transform_test_overlap(scene, ed->current_strips(), strip)) { + seq::transform_seqbase_shuffle(ed->current_strips(), strip, scene); } } } /* Recalculate bounds of effect strips, offsetting the keyframes if not snapping any handle. */ - LISTBASE_FOREACH (Strip *, strip, ed->seqbasep) { + LISTBASE_FOREACH (Strip *, strip, ed->current_strips()) { if (strip->type & STRIP_TYPE_EFFECT) { const bool either_handle_selected = (strip->flag & (SEQ_LEFTSEL | SEQ_RIGHTSEL)) != 0; @@ -610,7 +610,7 @@ static SlipData *slip_data_init(const Scene *scene) Editing *ed = seq::editing_get(scene); SlipData *data = MEM_new("slipdata"); - VectorSet strips = seq::query_selected_strips(ed->seqbasep); + VectorSet strips = seq::query_selected_strips(ed->current_strips()); ListBase *channels = seq::channels_displayed_get(seq::editing_get(scene)); strips.remove_if([&](Strip *strip) { return (seq::transform_single_image_check(strip) || seq::transform_is_locked(channels, strip)); @@ -1010,7 +1010,7 @@ static wmOperatorStatus sequencer_unmute_exec(bContext *C, wmOperator *op) ARegion *region = CTX_wm_region(C); const bool is_preview = region && (region->regiontype == RGN_TYPE_PREVIEW) && sequencer_view_preview_only_poll(C); - LISTBASE_FOREACH (Strip *, strip, ed->seqbasep) { + LISTBASE_FOREACH (Strip *, strip, ed->current_strips()) { if (is_preview) { if (seq::time_strip_intersects_frame(scene, strip, scene->r.cfra) && strip->type != STRIP_TYPE_SOUND_RAM) @@ -1071,7 +1071,7 @@ static wmOperatorStatus sequencer_lock_exec(bContext *C, wmOperator * /*op*/) Scene *scene = CTX_data_sequencer_scene(C); Editing *ed = seq::editing_get(scene); - LISTBASE_FOREACH (Strip *, strip, ed->seqbasep) { + LISTBASE_FOREACH (Strip *, strip, ed->current_strips()) { if (strip->flag & SELECT) { strip->flag |= SEQ_LOCK; } @@ -1108,7 +1108,7 @@ static wmOperatorStatus sequencer_unlock_exec(bContext *C, wmOperator * /*op*/) Scene *scene = CTX_data_sequencer_scene(C); Editing *ed = seq::editing_get(scene); - LISTBASE_FOREACH (Strip *, strip, ed->seqbasep) { + LISTBASE_FOREACH (Strip *, strip, ed->current_strips()) { if (strip->flag & SELECT) { strip->flag &= ~SEQ_LOCK; } @@ -1224,14 +1224,14 @@ static wmOperatorStatus sequencer_reload_exec(bContext *C, wmOperator *op) Editing *ed = seq::editing_get(scene); const bool adjust_length = RNA_boolean_get(op->ptr, "adjust_length"); - LISTBASE_FOREACH (Strip *, strip, ed->seqbasep) { + LISTBASE_FOREACH (Strip *, strip, ed->current_strips()) { if (strip->flag & SELECT) { seq::add_reload_new_file(bmain, scene, strip, !adjust_length); blender::seq::thumbnail_cache_invalidate_strip(scene, strip); if (adjust_length) { - if (seq::transform_test_overlap(scene, ed->seqbasep, strip)) { - seq::transform_seqbase_shuffle(ed->seqbasep, strip, scene); + if (seq::transform_test_overlap(scene, ed->current_strips(), strip)) { + seq::transform_seqbase_shuffle(ed->current_strips(), strip, scene); } } } @@ -1335,7 +1335,7 @@ VectorSet strip_effect_get_new_inputs(const Scene *scene, } Editing *ed = seq::editing_get(scene); - blender::VectorSet selected_strips = seq::query_selected_strips(ed->seqbasep); + blender::VectorSet selected_strips = seq::query_selected_strips(ed->current_strips()); /* Ignore sound strips for now (avoids unnecessary errors when connected strips are * selected together, and the intent to operate on strips with video content is clear). */ selected_strips.remove_if([&](Strip *strip) { return strip->type == STRIP_TYPE_SOUND_RAM; }); @@ -1542,7 +1542,7 @@ static wmOperatorStatus sequencer_split_exec(bContext *C, wmOperator *op) seq::prefetch_stop(scene); - LISTBASE_FOREACH_BACKWARD (Strip *, strip, ed->seqbasep) { + LISTBASE_FOREACH_BACKWARD (Strip *, strip, ed->current_strips()) { if (use_cursor_position && strip->channel != split_channel) { continue; } @@ -1550,7 +1550,8 @@ static wmOperatorStatus sequencer_split_exec(bContext *C, wmOperator *op) if (ignore_selection || strip->flag & SELECT) { const char *error_msg = nullptr; if (seq::edit_strip_split( - bmain, scene, ed->seqbasep, strip, split_frame, method, &error_msg) != nullptr) + bmain, scene, ed->current_strips(), strip, split_frame, method, &error_msg) != + nullptr) { changed = true; } @@ -1749,7 +1750,7 @@ static wmOperatorStatus sequencer_add_duplicate_exec(bContext *C, wmOperator *op /* Special case for duplicating strips in preview: Do not duplicate sound strips,muted * strips and strips that do not intersect the current frame */ if (region->regiontype == RGN_TYPE_PREVIEW && sequencer_view_preview_only_poll(C)) { - LISTBASE_FOREACH (Strip *, strip, ed->seqbasep) { + LISTBASE_FOREACH (Strip *, strip, ed->current_strips()) { if (strip->type == STRIP_TYPE_SOUND_RAM || strip->flag & SEQ_MUTE || !(seq::time_strip_intersects_frame(scene, strip, scene->r.cfra))) { @@ -1762,7 +1763,7 @@ static wmOperatorStatus sequencer_add_duplicate_exec(bContext *C, wmOperator *op (seq::StripDuplicate::Selected | seq::StripDuplicate::Data); seq::seqbase_duplicate_recursive( - bmain, scene, scene, &duplicated_strips, ed->seqbasep, dupe_flag, 0); + bmain, scene, scene, &duplicated_strips, ed->current_strips(), dupe_flag, 0); deselect_all_strips(scene); if (duplicated_strips.first == nullptr) { @@ -1782,7 +1783,7 @@ static wmOperatorStatus sequencer_add_duplicate_exec(bContext *C, wmOperator *op /* Rely on the `duplicated_strips` list being added at the end. * Their UIDs has been re-generated by the #SEQ_sequence_base_dupli_recursive(). */ - BLI_movelisttolist(ed->seqbasep, &duplicated_strips); + BLI_movelisttolist(ed->current_strips(), &duplicated_strips); /* Handle duplicated strips: set active, select, ensure unique name and duplicate animation * data. */ @@ -1801,8 +1802,8 @@ static wmOperatorStatus sequencer_add_duplicate_exec(bContext *C, wmOperator *op * translated. */ if (region->regiontype == RGN_TYPE_PREVIEW && sequencer_view_preview_only_poll(C)) { for (Strip *strip = strip_last->next; strip; strip = strip->next) { - if (seq::transform_test_overlap(scene, ed->seqbasep, strip)) { - seq::transform_seqbase_shuffle(ed->seqbasep, strip, scene); + if (seq::transform_test_overlap(scene, ed->current_strips(), strip)) { + seq::transform_seqbase_shuffle(ed->current_strips(), strip, scene); } strip->runtime.flag &= ~STRIP_IGNORE_CHANNEL_LOCK; } @@ -1948,7 +1949,7 @@ static wmOperatorStatus sequencer_offset_clear_exec(bContext *C, wmOperator * /* ListBase *channels = seq::channels_displayed_get(seq::editing_get(scene)); /* For effects, try to find a replacement input. */ - for (strip = static_cast(ed->seqbasep->first); strip; + for (strip = static_cast(ed->current_strips()->first); strip; strip = static_cast(strip->next)) { if (seq::transform_is_locked(channels, strip)) { @@ -1961,18 +1962,18 @@ static wmOperatorStatus sequencer_offset_clear_exec(bContext *C, wmOperator * /* } /* Update lengths, etc. */ - strip = static_cast(ed->seqbasep->first); + strip = static_cast(ed->current_strips()->first); while (strip) { seq::relations_invalidate_cache(scene, strip); strip = strip->next; } - for (strip = static_cast(ed->seqbasep->first); strip; + for (strip = static_cast(ed->current_strips()->first); strip; strip = static_cast(strip->next)) { if ((strip->type & STRIP_TYPE_EFFECT) == 0 && (strip->flag & SELECT)) { - if (seq::transform_test_overlap(scene, ed->seqbasep, strip)) { - seq::transform_seqbase_shuffle(ed->seqbasep, strip, scene); + if (seq::transform_test_overlap(scene, ed->current_strips(), strip)) { + seq::transform_seqbase_shuffle(ed->current_strips(), strip, scene); } } } @@ -2267,7 +2268,7 @@ static wmOperatorStatus sequencer_meta_separate_exec(bContext *C, wmOperator * / /* Remove all selected from meta, and put in main list. * Strip is moved within the same edit, no need to re-generate the UID. */ - BLI_movelisttolist(ed->seqbasep, &active_strip->seqbase); + BLI_movelisttolist(ed->current_strips(), &active_strip->seqbase); BLI_listbase_clear(&active_strip->seqbase); ListBase *active_seqbase = seq::active_seqbase_get(ed); @@ -2418,7 +2419,7 @@ static Strip *find_next_prev_strip(Scene *scene, Strip *test, int lr, int sel) return nullptr; } - strip = static_cast(ed->seqbasep->first); + strip = static_cast(ed->current_strips()->first); while (strip) { if ((strip != test) && (test->channel == strip->channel) && ((sel == -1) || (sel == (strip->flag & SELECT)))) @@ -3238,7 +3239,7 @@ static wmOperatorStatus sequencer_set_range_to_strips_exec(bContext *C, wmOperat bool selected = false; const bool preview = RNA_boolean_get(op->ptr, "preview"); - LISTBASE_FOREACH (Strip *, strip, ed->seqbasep) { + LISTBASE_FOREACH (Strip *, strip, ed->current_strips()) { if (strip->flag & SELECT) { selected = true; sfra = min_ii(sfra, seq::time_left_handle_frame_get(scene, strip)); @@ -3325,7 +3326,7 @@ static wmOperatorStatus sequencer_strip_transform_clear_exec(bContext *C, wmOper const bool only_when_keyed = blender::animrig::is_keying_flag(scene, AUTOKEY_FLAG_INSERTAVAILABLE); - LISTBASE_FOREACH (Strip *, strip, ed->seqbasep) { + LISTBASE_FOREACH (Strip *, strip, ed->current_strips()) { if (strip->flag & SELECT && strip->type != STRIP_TYPE_SOUND_RAM) { StripTransform *transform = strip->data->transform; PropertyRNA *prop; @@ -3437,7 +3438,7 @@ static wmOperatorStatus sequencer_strip_transform_fit_exec(bContext *C, wmOperat const Editing *ed = seq::editing_get(scene); const eSeqImageFitMethod fit_method = eSeqImageFitMethod(RNA_enum_get(op->ptr, "fit_method")); - LISTBASE_FOREACH (Strip *, strip, ed->seqbasep) { + LISTBASE_FOREACH (Strip *, strip, ed->current_strips()) { if (strip->flag & SELECT && strip->type != STRIP_TYPE_SOUND_RAM) { const int timeline_frame = scene->r.cfra; StripElem *strip_elem = seq::render_give_stripelem(scene, strip, timeline_frame); @@ -3487,7 +3488,7 @@ static wmOperatorStatus sequencer_strip_color_tag_set_exec(bContext *C, wmOperat const Editing *ed = seq::editing_get(scene); const short color_tag = RNA_enum_get(op->ptr, "color"); - LISTBASE_FOREACH (Strip *, strip, ed->seqbasep) { + LISTBASE_FOREACH (Strip *, strip, ed->current_strips()) { if (strip->flag & SELECT) { strip->color_tag = color_tag; } diff --git a/source/blender/editors/space_sequencer/sequencer_retiming.cc b/source/blender/editors/space_sequencer/sequencer_retiming.cc index ce29c7a054f..832cd7e9c85 100644 --- a/source/blender/editors/space_sequencer/sequencer_retiming.cc +++ b/source/blender/editors/space_sequencer/sequencer_retiming.cc @@ -97,13 +97,13 @@ static wmOperatorStatus sequencer_retiming_data_show_exec(bContext *C, wmOperato } if (sequencer_retiming_mode_is_active(C)) { - sequencer_retiming_data_hide_all(ed->seqbasep); + sequencer_retiming_data_hide_all(ed->current_strips()); } else if (seq::retiming_data_is_editable(strip_act)) { - sequencer_retiming_data_hide_selection(ed->seqbasep); + sequencer_retiming_data_hide_selection(ed->current_strips()); } else { - sequencer_retiming_data_show_selection(ed->seqbasep); + sequencer_retiming_data_show_selection(ed->current_strips()); } WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene); @@ -153,7 +153,7 @@ static wmOperatorStatus sequencer_retiming_reset_exec(bContext *C, wmOperator * Scene *scene = CTX_data_sequencer_scene(C); const Editing *ed = seq::editing_get(scene); - for (Strip *strip : seq::query_selected_strips(ed->seqbasep)) { + for (Strip *strip : seq::query_selected_strips(ed->current_strips())) { seq::retiming_reset(scene, strip); } diff --git a/source/blender/editors/space_sequencer/sequencer_select.cc b/source/blender/editors/space_sequencer/sequencer_select.cc index aca847d229f..6c92d4f0636 100644 --- a/source/blender/editors/space_sequencer/sequencer_select.cc +++ b/source/blender/editors/space_sequencer/sequencer_select.cc @@ -318,7 +318,7 @@ Strip *find_neighboring_strip(const Scene *scene, const Strip *test, const int l if (sel > 0) { sel = SELECT; } - LISTBASE_FOREACH (Strip *, strip, ed->seqbasep) { + LISTBASE_FOREACH (Strip *, strip, ed->current_strips()) { if ((strip != test) && (test->channel == strip->channel) && ((sel == -1) || (sel && (strip->flag & SELECT)) || (sel == 0 && (strip->flag & SELECT) == 0))) @@ -625,7 +625,7 @@ static void sequencer_select_linked_handle(const bContext *C, if ((strip->flag & SEQ_LEFTSEL) && (neighbor->flag & SEQ_RIGHTSEL)) { strip->flag |= SELECT; select_active_side(scene, - ed->seqbasep, + ed->current_strips(), seq::SIDE_LEFT, strip->channel, seq::time_left_handle_frame_get(scene, strip)); @@ -642,7 +642,7 @@ static void sequencer_select_linked_handle(const bContext *C, if ((strip->flag & SEQ_RIGHTSEL) && (neighbor->flag & SEQ_LEFTSEL)) { strip->flag |= SELECT; select_active_side(scene, - ed->seqbasep, + ed->current_strips(), seq::SIDE_RIGHT, strip->channel, seq::time_left_handle_frame_get(scene, strip)); @@ -660,7 +660,7 @@ static void sequencer_select_linked_handle(const bContext *C, else { select_active_side(scene, - ed->seqbasep, + ed->current_strips(), sel_side, strip->channel, seq::time_left_handle_frame_get(scene, strip)); @@ -1075,7 +1075,7 @@ static blender::Vector padded_strips_under_mouse_get(const Scene *scene } blender::Vector strips; - LISTBASE_FOREACH (Strip *, strip, ed->seqbasep) { + LISTBASE_FOREACH (Strip *, strip, ed->current_strips()) { if (strip->channel != int(mouse_co[1])) { continue; } @@ -1857,7 +1857,7 @@ static wmOperatorStatus sequencer_select_handles_exec(bContext *C, wmOperator *o Scene *scene = CTX_data_sequencer_scene(C); Editing *ed = seq::editing_get(scene); int sel_side = RNA_enum_get(op->ptr, "side"); - LISTBASE_FOREACH (Strip *, strip, ed->seqbasep) { + LISTBASE_FOREACH (Strip *, strip, ed->current_strips()) { if (strip->flag & SELECT) { Strip *l_neighbor = find_neighboring_strip(scene, strip, seq::SIDE_LEFT, -1); Strip *r_neighbor = find_neighboring_strip(scene, strip, seq::SIDE_RIGHT, -1); @@ -1904,7 +1904,7 @@ static wmOperatorStatus sequencer_select_handles_exec(bContext *C, wmOperator *o } } /* Select strips. */ - LISTBASE_FOREACH (Strip *, strip, ed->seqbasep) { + LISTBASE_FOREACH (Strip *, strip, ed->current_strips()) { if ((strip->flag & SEQ_LEFTSEL) || (strip->flag & SEQ_RIGHTSEL)) { if (!(strip->flag & SELECT)) { strip->flag |= SELECT; @@ -2036,7 +2036,7 @@ static wmOperatorStatus sequencer_select_side_exec(bContext *C, wmOperator *op) copy_vn_i(frame_ranges, ARRAY_SIZE(frame_ranges), frame_init); - LISTBASE_FOREACH (Strip *, strip, ed->seqbasep) { + LISTBASE_FOREACH (Strip *, strip, ed->current_strips()) { if (UNLIKELY(strip->channel >= seq::MAX_CHANNELS)) { continue; } @@ -2056,7 +2056,7 @@ static wmOperatorStatus sequencer_select_side_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } - select_active_side_range(scene, ed->seqbasep, sel_side, frame_ranges, frame_init); + select_active_side_range(scene, ed->current_strips(), sel_side, frame_ranges, frame_init); ED_outliner_select_sync_from_sequence_tag(C); @@ -2185,7 +2185,7 @@ static wmOperatorStatus sequencer_box_select_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } - LISTBASE_FOREACH (Strip *, strip, ed->seqbasep) { + LISTBASE_FOREACH (Strip *, strip, ed->current_strips()) { rctf rq; strip_rectf(scene, strip, &rq); if (BLI_rctf_isect(&rq, &rectf, nullptr)) { diff --git a/source/blender/editors/space_sequencer/sequencer_timeline_draw.cc b/source/blender/editors/space_sequencer/sequencer_timeline_draw.cc index 6c908ee8b84..95c545b9ea2 100644 --- a/source/blender/editors/space_sequencer/sequencer_timeline_draw.cc +++ b/source/blender/editors/space_sequencer/sequencer_timeline_draw.cc @@ -89,7 +89,7 @@ Vector sequencer_visible_strips_get(const Scene *scene, const View2D *v const Editing *ed = seq::editing_get(scene); Vector strips; - LISTBASE_FOREACH (Strip *, strip, ed->seqbasep) { + LISTBASE_FOREACH (Strip *, strip, ed->current_strips()) { if (min_ii(seq::time_left_handle_frame_get(scene, strip), seq::time_start_frame_get(strip)) > v2d->cur.xmax) { diff --git a/source/blender/editors/space_sequencer/space_sequencer.cc b/source/blender/editors/space_sequencer/space_sequencer.cc index cf045a8e854..62d1f51b885 100644 --- a/source/blender/editors/space_sequencer/space_sequencer.cc +++ b/source/blender/editors/space_sequencer/space_sequencer.cc @@ -487,7 +487,7 @@ static void sequencer_main_clamp_view(const bContext *C, ARegion *region) seq::timeline_init_boundbox(scene, &strip_boundbox); Editing *ed = seq::editing_get(scene); if (ed != nullptr) { - seq::timeline_expand_boundbox(scene, ed->seqbasep, &strip_boundbox); + seq::timeline_expand_boundbox(scene, ed->current_strips(), &strip_boundbox); } /* We need to calculate how much the current view is padded and add this padding to our * strip bounding box. Without this, the scrub-bar or other overlays would occlude the diff --git a/source/blender/editors/transform/transform_convert_sequencer.cc b/source/blender/editors/transform/transform_convert_sequencer.cc index 67ab0de957a..55c48dd036f 100644 --- a/source/blender/editors/transform/transform_convert_sequencer.cc +++ b/source/blender/editors/transform/transform_convert_sequencer.cc @@ -586,7 +586,7 @@ static void createTransSeqData(bContext * /*C*/, TransInfo *t) tc->custom.type.free_cb = freeSeqData; t->frame_side = transform_convert_frame_side_dir_get(t, float(scene->r.cfra)); - count = SeqTransCount(t, ed->seqbasep); + count = SeqTransCount(t, ed->current_strips()); /* Allocate memory for data. */ tc->data_len = count; @@ -615,7 +615,7 @@ static void createTransSeqData(bContext * /*C*/, TransInfo *t) ts->initial_v2d_cur = t->region->v2d.cur; /* Loop 2: build transdata array. */ - SeqToTransData_build(t, ed->seqbasep, td, td2d, tdsq); + SeqToTransData_build(t, ed->current_strips(), td, td2d, tdsq); create_trans_seq_clamp_data(t, scene); diff --git a/source/blender/editors/transform/transform_snap_sequencer.cc b/source/blender/editors/transform/transform_snap_sequencer.cc index af67878ed37..f8ffe0c2c51 100644 --- a/source/blender/editors/transform/transform_snap_sequencer.cc +++ b/source/blender/editors/transform/transform_snap_sequencer.cc @@ -78,7 +78,8 @@ static VectorSet query_snap_sources_preview(const Scene *scene) Editing *ed = seq::editing_get(scene); ListBase *channels = seq::channels_displayed_get(ed); - snap_sources = seq::query_rendered_strips(scene, channels, ed->seqbasep, scene->r.cfra, 0); + snap_sources = seq::query_rendered_strips( + scene, channels, ed->current_strips(), scene->r.cfra, 0); snap_sources.remove_if([&](Strip *strip) { return (strip->flag & SELECT) == 0; }); return snap_sources; @@ -252,7 +253,8 @@ static VectorSet query_snap_targets_preview(const TransInfo *t) Editing *ed = seq::editing_get(scene); ListBase *channels = seq::channels_displayed_get(ed); - snap_targets = seq::query_rendered_strips(scene, channels, ed->seqbasep, scene->r.cfra, 0); + snap_targets = seq::query_rendered_strips( + scene, channels, ed->current_strips(), scene->r.cfra, 0); /* Selected strips are only valid targets when snapping the cursor or origin. */ if ((t->data_type == &TransConvertType_SequencerImage) && (t->flag & T_ORIGIN) == 0) { diff --git a/source/blender/makesdna/DNA_sequence_types.h b/source/blender/makesdna/DNA_sequence_types.h index 02355e5c0c8..c003537fb8f 100644 --- a/source/blender/makesdna/DNA_sequence_types.h +++ b/source/blender/makesdna/DNA_sequence_types.h @@ -331,8 +331,15 @@ typedef struct EditingRuntime { } EditingRuntime; typedef struct Editing { - /** Pointer to the current list of strips being edited (can be within a meta-strip). */ + /** + * Pointer to the current list of strips being edited (can be within a meta-strip). + * \note Use #current_strips() to access, rather than using this variable directly. + */ ListBase *seqbasep; + /** + * Pointer to the current list of channels being displayed (can be within a meta-strip). + * \note Use #current_channels() to access, rather than using this variable directly. + */ ListBase *displayed_channels; void *_pad0; /** Pointer to the top-most strips. */ @@ -355,6 +362,16 @@ typedef struct Editing { PrefetchJob *prefetch_job; EditingRuntime runtime; + +#ifdef __cplusplus + /** Access currently displayed strips, from root sequence or a meta-strip. */ + ListBase *current_strips(); + ListBase *current_strips() const; + + /** Access currently displayed channels, from root sequence or a meta-strip. */ + ListBase *current_channels(); + ListBase *current_channels() const; +#endif } Editing; /** \} */ diff --git a/source/blender/sequencer/intern/channels.cc b/source/blender/sequencer/intern/channels.cc index df76b397ff6..978ebbe0965 100644 --- a/source/blender/sequencer/intern/channels.cc +++ b/source/blender/sequencer/intern/channels.cc @@ -27,7 +27,7 @@ namespace blender::seq { ListBase *channels_displayed_get(const Editing *ed) { - return ed->displayed_channels; + return ed->current_channels(); } void channels_displayed_set(Editing *ed, ListBase *channels) diff --git a/source/blender/sequencer/intern/prefetch.cc b/source/blender/sequencer/intern/prefetch.cc index 5d80a32f7e5..d6500519dd7 100644 --- a/source/blender/sequencer/intern/prefetch.cc +++ b/source/blender/sequencer/intern/prefetch.cc @@ -585,7 +585,7 @@ static PrefetchJob *seq_prefetch_start_ex(const RenderData *context, float cfra) pfjob->bmain_eval = BKE_main_new(); pfjob->scene = context->scene; - pfjob->seqbasep = context->scene->ed->seqbasep; + pfjob->seqbasep = context->scene->ed->current_strips(); seq_prefetch_init_depsgraph(pfjob); } pfjob->bmain = context->bmain; @@ -616,7 +616,7 @@ void seq_prefetch_start(const RenderData *context, float timeline_frame) { Scene *scene = context->scene; Editing *ed = scene->ed; - bool has_strips = bool(ed->seqbasep->first); + bool has_strips = bool(ed->current_strips()->first); if (!context->is_prefetch_render && !context->is_proxy_render) { bool playing = context->is_playing; diff --git a/source/blender/sequencer/intern/render.cc b/source/blender/sequencer/intern/render.cc index 12c26456864..4fd86c35ecd 100644 --- a/source/blender/sequencer/intern/render.cc +++ b/source/blender/sequencer/intern/render.cc @@ -1990,8 +1990,8 @@ ImBuf *render_give_ibuf(const RenderData *context, float timeline_frame, int cha chanshown = 0; } else { - seqbasep = ed->seqbasep; - channels = ed->displayed_channels; + seqbasep = ed->current_strips(); + channels = ed->current_channels(); } intra_frame_cache_set_cur_frame( diff --git a/source/blender/sequencer/intern/sequencer.cc b/source/blender/sequencer/intern/sequencer.cc index e092c5633c6..a813b94dd9e 100644 --- a/source/blender/sequencer/intern/sequencer.cc +++ b/source/blender/sequencer/intern/sequencer.cc @@ -426,7 +426,7 @@ ListBase *active_seqbase_get(const Editing *ed) return nullptr; } - return ed->seqbasep; + return ed->current_strips(); } void active_seqbase_set(Editing *ed, ListBase *seqbase) @@ -1158,3 +1158,23 @@ void eval_strips(Depsgraph *depsgraph, Scene *scene, ListBase *seqbase) } } // namespace blender::seq + +ListBase *Editing::current_strips() +{ + return this->seqbasep; +} +ListBase *Editing::current_strips() const +{ + /* NOTE: Const correctness is non-existent with ListBase anyway. */ + return this->seqbasep; +} + +ListBase *Editing::current_channels() +{ + return this->displayed_channels; +} +ListBase *Editing::current_channels() const +{ + /* NOTE: Const correctness is non-existent with ListBase anyway. */ + return this->displayed_channels; +} diff --git a/source/blender/sequencer/intern/strip_retiming.cc b/source/blender/sequencer/intern/strip_retiming.cc index a1ed0d4b0ee..aa07bd4aa0a 100644 --- a/source/blender/sequencer/intern/strip_retiming.cc +++ b/source/blender/sequencer/intern/strip_retiming.cc @@ -1081,7 +1081,7 @@ bool retiming_selection_clear(const Editing *ed) { bool was_empty = true; - LISTBASE_FOREACH (Strip *, strip, ed->seqbasep) { + LISTBASE_FOREACH (Strip *, strip, ed->current_strips()) { for (SeqRetimingKey &key : retiming_keys_get(strip)) { was_empty &= (key.flag & SEQ_KEY_SELECTED) == 0; key.flag &= ~SEQ_KEY_SELECTED; @@ -1114,7 +1114,7 @@ blender::Map retiming_selection_get(const Editing *ed if (!ed) { return selection; } - LISTBASE_FOREACH (Strip *, strip, ed->seqbasep) { + LISTBASE_FOREACH (Strip *, strip, ed->current_strips()) { for (SeqRetimingKey &key : retiming_keys_get(strip)) { if ((key.flag & SEQ_KEY_SELECTED) != 0) { selection.add(&key, strip); @@ -1126,7 +1126,7 @@ blender::Map retiming_selection_get(const Editing *ed bool retiming_selection_contains(const Editing *ed, const SeqRetimingKey *key) { - LISTBASE_FOREACH (Strip *, strip, ed->seqbasep) { + LISTBASE_FOREACH (Strip *, strip, ed->current_strips()) { for (const SeqRetimingKey &key_iter : retiming_keys_get(strip)) { if ((key_iter.flag & SEQ_KEY_SELECTED) != 0 && &key_iter == key) { return true; diff --git a/source/blender/sequencer/intern/strip_select.cc b/source/blender/sequencer/intern/strip_select.cc index ffa7cd8a6b5..af1534f8bea 100644 --- a/source/blender/sequencer/intern/strip_select.cc +++ b/source/blender/sequencer/intern/strip_select.cc @@ -52,7 +52,7 @@ bool select_active_get_pair(Scene *scene, Strip **r_strip_act, Strip **r_strip_o *r_strip_other = nullptr; - LISTBASE_FOREACH (Strip *, strip, ed->seqbasep) { + LISTBASE_FOREACH (Strip *, strip, ed->current_strips()) { if (strip->flag & SELECT && (strip != (*r_strip_act))) { if (*r_strip_other) { return false; diff --git a/source/blender/sequencer/intern/strip_time.cc b/source/blender/sequencer/intern/strip_time.cc index ff539d86f40..70796d8048b 100644 --- a/source/blender/sequencer/intern/strip_time.cc +++ b/source/blender/sequencer/intern/strip_time.cc @@ -258,7 +258,7 @@ int time_find_next_prev_edit(Scene *scene, return timeline_frame; } - LISTBASE_FOREACH (Strip *, strip, ed->seqbasep) { + LISTBASE_FOREACH (Strip *, strip, ed->current_strips()) { int i; if (do_skip_mute && render_is_muted(channels, strip)) { diff --git a/source/blender/sequencer/intern/utils.cc b/source/blender/sequencer/intern/utils.cc index 8f011c39f9f..fc528fa26b7 100644 --- a/source/blender/sequencer/intern/utils.cc +++ b/source/blender/sequencer/intern/utils.cc @@ -344,7 +344,7 @@ const Strip *strip_topmost_get(const Scene *scene, int frame) const Strip *best_strip = nullptr; int best_channel = -1; - LISTBASE_FOREACH (const Strip *, strip, ed->seqbasep) { + LISTBASE_FOREACH (const Strip *, strip, ed->current_strips()) { if (render_is_muted(channels, strip) || !time_strip_intersects_frame(scene, strip, frame)) { continue; } diff --git a/tests/python/sequencer_load_meta_stack.py b/tests/python/sequencer_load_meta_stack.py index 4d53cc61211..89f270440e4 100644 --- a/tests/python/sequencer_load_meta_stack.py +++ b/tests/python/sequencer_load_meta_stack.py @@ -26,7 +26,7 @@ class SequencerLoadMetastaskTest(unittest.TestCase): self.assertEqual(len(meta_stack[0].sequences), 1) self.assertEqual(meta_stack[0].sequences[0].name, "Color") - # accesses ed->seqbasep through screen_ctx_selected_editable_sequences + # accesses ed->current_strips() through screen_ctx_selected_editable_sequences bpy.context.copy()