Commit: a988099ee478dd7ab0eca79a24fb6102c5b68f82
Author: Jacques Lucke
Date:   Thu Mar 4 13:32:33 2021 +0100
Branches: master
https://developer.blender.org/rBa988099ee478dd7ab0eca79a24fb6102c5b68f82

Fix T86172: tag relations update when pasting nodes

Pasting nodes can create new id relations, because nodes can reference IDs.
Therefore the depsgraph has to be updated when nodes are pasted.
We could somehow check if the pasted nodes referenced IDs, but I'm not sure
if this complexity is worth it.

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

M       source/blender/editors/space_node/node_edit.c

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

diff --git a/source/blender/editors/space_node/node_edit.c 
b/source/blender/editors/space_node/node_edit.c
index 4826b6c72ba..5205e50b0bf 100644
--- a/source/blender/editors/space_node/node_edit.c
+++ b/source/blender/editors/space_node/node_edit.c
@@ -2231,10 +2231,13 @@ static int node_clipboard_paste_exec(bContext *C, 
wmOperator *op)
                 link->tosock->new_sock);
   }
 
-  ntreeUpdateTree(CTX_data_main(C), snode->edittree);
+  Main *bmain = CTX_data_main(C);
+  ntreeUpdateTree(bmain, snode->edittree);
 
   snode_notify(C, snode);
   snode_dag_update(C, snode);
+  /* Pasting nodes can create arbitrary new relations, because nodes can 
reference IDs. */
+  DEG_relations_tag_update(bmain);
 
   return OPERATOR_FINISHED;
 }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to