[Bf-blender-cvs] [5c42e54f6ed] blender-v3.4-release: Fix T101536: missing node tree updates after remapping id

Jacques Lucke noreply at git.blender.org
Tue Nov 15 12:10:31 CET 2022


Commit: 5c42e54f6ed7d5060122101c2fa14d2cf55a1081
Author: Jacques Lucke
Date:   Tue Nov 15 12:07:38 2022 +0100
Branches: blender-v3.4-release
https://developer.blender.org/rB5c42e54f6ed7d5060122101c2fa14d2cf55a1081

Fix T101536: missing node tree updates after remapping id

The main problem is that the node tree was not properly updated
after a property in the tree changed. More specifically, the collection
pointer in the Collection Info node was cleared, but the node tree
was not updated after that (usually this is handled by rna updates).

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

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

M	source/blender/blenkernel/intern/lib_remap.c
M	source/blender/editors/space_outliner/outliner_tools.cc

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

diff --git a/source/blender/blenkernel/intern/lib_remap.c b/source/blender/blenkernel/intern/lib_remap.c
index addb7b0988c..462ec2d9816 100644
--- a/source/blender/blenkernel/intern/lib_remap.c
+++ b/source/blender/blenkernel/intern/lib_remap.c
@@ -27,6 +27,7 @@
 #include "BKE_modifier.h"
 #include "BKE_multires.h"
 #include "BKE_node.h"
+#include "BKE_node_tree_update.h"
 #include "BKE_object.h"
 
 #include "DEG_depsgraph.h"
@@ -117,6 +118,11 @@ static void foreach_libblock_remap_callback_apply(ID *id_owner,
                            id_owner,
                            ID_RECALC_COPY_ON_WRITE | ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY);
     }
+    if (GS(id_owner->name) == ID_NT) {
+      /* Make sure that the node tree is updated after a property in it changed. Ideally, we would
+       * know which nodes property was changed so that only this node is tagged. */
+      BKE_ntree_update_tag_all((bNodeTree *)id_owner);
+    }
   }
   /* Get the new_id pointer. When the mapping is violating never null we should use a NULL
    * pointer otherwise the incorrect users are decreased and increased on the same instance. */
diff --git a/source/blender/editors/space_outliner/outliner_tools.cc b/source/blender/editors/space_outliner/outliner_tools.cc
index 81e36fa6764..6c7f5067c51 100644
--- a/source/blender/editors/space_outliner/outliner_tools.cc
+++ b/source/blender/editors/space_outliner/outliner_tools.cc
@@ -60,6 +60,7 @@
 #include "DEG_depsgraph.h"
 #include "DEG_depsgraph_build.h"
 
+#include "ED_node.h"
 #include "ED_object.h"
 #include "ED_outliner.h"
 #include "ED_scene.h"
@@ -2458,6 +2459,8 @@ static int outliner_delete_exec(bContext *C, wmOperator *op)
     WM_msg_publish_rna_prop(mbus, &scene->id, view_layer, LayerObjects, active);
   }
 
+  ED_node_tree_propagate_change(C, bmain, nullptr);
+
   DEG_id_tag_update(&scene->id, ID_RECALC_SELECT);
   WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene);
   WM_event_add_notifier(C, NC_SCENE | ND_LAYER_CONTENT, scene);
@@ -2764,6 +2767,8 @@ static int outliner_id_operation_exec(bContext *C, wmOperator *op)
       break;
   }
 
+  ED_node_tree_propagate_change(C, bmain, nullptr);
+
   /* wrong notifier still... */
   WM_event_add_notifier(C, NC_ID | NA_EDITED, nullptr);



More information about the Bf-blender-cvs mailing list