diff options
author | Omar Emara <mail@OmarEmara.dev> | 2021-11-29 13:34:11 +0300 |
---|---|---|
committer | Omar Emara <mail@OmarEmara.dev> | 2021-11-29 13:34:11 +0300 |
commit | ab2a7aa0da81678b19e3362b93f89e8302da65d8 (patch) | |
tree | 2e27b53b7a6672cd30a421bde22d803ee58cd3e1 | |
parent | cebe5f5bf499407329aef0ab7bea2f770a19dbbb (diff) |
Fix T93438: Auto linking do not work for custom sockets
Currently, custom sockets are no longer supported for automatic linking
when dropping a node on a link. This is because SOCK_CUSTOM is given a
negative priority and is ignored. To fix this, SOCK_CUSTOM is now given
the lowest priority and the rest of the sockets got their priority
incremented.
Reviewed By: Jacques Lucke
Differential Revision: https://developer.blender.org/D13403
-rw-r--r-- | source/blender/editors/space_node/node_relationships.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/source/blender/editors/space_node/node_relationships.cc b/source/blender/editors/space_node/node_relationships.cc index aee749edbc4..fa84ada0af0 100644 --- a/source/blender/editors/space_node/node_relationships.cc +++ b/source/blender/editors/space_node/node_relationships.cc @@ -2116,18 +2116,19 @@ static int get_main_socket_priority(const bNodeSocket *socket) { switch ((eNodeSocketDatatype)socket->type) { case __SOCK_MESH: - case SOCK_CUSTOM: return -1; - case SOCK_BOOLEAN: + case SOCK_CUSTOM: return 0; - case SOCK_INT: + case SOCK_BOOLEAN: return 1; - case SOCK_FLOAT: + case SOCK_INT: return 2; - case SOCK_VECTOR: + case SOCK_FLOAT: return 3; - case SOCK_RGBA: + case SOCK_VECTOR: return 4; + case SOCK_RGBA: + return 5; case SOCK_STRING: case SOCK_SHADER: case SOCK_OBJECT: @@ -2136,7 +2137,7 @@ static int get_main_socket_priority(const bNodeSocket *socket) case SOCK_COLLECTION: case SOCK_TEXTURE: case SOCK_MATERIAL: - return 5; + return 6; } return -1; } |