[Bf-blender-cvs] [9179362e7b0] master: Geometry Nodes: Prefer evaluate at index value input in search
Hans Goudey
noreply at git.blender.org
Wed Jan 18 02:44:08 CET 2023
Commit: 9179362e7b05d334ec8490bcdd6d04c05af4a81a
Author: Hans Goudey
Date: Tue Jan 17 19:43:36 2023 -0600
Branches: master
https://developer.blender.org/rB9179362e7b05d334ec8490bcdd6d04c05af4a81a
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.
===================================================================
M source/blender/nodes/geometry/nodes/node_geo_evaluate_at_index.cc
===================================================================
diff --git a/source/blender/nodes/geometry/nodes/node_geo_evaluate_at_index.cc b/source/blender/nodes/geometry/nodes/node_geo_evaluate_at_index.cc
index 65f88f23aff..68d309c0bf4 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_evaluate_at_index.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_evaluate_at_index.cc
@@ -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);
}
}
More information about the Bf-blender-cvs
mailing list