diff options
author | Jacques Lucke <jacques@blender.org> | 2021-03-04 15:32:33 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2021-03-04 15:33:03 +0300 |
commit | a988099ee478dd7ab0eca79a24fb6102c5b68f82 (patch) | |
tree | 25be2300d9d46d9c233a60244972a3fd58abef23 /source/blender/editors/space_node/node_edit.c | |
parent | 386e3dd842a7ed6a9cc068e3fb02478cc97969e5 (diff) |
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.
Diffstat (limited to 'source/blender/editors/space_node/node_edit.c')
-rw-r--r-- | source/blender/editors/space_node/node_edit.c | 5 |
1 files changed, 4 insertions, 1 deletions
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; } |