From a988099ee478dd7ab0eca79a24fb6102c5b68f82 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Thu, 4 Mar 2021 13:32:33 +0100 Subject: 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. --- source/blender/editors/space_node/node_edit.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; } -- cgit v1.2.3