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
This commit is contained in:
Matthias Ellerbeck 2018-03-19 21:30:33 +01:00 committed by Brecht Van Lommel
parent 148b0fef09
commit 8ecf35d850
Notes: blender-bot 2023-02-14 08:28:46 +01:00
Referenced by issue #54240, Node editor: replacing connection to principled BSDF clearcoat normal sends old connection to clearcoat weight
1 changed files with 5 additions and 0 deletions

View File

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