diff options
author | Charlie Jolly <mistajolly@gmail.com> | 2022-10-12 00:43:03 +0300 |
---|---|---|
committer | Charlie Jolly <mistajolly@gmail.com> | 2022-10-12 00:59:22 +0300 |
commit | a376c4c3c357d26933d819664a8b2752a4863793 (patch) | |
tree | 6771117baa5df7a561988fe4a617c21ee1bd738f /source/blender/nodes/shader | |
parent | 7636fc06ea30616014e93686b5c4f35696e9b799 (diff) |
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
Diffstat (limited to 'source/blender/nodes/shader')
-rw-r--r-- | source/blender/nodes/shader/nodes/node_shader_mix.cc | 4 |
1 files changed, 3 insertions, 1 deletions
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 ¶ms) 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); } } |