Geometry Nodes: Rename Blur Attribute to a Blur Field #111542
@ -20,7 +20,6 @@ class NODE_MT_geometry_node_GEO_ATTRIBUTE(Menu):
|
||||
node_add_menu.add_node_type(layout, "GeometryNodeAttributeStatistic")
|
||||
node_add_menu.add_node_type(layout, "GeometryNodeAttributeDomainSize")
|
||||
layout.separator()
|
||||
node_add_menu.add_node_type(layout, "GeometryNodeBlurAttribute")
|
||||
node_add_menu.add_node_type(layout, "GeometryNodeCaptureAttribute")
|
||||
node_add_menu.add_node_type(layout, "GeometryNodeRemoveAttribute")
|
||||
node_add_menu.add_node_type(layout, "GeometryNodeStoreNamedAttribute")
|
||||
@ -553,6 +552,7 @@ class NODE_MT_category_GEO_UTILITIES_FIELD(Menu):
|
||||
layout = self.layout
|
||||
node_add_menu.add_node_type(layout, "GeometryNodeAccumulateField")
|
||||
node_add_menu.add_node_type(layout, "GeometryNodeFieldAtIndex")
|
||||
node_add_menu.add_node_type(layout, "GeometryNodeBlurAttribute")
|
||||
node_add_menu.add_node_type(layout, "GeometryNodeFieldOnDomain")
|
||||
node_add_menu.draw_assets_for_catalog(layout, self.bl_label)
|
||||
|
||||
|
@ -1297,7 +1297,7 @@ void BKE_nodetree_remove_layer_n(struct bNodeTree *ntree, struct Scene *scene, i
|
||||
#define GEO_NODE_SAMPLE_UV_SURFACE 1187
|
||||
#define GEO_NODE_SET_CURVE_NORMAL 1188
|
||||
#define GEO_NODE_IMAGE_INFO 1189
|
||||
#define GEO_NODE_BLUR_ATTRIBUTE 1190
|
||||
#define GEO_NODE_BLUR_FIELD 1190
|
||||
#define GEO_NODE_IMAGE 1191
|
||||
#define GEO_NODE_INTERPOLATE_CURVES 1192
|
||||
#define GEO_NODE_EDGES_TO_FACE_GROUPS 1193
|
||||
|
@ -293,7 +293,7 @@ DefNode(FunctionNode, FN_NODE_VALUE_TO_STRING, 0, "VALUE_TO_STRING", ValueToStri
|
||||
DefNode(GeometryNode, GEO_NODE_ACCUMULATE_FIELD, 0, "ACCUMULATE_FIELD", AccumulateField, "Accumulate Field", "Add the values of an evaluated field together and output the running total for each element")
|
||||
DefNode(GeometryNode, GEO_NODE_ATTRIBUTE_DOMAIN_SIZE, 0, "ATTRIBUTE_DOMAIN_SIZE", AttributeDomainSize, "Domain Size", "Retrieve the number of elements in a geometry for each attribute domain")
|
||||
DefNode(GeometryNode, GEO_NODE_ATTRIBUTE_STATISTIC, 0, "ATTRIBUTE_STATISTIC",AttributeStatistic, "Attribute Statistic", "Calculate statistics about a data set from a field evaluated on a geometry")
|
||||
DefNode(GeometryNode, GEO_NODE_BLUR_ATTRIBUTE, 0, "BLUR_ATTRIBUTE", BlurAttribute, "Blur Attribute", "Mix attribute values of neighboring elements")
|
||||
DefNode(GeometryNode, GEO_NODE_BLUR_FIELD, 0, "BLUR_FIELD", BlurAttribute, "Blur Field", "Mix field values of neighboring elements")
|
||||
DefNode(GeometryNode, GEO_NODE_BOUNDING_BOX, 0, "BOUNDING_BOX", BoundBox, "Bounding Box", "Calculate the limits of a geometry's positions and generate a box mesh with those dimensions")
|
||||
DefNode(GeometryNode, GEO_NODE_CAPTURE_ATTRIBUTE, 0, "CAPTURE_ATTRIBUTE", CaptureAttribute, "Capture Attribute", "Store the result of a field on a geometry and output the data as a node socket. Allows remembering or interpolating data as the geometry changes, such as positions before deformation")
|
||||
DefNode(GeometryNode, GEO_NODE_COLLECTION_INFO, 0, "COLLECTION_INFO", CollectionInfo, "Collection Info", "Retrieve geometry instances from a collection")
|
||||
|
@ -31,7 +31,7 @@ set(SRC
|
||||
nodes/node_geo_attribute_capture.cc
|
||||
nodes/node_geo_attribute_domain_size.cc
|
||||
nodes/node_geo_attribute_statistic.cc
|
||||
nodes/node_geo_blur_attribute.cc
|
||||
nodes/node_geo_blur_field.cc
|
||||
nodes/node_geo_boolean.cc
|
||||
nodes/node_geo_bounding_box.cc
|
||||
nodes/node_geo_collection_info.cc
|
||||
|
@ -31,7 +31,7 @@
|
||||
|
||||
#include "node_geometry_util.hh"
|
||||
|
||||
namespace blender::nodes::node_geo_blur_attribute_cc {
|
||||
namespace blender::nodes::node_geo_blur_field_cc {
|
||||
|
||||
static void node_declare(NodeDeclarationBuilder &b)
|
||||
{
|
||||
@ -390,14 +390,14 @@ static GSpan blur_on_curves(const bke::CurvesGeometry &curves,
|
||||
return result_buffer;
|
||||
}
|
||||
|
||||
class BlurAttributeFieldInput final : public bke::GeometryFieldInput {
|
||||
class BlurFieldInput final : public bke::GeometryFieldInput {
|
||||
private:
|
||||
const Field<float> weight_field_;
|
||||
const GField value_field_;
|
||||
const int iterations_;
|
||||
|
||||
public:
|
||||
BlurAttributeFieldInput(Field<float> weight_field, GField value_field, const int iterations)
|
||||
BlurFieldInput(Field<float> weight_field, GField value_field, const int iterations)
|
||||
: bke::GeometryFieldInput(value_field.cpp_type(), "Blur Attribute"),
|
||||
weight_field_(std::move(weight_field)),
|
||||
value_field_(std::move(value_field)),
|
||||
@ -472,8 +472,8 @@ class BlurAttributeFieldInput final : public bke::GeometryFieldInput {
|
||||
|
||||
bool is_equal_to(const fn::FieldNode &other) const override
|
||||
{
|
||||
if (const BlurAttributeFieldInput *other_blur = dynamic_cast<const BlurAttributeFieldInput *>(
|
||||
&other))
|
||||
if (const BlurFieldInput *other_blur =
|
||||
dynamic_cast<const BlurFieldInput *>(&other))
|
||||
{
|
||||
return weight_field_ == other_blur->weight_field_ &&
|
||||
value_field_ == other_blur->value_field_ && iterations_ == other_blur->iterations_;
|
||||
@ -515,7 +515,7 @@ static void node_geo_exec(GeoNodeExecParams params)
|
||||
using T = decltype(dummy);
|
||||
static const std::string identifier = "Value_" + identifier_suffix(data_type);
|
||||
Field<T> value_field = params.extract_input<Field<T>>(identifier);
|
||||
Field<T> output_field{std::make_shared<BlurAttributeFieldInput>(
|
||||
Field<T> output_field{std::make_shared<BlurFieldInput>(
|
||||
std::move(weight_field), std::move(value_field), iterations)};
|
||||
params.set_output(identifier, std::move(output_field));
|
||||
});
|
||||
@ -542,7 +542,8 @@ static void node_rna(StructRNA *srna)
|
||||
static void node_register()
|
||||
{
|
||||
static bNodeType ntype;
|
||||
geo_node_type_base(&ntype, GEO_NODE_BLUR_ATTRIBUTE, "Blur Attribute", NODE_CLASS_ATTRIBUTE);
|
||||
geo_node_type_base(
|
||||
&ntype, GEO_NODE_BLUR_FIELD, "Blur Field", NODE_CLASS_CONVERTER);
|
||||
ntype.declare = node_declare;
|
||||
ntype.initfunc = node_init;
|
||||
ntype.updatefunc = node_update;
|
||||
@ -555,4 +556,4 @@ static void node_register()
|
||||
}
|
||||
NOD_REGISTER_NODE(node_register)
|
||||
|
||||
} // namespace blender::nodes::node_geo_blur_attribute_cc
|
||||
} // namespace blender::nodes::node_geo_blur_field_cc
|
Loading…
Reference in New Issue
Block a user