From 8ecf35d850fd17d44a60bcbea723d542d2139774 Mon Sep 17 00:00:00 2001 From: Matthias Ellerbeck Date: Mon, 19 Mar 2018 21:30:33 +0100 Subject: 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 --- source/blender/nodes/intern/node_util.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source') 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 -- cgit v1.2.3