From 05f3f11d553e97f27fc88b1dada9387acdb768a6 Mon Sep 17 00:00:00 2001 From: Victor-Louis De Gusseme Date: Mon, 20 Sep 2021 18:39:39 -0500 Subject: Geometry Nodes: Attribute Statistic Node This nodes evaluates a field on a geometry and outputs various statistics about the entire data set, like min, max, or even the standard deviation. It works for float and vector types currently, though more types could be supported in the future. - All statistics are calculated element-wise for vectors. - "Product" was not added since the result could very easily overflow. - The "Size" output was not added since it isn't specific to an attribute and would fit better in another node. The implementation shares work as much as possible when multiple statistics are needed. This node has been in development since the beginning of this year, with additions from Johnny Matthews and Hans Goudey. Differential Revision: https://developer.blender.org/D10202 --- source/blender/blenkernel/BKE_node.h | 1 + source/blender/blenkernel/intern/node.cc | 1 + 2 files changed, 2 insertions(+) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h index 8e82ab6d6be..45ce843ef78 100644 --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@ -1494,6 +1494,7 @@ int ntreeTexExecTree(struct bNodeTree *ntree, #define GEO_NODE_MATERIAL_SELECTION 1081 #define GEO_NODE_MATERIAL_ASSIGN 1082 #define GEO_NODE_REALIZE_INSTANCES 1083 +#define GEO_NODE_ATTRIBUTE_STATISTIC 1084 /** \} */ diff --git a/source/blender/blenkernel/intern/node.cc b/source/blender/blenkernel/intern/node.cc index 3a76cbf6f84..7d679cfd076 100644 --- a/source/blender/blenkernel/intern/node.cc +++ b/source/blender/blenkernel/intern/node.cc @@ -5175,6 +5175,7 @@ static void registerGeometryNodes() register_node_type_geo_attribute_randomize(); register_node_type_geo_attribute_remove(); register_node_type_geo_attribute_separate_xyz(); + register_node_type_geo_attribute_statistic(); register_node_type_geo_attribute_transfer(); register_node_type_geo_attribute_vector_math(); register_node_type_geo_attribute_vector_rotate(); -- cgit v1.2.3