[Bf-blender-cvs] [61fe0d62644] blender-v3.0-release: Fix T93438: Auto linking do not work for custom sockets

Omar Emara noreply at git.blender.org
Tue Jan 11 09:00:07 CET 2022


Commit: 61fe0d626441fbe07020e1478fba95983e7c94e5
Author: Omar Emara
Date:   Mon Nov 29 12:34:11 2021 +0200
Branches: blender-v3.0-release
https://developer.blender.org/rB61fe0d626441fbe07020e1478fba95983e7c94e5

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 55b547d3195..a2341a44b57 100644
--- a/source/blender/editors/space_node/node_relationships.cc
+++ b/source/blender/editors/space_node/node_relationships.cc
@@ -2158,18 +2158,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:
@@ -2178,7 +2179,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