main sync #3

Merged
Patrick Busch merged 318 commits from blender/blender:main into main 2023-03-17 15:52:21 +01:00
Showing only changes of commit f46fb8051d - Show all commits

View File

@ -958,20 +958,33 @@ static void node_swap_links(bNodeLinkDrag &nldrag, bNodeTree &ntree)
if (linked_socket.is_input()) {
LISTBASE_FOREACH (bNodeLink *, link, &ntree.links) {
if (link->tosock == &linked_socket) {
if (link->tosock != &linked_socket) {
continue;
}
if (link->fromnode == start_node) {
/* Don't link a node to itself. */
nodeRemLink(&ntree, link);
continue;
}
link->tosock = start_socket;
link->tonode = start_node;
}
}
}
else {
LISTBASE_FOREACH (bNodeLink *, link, &ntree.links) {
if (link->fromsock == &linked_socket) {
if (link->fromsock != &linked_socket) {
continue;
}
if (link->tonode == start_node) {
/* Don't link a node to itself. */
nodeRemLink(&ntree, link);
continue;
}
link->fromsock = start_socket;
link->fromnode = start_node;
}
}
}
BKE_ntree_update_tag_link_changed(&ntree);
}