diff --git a/source/blender/blenkernel/intern/blendfile.cc b/source/blender/blenkernel/intern/blendfile.cc index f162faeff22..90e4a446e54 100644 --- a/source/blender/blenkernel/intern/blendfile.cc +++ b/source/blender/blenkernel/intern/blendfile.cc @@ -800,6 +800,19 @@ static void setup_app_data(bContext *C, wm_data_consistency_ensure(CTX_wm_manager(C), curscene, cur_view_layer); } + if (mode == LOAD_UNDO) { + /* It's possible to undo into a time before the scene existed, in this case the window's scene + * will be null. Since it doesn't make sense to remove the window, set it to the current scene. + * NOTE: Redo will restore the active scene to the window so a reasonably consistent state + * is maintained. We could do better by keeping a window/scene map for each undo step. */ + wmWindowManager *wm = static_cast(bfd->main->wm.first); + LISTBASE_FOREACH (wmWindow *, win, &wm->windows) { + if (win->scene == nullptr) { + win->scene = curscene; + } + } + } + BLI_assert(BKE_main_namemap_validate(bfd->main)); if (mode != LOAD_UI) { diff --git a/source/blender/nodes/geometry/nodes/node_geo_tool_set_selection.cc b/source/blender/nodes/geometry/nodes/node_geo_tool_set_selection.cc index 58b9ff246cd..b20ea71dd36 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_tool_set_selection.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_tool_set_selection.cc @@ -18,7 +18,7 @@ namespace blender::nodes::node_geo_tool_set_selection_cc { static void node_declare(NodeDeclarationBuilder &b) { b.add_input("Geometry"); - b.add_input("Selection").default_value(true).hide_value().field_on_all(); + b.add_input("Selection").default_value(true).field_on_all(); b.add_output("Geometry"); }