Fix #128012: disabling "Load UI" makes nodes unselectable

Resolve regression in [0] which caused the tool not to refresh
when loading a file without it's UI.

[0]: 83fe5712ab
This commit is contained in:
Campbell Barton
2024-09-24 17:41:53 +10:00
parent 5b5576993e
commit 22397ad819
3 changed files with 20 additions and 0 deletions

View File

@@ -692,6 +692,12 @@ ScrArea *BKE_screen_find_area_xy(const bScreen *screen, int spacetype, const int
void BKE_screen_gizmo_tag_refresh(bScreen *screen);
/**
* Refresh any screen data that should be set on file-load
* with "Load UI" disabled.
*/
void BKE_screen_runtime_refresh_for_blendfile(bScreen *screen);
void BKE_screen_view3d_sync(View3D *v3d, Scene *scene);
void BKE_screen_view3d_scene_sync(bScreen *screen, Scene *scene);
bool BKE_screen_is_fullscreen_area(const bScreen *screen) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();

View File

@@ -956,6 +956,12 @@ static void setup_app_data(bContext *C,
}
}
}
if (mode != LOAD_UI) {
LISTBASE_FOREACH (bScreen *, screen, &bfd->main->screens) {
BKE_screen_runtime_refresh_for_blendfile(screen);
}
}
}
/* Logic for 'track_undo_scene' is to keep using the scene which the active screen has, as long

View File

@@ -481,6 +481,14 @@ void BKE_screen_gizmo_tag_refresh(bScreen *screen)
}
}
void BKE_screen_runtime_refresh_for_blendfile(bScreen *screen)
{
LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
area->runtime.tool = nullptr;
area->runtime.is_tool_set = false;
}
}
/**
* Avoid bad-level calls to #WM_gizmomap_delete.
*/