Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/geometry/nodes/node_geo_points_to_vertices.cc
| Show All 21 Lines | |||||
| #include "node_geometry_util.hh" | #include "node_geometry_util.hh" | ||||
| using blender::Array; | using blender::Array; | ||||
| namespace blender::nodes { | namespace blender::nodes { | ||||
| static void geo_node_points_to_vertices_declare(NodeDeclarationBuilder &b) | static void geo_node_points_to_vertices_declare(NodeDeclarationBuilder &b) | ||||
| { | { | ||||
| b.add_input<decl::Geometry>("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>("Selection").default_value(true).supports_field().hide_value(); | b.add_input<decl::Bool>(N_("Selection")).default_value(true).supports_field().hide_value(); | ||||
| b.add_output<decl::Geometry>("Mesh"); | b.add_output<decl::Geometry>(N_("Mesh")); | ||||
| } | } | ||||
| template<typename T> | template<typename T> | ||||
| static void copy_attribute_to_vertices(const Span<T> src, const IndexMask mask, MutableSpan<T> dst) | static void copy_attribute_to_vertices(const Span<T> src, const IndexMask mask, MutableSpan<T> dst) | ||||
| { | { | ||||
| for (const int i : mask.index_range()) { | for (const int i : mask.index_range()) { | ||||
| dst[i] = src[mask[i]]; | dst[i] = src[mask[i]]; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 78 Lines • Show Last 20 Lines | |||||