diff options
Diffstat (limited to 'source/blender/nodes/shader/nodes/node_shader_math.cc')
-rw-r--r-- | source/blender/nodes/shader/nodes/node_shader_math.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/nodes/shader/nodes/node_shader_math.cc b/source/blender/nodes/shader/nodes/node_shader_math.cc index 7337a1172bf..1b450a6414b 100644 --- a/source/blender/nodes/shader/nodes/node_shader_math.cc +++ b/source/blender/nodes/shader/nodes/node_shader_math.cc @@ -70,11 +70,15 @@ static void sh_node_math_gather_link_searches(GatherLinkSearchOpParams ¶ms) /* Expose first Value socket. */ if (params.node_tree().typeinfo->validate_link( static_cast<eNodeSocketDatatype>(params.other_socket().type), SOCK_FLOAT)) { + + const int weight = ELEM(params.other_socket().type, SOCK_FLOAT, SOCK_BOOLEAN, SOCK_INT) ? 0 : + -1; + for (const EnumPropertyItem *item = rna_enum_node_math_items; item->identifier != nullptr; item++) { if (item->name != nullptr && item->identifier != "") { - params.add_item(IFACE_(item->name), - SocketSearchOp{"Value", (NodeMathOperation)item->value}); + params.add_item( + IFACE_(item->name), SocketSearchOp{"Value", (NodeMathOperation)item->value}, weight); } } } |