Fix #141070: missing viewport update after disabling viewer

Pull Request: https://projects.blender.org/blender/blender/pulls/141320
This commit is contained in:
Jacques Lucke
2025-07-02 17:32:37 +02:00
parent 92d72467a7
commit ebf9449518

View File

@@ -643,6 +643,15 @@ static bool node_mouse_select(bContext *C,
if (node == nullptr) {
/* Disable existing active viewer. */
WorkSpace *workspace = CTX_wm_workspace(C);
if (const std::optional<viewer_path::ViewerPathForGeometryNodesViewer> parsed_path =
viewer_path::parse_geometry_nodes_viewer(workspace->viewer_path))
{
/* The object needs to be reevaluated, because the viewer path is changed which means that
* the object may generate different viewer geometry as a side effect. */
Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
DEG_id_tag_update_for_side_effect_request(
depsgraph, &parsed_path->object->id, ID_RECALC_GEOMETRY);
}
BKE_viewer_path_clear(&workspace->viewer_path);
WM_event_add_notifier(C, NC_VIEWER_PATH, nullptr);
}