From cd40f5b0f106bced98be6277a3603d4c55367698 Mon Sep 17 00:00:00 2001 From: Falk David Date: Tue, 30 Sep 2025 10:38:30 +0200 Subject: [PATCH] VSE: Story Tools: Sync object modes when switching scenes Currenty, when switching from one scene to another, the mode of the active objects (before & after) is left untouched. This becomes a workflow problem when trying to work across different scenes. E.g. when opening the new "Storyboarding" template and scrubbing to the next scene strip, the Grease Pencil object is now in Object Mode, when in the previous shot it was in Draw Mode. To solve this, when syncing scenes try to change the mode of the next active object to the mode of the previous active object if the type of the object is the same. Pull Request: https://projects.blender.org/blender/blender/pulls/146981 --- .../editors/space_sequencer/sequencer_edit.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/source/blender/editors/space_sequencer/sequencer_edit.cc b/source/blender/editors/space_sequencer/sequencer_edit.cc index fad4064a194..09d09a48a93 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.cc +++ b/source/blender/editors/space_sequencer/sequencer_edit.cc @@ -29,6 +29,7 @@ #include "BKE_context.hh" #include "BKE_global.hh" +#include "BKE_layer.hh" #include "BKE_library.hh" #include "BKE_main.hh" #include "BKE_report.hh" @@ -63,6 +64,7 @@ /* For menu, popup, icons, etc. */ #include "ED_fileselect.hh" #include "ED_numinput.hh" +#include "ED_object.hh" #include "ED_scene.hh" #include "ED_screen.hh" #include "ED_screen_types.hh" @@ -369,6 +371,8 @@ void sync_active_scene_and_time_with_scene_strip(bContext &C) wmWindow *win = CTX_wm_window(&C); Scene *active_scene = WM_window_get_active_scene(win); + ViewLayer *view_layer = WM_window_get_active_view_layer(win); + Object *prev_obact = BKE_view_layer_active_object_get(view_layer); Editing *ed = seq::editing_get(sequence_scene); if (!ed) { @@ -448,6 +452,14 @@ void sync_active_scene_and_time_with_scene_strip(bContext &C) } FRAMENUMBER_MIN_CLAMP(active_scene->r.cfra); + /* Try to sync the object mode of the active object. */ + if (prev_obact) { + Object *obact = CTX_data_active_object(&C); + if (obact && prev_obact->type == obact->type) { + ed::object::mode_set(&C, eObjectMode(prev_obact->mode)); + } + } + DEG_id_tag_update(&active_scene->id, ID_RECALC_FRAME_CHANGE); WM_event_add_notifier(&C, NC_WINDOW, nullptr); WM_event_add_notifier(&C, NC_SCENE | ND_FRAME, nullptr);