Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/geometry/nodes/node_geo_instances_to_points.cc
| Show All 17 Lines | |||||
| #include "DNA_pointcloud_types.h" | #include "DNA_pointcloud_types.h" | ||||
| #include "node_geometry_util.hh" | #include "node_geometry_util.hh" | ||||
| namespace blender::nodes { | namespace blender::nodes { | ||||
| static void geo_node_instances_to_points_declare(NodeDeclarationBuilder &b) | static void geo_node_instances_to_points_declare(NodeDeclarationBuilder &b) | ||||
| { | { | ||||
| b.add_input<decl::Geometry>("Instances").only_instances(); | b.add_input<decl::Geometry>(N_("Instances")).only_instances(); | ||||
| b.add_input<decl::Bool>("Selection").default_value(true).hide_value().supports_field(); | b.add_input<decl::Bool>(N_("Selection")).default_value(true).hide_value().supports_field(); | ||||
| b.add_input<decl::Vector>("Position").implicit_field(); | b.add_input<decl::Vector>(N_("Position")).implicit_field(); | ||||
| b.add_input<decl::Float>("Radius") | b.add_input<decl::Float>(N_("Radius")) | ||||
| .default_value(0.05f) | .default_value(0.05f) | ||||
| .min(0.0f) | .min(0.0f) | ||||
| .subtype(PROP_DISTANCE) | .subtype(PROP_DISTANCE) | ||||
| .supports_field(); | .supports_field(); | ||||
| b.add_output<decl::Geometry>("Points"); | b.add_output<decl::Geometry>(N_("Points")); | ||||
| } | } | ||||
| template<typename T> | template<typename T> | ||||
| static void copy_attribute_to_points(const VArray<T> &src, | static void copy_attribute_to_points(const VArray<T> &src, | ||||
| const IndexMask mask, | const IndexMask mask, | ||||
| MutableSpan<T> dst) | MutableSpan<T> dst) | ||||
| { | { | ||||
| for (const int i : mask.index_range()) { | for (const int i : mask.index_range()) { | ||||
| ▲ Show 20 Lines • Show All 77 Lines • Show Last 20 Lines | |||||