[Bf-blender-cvs] [4cf3010714e] master: Fix T87171: Update multi input socket indices

Fabian Schempp noreply at git.blender.org
Thu Apr 15 11:39:06 CEST 2021


Commit: 4cf3010714e92af52a1943feac0c89a9a41f297f
Author: Fabian Schempp
Date:   Thu Apr 15 11:38:46 2021 +0200
Branches: master
https://developer.blender.org/rB4cf3010714e92af52a1943feac0c89a9a41f297f

Fix T87171: Update multi input socket indices

When inserting a node on top of a link, the multi input socket
indices weren't updated. This fixes that and keeps the relative
order of the links the same.

Author: Wannes Malfait

Reviewed By: Fabian Schempp

Differential Revision: https://developer.blender.org/D10969

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

M	release/scripts/addons_contrib
M	source/blender/editors/space_node/node_relationships.c
M	source/tools

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

diff --git a/release/scripts/addons_contrib b/release/scripts/addons_contrib
index 5523cbaed60..2ffe34eb02a 160000
--- a/release/scripts/addons_contrib
+++ b/release/scripts/addons_contrib
@@ -1 +1 @@
-Subproject commit 5523cbaed60719960f5f7b2486925145ecbe81e5
+Subproject commit 2ffe34eb02a81fb7023bd7dbfb8651865cb33921
diff --git a/source/blender/editors/space_node/node_relationships.c b/source/blender/editors/space_node/node_relationships.c
index 4fa0c8c3c5a..8b0d7ef77b3 100644
--- a/source/blender/editors/space_node/node_relationships.c
+++ b/source/blender/editors/space_node/node_relationships.c
@@ -2260,7 +2260,12 @@ void ED_node_link_insert(Main *bmain, ScrArea *area)
       node_remove_extra_links(snode, link);
       link->flag &= ~NODE_LINKFLAG_HILITE;
 
-      nodeAddLink(snode->edittree, select, best_output, node, sockto);
+      bNodeLink *new_link = nodeAddLink(snode->edittree, select, best_output, node, sockto);
+
+      /* Copy the socket index for the new link, and reset it for the old link. This way the
+       * relative order of links is preserved, and the links get drawn in the right place. */
+      new_link->multi_input_socket_index = link->multi_input_socket_index;
+      link->multi_input_socket_index = 0;
 
       /* set up insert offset data, it needs stuff from here */
       if ((snode->flag & SNODE_SKIP_INSOFFSET) == 0) {
@@ -2277,8 +2282,6 @@ void ED_node_link_insert(Main *bmain, ScrArea *area)
       snode_update(snode, select);
       ED_node_tag_update_id((ID *)snode->edittree);
       ED_node_tag_update_id(snode->id);
-
-      sort_multi_input_socket_links(snode, node, NULL, NULL);
     }
   }
 }
diff --git a/source/tools b/source/tools
index f1db70de645..f99d29ae3e6 160000
--- a/source/tools
+++ b/source/tools
@@ -1 +1 @@
-Subproject commit f1db70de64574921180b2c99519027d44d5350fc
+Subproject commit f99d29ae3e6ad44d45d79309454c45f8088781a4



More information about the Bf-blender-cvs mailing list