[Bf-blender-cvs] [cc8df686ad7] blender-v3.3-release: Fix missing Outliner updates when adding nodetrees

Philipp Oeser noreply at git.blender.org
Fri Sep 30 15:08:19 CEST 2022


Commit: cc8df686ad7b91f279072529d586d4ecf67f3e38
Author: Philipp Oeser
Date:   Wed Sep 28 15:08:09 2022 +0200
Branches: blender-v3.3-release
https://developer.blender.org/rBcc8df686ad7b91f279072529d586d4ecf67f3e38

Fix missing Outliner updates when adding nodetrees

When e.g. grouping nodes into nodegroups, these would not show up
immediately in the Outliner (Blender File / Data API view).

Now send (unique combination, not used elsewhere) notifiers (and listen
for these in the Outliner).

Differential Revision: https://developer.blender.org/D16093

===================================================================

M	source/blender/editors/curves/intern/curves_ops.cc
M	source/blender/editors/space_node/node_add.cc
M	source/blender/editors/space_node/node_group.cc
M	source/blender/editors/space_outliner/space_outliner.cc

===================================================================

diff --git a/source/blender/editors/curves/intern/curves_ops.cc b/source/blender/editors/curves/intern/curves_ops.cc
index eec2c5d205d..c868a94dfee 100644
--- a/source/blender/editors/curves/intern/curves_ops.cc
+++ b/source/blender/editors/curves/intern/curves_ops.cc
@@ -998,6 +998,7 @@ static int surface_set_exec(bContext *C, wmOperator *op)
 
     DEG_id_tag_update(&curves_ob.id, ID_RECALC_TRANSFORM);
     WM_event_add_notifier(C, NC_GEOM | ND_DATA, &curves_id);
+    WM_event_add_notifier(C, NC_NODE | NA_ADDED, NULL);
 
     /* Required for deformation. */
     new_surface_ob.modifier_flag |= OB_MODIFIER_FLAG_ADD_REST_POSITION;
diff --git a/source/blender/editors/space_node/node_add.cc b/source/blender/editors/space_node/node_add.cc
index e96efb888f3..aca16592ce4 100644
--- a/source/blender/editors/space_node/node_add.cc
+++ b/source/blender/editors/space_node/node_add.cc
@@ -851,6 +851,8 @@ static int new_node_tree_exec(bContext *C, wmOperator *op)
     ED_node_tree_update(C);
   }
 
+  WM_event_add_notifier(C, NC_NODE | NA_ADDED, NULL);
+
   return OPERATOR_FINISHED;
 }
 
diff --git a/source/blender/editors/space_node/node_group.cc b/source/blender/editors/space_node/node_group.cc
index a926f7e8917..8f8945050ea 100644
--- a/source/blender/editors/space_node/node_group.cc
+++ b/source/blender/editors/space_node/node_group.cc
@@ -1045,6 +1045,8 @@ static int node_group_make_exec(bContext *C, wmOperator *op)
 
   ED_node_tree_propagate_change(C, bmain, nullptr);
 
+  WM_event_add_notifier(C, NC_NODE | NA_ADDED, NULL);
+
   /* We broke relations in node tree, need to rebuild them in the graphs. */
   DEG_relations_tag_update(bmain);
 
diff --git a/source/blender/editors/space_outliner/space_outliner.cc b/source/blender/editors/space_outliner/space_outliner.cc
index 9e95f8ba4c9..d62114a41c7 100644
--- a/source/blender/editors/space_outliner/space_outliner.cc
+++ b/source/blender/editors/space_outliner/space_outliner.cc
@@ -256,6 +256,12 @@ static void outliner_main_region_listener(const wmRegionListenerParams *params)
         ED_region_tag_redraw(region);
       }
       break;
+    case NC_NODE:
+      if (ELEM(wmn->action, NA_ADDED, NA_REMOVED) &&
+          ELEM(space_outliner->outlinevis, SO_LIBRARIES, SO_DATA_API)) {
+        ED_region_tag_redraw(region);
+      }
+      break;
   }
 }



More information about the Bf-blender-cvs mailing list