Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/geometry/nodes/node_geo_set_point_radius.cc
| /* SPDX-License-Identifier: GPL-2.0-or-later */ | /* SPDX-License-Identifier: GPL-2.0-or-later */ | ||||
| #include "DNA_pointcloud_types.h" | #include "DNA_pointcloud_types.h" | ||||
| #include "node_geometry_util.hh" | #include "node_geometry_util.hh" | ||||
| namespace blender::nodes::node_geo_set_point_radius_cc { | namespace blender::nodes::node_geo_set_point_radius_cc { | ||||
| static void node_declare(NodeDeclarationBuilder &b) | static void node_declare(NodeDeclarationBuilder &b) | ||||
| { | { | ||||
| b.add_input<decl::Geometry>(N_("Points")).supported_type(GEO_COMPONENT_TYPE_POINT_CLOUD); | b.add_input<decl::Geometry>(N_("Points")).supported_type(GEO_COMPONENT_TYPE_POINT_CLOUD); | ||||
| b.add_input<decl::Bool>(N_("Selection")).default_value(true).hide_value().supports_field(); | b.add_input<decl::Bool>(N_("Selection")).default_value(true).hide_value().field_on_all(); | ||||
| b.add_input<decl::Float>(N_("Radius")) | b.add_input<decl::Float>(N_("Radius")) | ||||
| .default_value(0.05f) | .default_value(0.05f) | ||||
| .min(0.0f) | .min(0.0f) | ||||
| .supports_field() | .field_on_all() | ||||
| .subtype(PROP_DISTANCE); | .subtype(PROP_DISTANCE); | ||||
| b.add_output<decl::Geometry>(N_("Points")); | b.add_output<decl::Geometry>(N_("Points")).propagate_all(); | ||||
| } | } | ||||
| static void set_radius_in_component(PointCloud &pointcloud, | static void set_radius_in_component(PointCloud &pointcloud, | ||||
| const Field<bool> &selection_field, | const Field<bool> &selection_field, | ||||
| const Field<float> &radius_field) | const Field<float> &radius_field) | ||||
| { | { | ||||
| if (pointcloud.totpoint == 0) { | if (pointcloud.totpoint == 0) { | ||||
| return; | return; | ||||
| ▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines | |||||