Fix #141070: missing viewport update after disabling viewer
Pull Request: https://projects.blender.org/blender/blender/pulls/141320
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user