Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/geometry/nodes/node_geo_points_to_vertices.cc
| Show All 15 Lines | |||||
| #include "BLI_task.hh" | #include "BLI_task.hh" | ||||
| #include "BKE_attribute_math.hh" | #include "BKE_attribute_math.hh" | ||||
| #include "BKE_mesh.h" | #include "BKE_mesh.h" | ||||
| #include "node_geometry_util.hh" | #include "node_geometry_util.hh" | ||||
| using blender::Array; | namespace blender::nodes::node_geo_points_to_vertices_cc { | ||||
| namespace blender::nodes { | using blender::Array; | ||||
| 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>(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).supports_field().hide_value(); | b.add_input<decl::Bool>(N_("Selection")).default_value(true).supports_field().hide_value(); | ||||
| b.add_output<decl::Geometry>(N_("Mesh")); | b.add_output<decl::Geometry>(N_("Mesh")); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 64 Lines • ▼ Show 20 Lines | static void geo_node_points_to_vertices_exec(GeoNodeExecParams params) | ||||
| geometry_set.modify_geometry_sets([&](GeometrySet &geometry_set) { | geometry_set.modify_geometry_sets([&](GeometrySet &geometry_set) { | ||||
| geometry_set_points_to_vertices(geometry_set, selection_field); | geometry_set_points_to_vertices(geometry_set, selection_field); | ||||
| }); | }); | ||||
| params.set_output("Mesh", std::move(geometry_set)); | params.set_output("Mesh", std::move(geometry_set)); | ||||
| } | } | ||||
| } // namespace blender::nodes | } // namespace blender::nodes::node_geo_points_to_vertices_cc | ||||
| void register_node_type_geo_points_to_vertices() | void register_node_type_geo_points_to_vertices() | ||||
| { | { | ||||
| namespace file_ns = blender::nodes::node_geo_points_to_vertices_cc; | |||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| geo_node_type_base( | geo_node_type_base( | ||||
| &ntype, GEO_NODE_POINTS_TO_VERTICES, "Points to Vertices", NODE_CLASS_GEOMETRY, 0); | &ntype, GEO_NODE_POINTS_TO_VERTICES, "Points to Vertices", NODE_CLASS_GEOMETRY, 0); | ||||
| ntype.declare = blender::nodes::geo_node_points_to_vertices_declare; | ntype.declare = file_ns::geo_node_points_to_vertices_declare; | ||||
| ntype.geometry_node_execute = blender::nodes::geo_node_points_to_vertices_exec; | ntype.geometry_node_execute = file_ns::geo_node_points_to_vertices_exec; | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||