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.
This commit is contained in:
2021-03-04 13:32:33 +01:00
parent 386e3dd842
commit a988099ee4

View File

@@ -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;
}