[Bf-blender-cvs] [8ecf35d850f] master: Fix T54240: automatic node link moving should take into account type.

Matthias Ellerbeck noreply at git.blender.org
Mon Mar 19 21:53:50 CET 2018


Commit: 8ecf35d850fd17d44a60bcbea723d542d2139774
Author: Matthias Ellerbeck
Date:   Mon Mar 19 21:30:33 2018 +0100
Branches: master
https://developer.blender.org/rB8ecf35d850fd17d44a60bcbea723d542d2139774

Fix T54240: automatic node link moving should take into account type.

Without this a "Clearcoat" link could be moved to "Clearcoat Normal"
for example, which doesn't make much sense.

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

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

M	source/blender/nodes/intern/node_util.c

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

diff --git a/source/blender/nodes/intern/node_util.c b/source/blender/nodes/intern/node_util.c
index 43d4136d556..9f04c12fb5e 100644
--- a/source/blender/nodes/intern/node_util.c
+++ b/source/blender/nodes/intern/node_util.c
@@ -124,6 +124,11 @@ void node_filter_label(bNodeTree *UNUSED(ntree), bNode *node, char *label, int m
 /* test if two sockets are interchangeable */
 static bool node_link_socket_match(bNodeSocket *a, bNodeSocket *b)
 {
+	/* check if sockets are of the same type */
+	if (a->typeinfo != b->typeinfo) {
+		return false;
+	}
+
 	/* tests if alphabetic prefix matches
 	 * this allows for imperfect matches, such as numeric suffixes,
 	 * like Color1/Color2



More information about the Bf-blender-cvs mailing list