[Bf-blender-cvs] [a376c4c3c35] master: Nodes: Change Mix node link drag weighting

Charlie Jolly noreply at git.blender.org
Wed Oct 12 00:00:47 CEST 2022


Commit: a376c4c3c357d26933d819664a8b2752a4863793
Author: Charlie Jolly
Date:   Tue Oct 11 22:43:03 2022 +0100
Branches: master
https://developer.blender.org/rBa376c4c3c357d26933d819664a8b2752a4863793

Nodes: Change Mix node link drag weighting

This lowers the search weight for color-specific
mix functions on non-color sockets.

Reported in blender.chat by simonthommes

Differential Revision: https://developer.blender.org/D16228

===================================================================

M	source/blender/nodes/shader/nodes/node_shader_mix.cc

===================================================================

diff --git a/source/blender/nodes/shader/nodes/node_shader_mix.cc b/source/blender/nodes/shader/nodes/node_shader_mix.cc
index eba283e8be8..878648105d1 100644
--- a/source/blender/nodes/shader/nodes/node_shader_mix.cc
+++ b/source/blender/nodes/shader/nodes/node_shader_mix.cc
@@ -145,12 +145,14 @@ static void node_mix_gather_link_searches(GatherLinkSearchOpParams &params)
     const eNodeSocketDatatype type = ELEM(sock_type, SOCK_BOOLEAN, SOCK_INT) ? SOCK_FLOAT :
                                                                                sock_type;
 
+    const int weight = ELEM(params.other_socket().type, SOCK_RGBA) ? 0 : -1;
     const std::string socket_name = params.in_out() == SOCK_IN ? "A" : "Result";
     for (const EnumPropertyItem *item = rna_enum_ramp_blend_items; item->identifier != nullptr;
          item++) {
       if (item->name != nullptr && item->identifier[0] != '\0') {
         params.add_item(CTX_IFACE_(BLT_I18NCONTEXT_ID_NODETREE, item->name),
-                        SocketSearchOp{socket_name, item->value});
+                        SocketSearchOp{socket_name, item->value},
+                        weight);
       }
     }



More information about the Bf-blender-cvs mailing list