From c36eccfae9ee29cd5e529e9a48cdd5b06bbb294c Mon Sep 17 00:00:00 2001 From: Weizhen Huang Date: Fri, 4 Aug 2023 16:32:33 +0200 Subject: [PATCH] Nodes: Copy socket values with the same `identifier` instead of `name` `identifier` should be a better measure than `name` to check if a socket has the same meaning among different nodes. Sometimes two sockets can have the same name in the UI but have different (physical) meanings, they can specify different identifiers to avoid the values being copied when the nodes are replaced. Pull Request: https://projects.blender.org/blender/blender/pulls/110792 --- source/blender/editors/space_node/node_templates.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/space_node/node_templates.cc b/source/blender/editors/space_node/node_templates.cc index 33d751a8e64..87d48ea7cb2 100644 --- a/source/blender/editors/space_node/node_templates.cc +++ b/source/blender/editors/space_node/node_templates.cc @@ -255,7 +255,8 @@ static void node_socket_add_replace(const bContext *C, continue; } - if (STREQ(sock_prev->name, sock_from->name) && sock_prev->type == sock_from->type) { + if (STREQ(sock_prev->identifier, sock_from->identifier) && + sock_prev->type == sock_from->type) { bNodeLink *link = sock_prev->link; if (link && link->fromnode) {