[Bf-blender-cvs] [ab2a7aa0da8] master: Fix T93438: Auto linking do not work for custom sockets
Omar Emara
noreply at git.blender.org
Mon Nov 29 11:35:28 CET 2021
Commit: ab2a7aa0da81678b19e3362b93f89e8302da65d8
Author: Omar Emara
Date: Mon Nov 29 12:34:11 2021 +0200
Branches: master
https://developer.blender.org/rBab2a7aa0da81678b19e3362b93f89e8302da65d8
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
===================================================================
M source/blender/editors/space_node/node_relationships.cc
===================================================================
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;
}
More information about the Bf-blender-cvs
mailing list