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
This commit is contained in:
Weizhen Huang
2023-08-04 16:32:33 +02:00
committed by Weizhen Huang
parent 97769581f5
commit c36eccfae9

View File

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