Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/geometry/nodes/node_geo_mesh_to_points.cc
| Show All 20 Lines | |||||
| #include "UI_interface.h" | #include "UI_interface.h" | ||||
| #include "UI_resources.h" | #include "UI_resources.h" | ||||
| #include "node_geometry_util.hh" | #include "node_geometry_util.hh" | ||||
| using blender::Array; | using blender::Array; | ||||
| namespace blender::nodes { | namespace blender::nodes::node_geo_mesh_to_points_cc { | ||||
| static void geo_node_mesh_to_points_declare(NodeDeclarationBuilder &b) | static void geo_node_mesh_to_points_declare(NodeDeclarationBuilder &b) | ||||
| { | { | ||||
| b.add_input<decl::Geometry>(N_("Mesh")).supported_type(GEO_COMPONENT_TYPE_MESH); | b.add_input<decl::Geometry>(N_("Mesh")).supported_type(GEO_COMPONENT_TYPE_MESH); | ||||
| 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_input<decl::Vector>(N_("Position")).implicit_field(); | b.add_input<decl::Vector>(N_("Position")).implicit_field(); | ||||
| b.add_input<decl::Float>(N_("Radius")) | b.add_input<decl::Float>(N_("Radius")) | ||||
| .default_value(0.05f) | .default_value(0.05f) | ||||
| ▲ Show 20 Lines • Show All 129 Lines • ▼ Show 20 Lines | switch (mode) { | ||||
| geometry_set, position, positive_radius, selection, ATTR_DOMAIN_CORNER); | geometry_set, position, positive_radius, selection, ATTR_DOMAIN_CORNER); | ||||
| break; | break; | ||||
| } | } | ||||
| }); | }); | ||||
| params.set_output("Points", std::move(geometry_set)); | params.set_output("Points", std::move(geometry_set)); | ||||
| } | } | ||||
| } // namespace blender::nodes | } // namespace blender::nodes::node_geo_mesh_to_points_cc | ||||
| void register_node_type_geo_mesh_to_points() | void register_node_type_geo_mesh_to_points() | ||||
| { | { | ||||
| namespace file_ns = blender::nodes::node_geo_mesh_to_points_cc; | |||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| geo_node_type_base(&ntype, GEO_NODE_MESH_TO_POINTS, "Mesh to Points", NODE_CLASS_GEOMETRY, 0); | geo_node_type_base(&ntype, GEO_NODE_MESH_TO_POINTS, "Mesh to Points", NODE_CLASS_GEOMETRY, 0); | ||||
| ntype.declare = blender::nodes::geo_node_mesh_to_points_declare; | ntype.declare = file_ns::geo_node_mesh_to_points_declare; | ||||
| ntype.geometry_node_execute = blender::nodes::geo_node_mesh_to_points_exec; | ntype.geometry_node_execute = file_ns::geo_node_mesh_to_points_exec; | ||||
| node_type_init(&ntype, blender::nodes::geo_node_mesh_to_points_init); | node_type_init(&ntype, file_ns::geo_node_mesh_to_points_init); | ||||
| ntype.draw_buttons = blender::nodes::geo_node_mesh_to_points_layout; | ntype.draw_buttons = file_ns::geo_node_mesh_to_points_layout; | ||||
| node_type_storage( | node_type_storage( | ||||
| &ntype, "NodeGeometryMeshToPoints", node_free_standard_storage, node_copy_standard_storage); | &ntype, "NodeGeometryMeshToPoints", node_free_standard_storage, node_copy_standard_storage); | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||