From 955748ab1e35d92d9c60ce81f43681e715768eb2 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Tue, 28 Dec 2021 12:44:36 -0600 Subject: Fix: Duplicate link search entries for attribute statistic node Using the output declarations is incorrect because there is a declaration for each type. Instead loop over the names directly, since it will make it easier to add an integer mode that only supports some of the outputs. --- source/blender/nodes/geometry/nodes/node_geo_attribute_statistic.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/blender/nodes/geometry/nodes/node_geo_attribute_statistic.cc b/source/blender/nodes/geometry/nodes/node_geo_attribute_statistic.cc index 4d6fb328ad9..e97badeb83a 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_attribute_statistic.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_attribute_statistic.cc @@ -148,8 +148,8 @@ static void node_gather_link_searches(GatherLinkSearchOpParams ¶ms) }); } else { - for (const SocketDeclarationPtr &socket_decl : declaration.outputs()) { - StringRefNull name = socket_decl->name(); + for (const StringRefNull name : + {"Mean", "Median", "Sum", "Min", "Max", "Range", "Standard Deviation", "Variance"}) { params.add_item(IFACE_(name.c_str()), [node_type, name, type](LinkSearchOpParams ¶ms) { bNode &node = params.add_node(node_type); node.custom1 = *type; -- cgit v1.2.3