Geometry Nodes: Prefer evaluate at index value input in search

Give the "Value" input a higher search weight than the "Index"
input, since it's more likely that users will want to connect to
that. Based on feedback from Simon Thommes.
This commit is contained in:
Hans Goudey 2023-01-17 19:43:36 -06:00
parent d45ad0acd3
commit 9179362e7b
1 changed files with 8 additions and 3 deletions

View File

@ -131,9 +131,6 @@ static void node_update(bNodeTree *ntree, bNode *node)
static void node_gather_link_searches(GatherLinkSearchOpParams &params)
{
const NodeDeclaration &declaration = *params.node_type().fixed_declaration;
search_link_ops_for_declarations(params, declaration.inputs.as_span().take_front(1));
const bNodeType &node_type = params.node_type();
const std::optional<eCustomDataType> type = node_data_type_to_custom_data_type(
(eNodeSocketDatatype)params.other_socket().type);
@ -143,6 +140,14 @@ static void node_gather_link_searches(GatherLinkSearchOpParams &params)
node.custom2 = *type;
params.update_and_connect_available_socket(node, "Value");
});
params.add_item(
IFACE_("Index"),
[node_type, type](LinkSearchOpParams &params) {
bNode &node = params.add_node(node_type);
node.custom2 = *type;
params.update_and_connect_available_socket(node, "Index");
},
-1);
}
}