diff --git a/source/blender/blenloader/intern/versioning_500.cc b/source/blender/blenloader/intern/versioning_500.cc index 37af962d2b7..8c6e1fdea38 100644 --- a/source/blender/blenloader/intern/versioning_500.cc +++ b/source/blender/blenloader/intern/versioning_500.cc @@ -2448,6 +2448,19 @@ static void do_version_bokeh_blur_pixel_size(bNodeTree &node_tree, bNode &node) } } +static bool window_has_sequence_editor_open(const wmWindow *win) +{ + bScreen *screen = WM_window_get_active_screen(win); + LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) { + LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) { + if (sl->spacetype == SPACE_SEQ) { + return true; + } + } + } + return false; +} + void do_versions_after_linking_500(FileData *fd, Main *bmain) { if (!MAIN_VERSION_FILE_ATLEAST(bmain, 500, 9)) { @@ -2539,9 +2552,13 @@ void do_versions_after_linking_500(FileData *fd, Main *bmain) if (!MAIN_VERSION_FILE_ATLEAST(bmain, 500, 63)) { LISTBASE_FOREACH (wmWindowManager *, wm, &bmain->wm) { LISTBASE_FOREACH (wmWindow *, win, &wm->windows) { - Scene *scene = WM_window_get_active_scene(win); - WorkSpace *workspace = WM_window_get_active_workspace(win); - workspace->sequencer_scene = scene; + if (window_has_sequence_editor_open(win)) { + Scene *scene = WM_window_get_active_scene(win); + if (scene->ed != nullptr) { + WorkSpace *workspace = WM_window_get_active_workspace(win); + workspace->sequencer_scene = scene; + } + } } } } diff --git a/tests/python/bl_blendfile_relationships.py b/tests/python/bl_blendfile_relationships.py index c4859ec9660..5de8787ab3e 100644 --- a/tests/python/bl_blendfile_relationships.py +++ b/tests/python/bl_blendfile_relationships.py @@ -46,7 +46,7 @@ class TestBlendUserMap(TestBlendLibLinkHelper): expected_map = { bpy.data.images[0]: {bpy.data.materials[0]}, bpy.data.materials[0]: {bpy.data.meshes[0]}, - bpy.data.scenes[0]: {bpy.data.window_managers[0], bpy.data.workspaces['Layout']}, + bpy.data.scenes[0]: {bpy.data.window_managers[0]}, bpy.data.collections[0]: {bpy.data.scenes[0]}, bpy.data.libraries[0]: set(), bpy.data.meshes[0]: {bpy.data.objects[0]},