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:
parent
d45ad0acd3
commit
9179362e7b
|
@ -131,9 +131,6 @@ static void node_update(bNodeTree *ntree, bNode *node)
|
|||
|
||||
static void node_gather_link_searches(GatherLinkSearchOpParams ¶ms)
|
||||
{
|
||||
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 ¶ms)
|
|||
node.custom2 = *type;
|
||||
params.update_and_connect_available_socket(node, "Value");
|
||||
});
|
||||
params.add_item(
|
||||
IFACE_("Index"),
|
||||
[node_type, type](LinkSearchOpParams ¶ms) {
|
||||
bNode &node = params.add_node(node_type);
|
||||
node.custom2 = *type;
|
||||
params.update_and_connect_available_socket(node, "Index");
|
||||
},
|
||||
-1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue