Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/geometry/nodes/node_geo_subdivision_surface.cc
| Show All 21 Lines | |||||
| #include "BKE_subdiv.h" | #include "BKE_subdiv.h" | ||||
| #include "BKE_subdiv_mesh.h" | #include "BKE_subdiv_mesh.h" | ||||
| #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" | ||||
| namespace blender::nodes { | namespace blender::nodes::node_geo_subdivision_surface_cc { | ||||
| static void geo_node_subdivision_surface_declare(NodeDeclarationBuilder &b) | static void geo_node_subdivision_surface_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::Int>(N_("Level")).default_value(1).min(0).max(6); | b.add_input<decl::Int>(N_("Level")).default_value(1).min(0).max(6); | ||||
| b.add_input<decl::Float>(N_("Crease")) | b.add_input<decl::Float>(N_("Crease")) | ||||
| .default_value(0.0f) | .default_value(0.0f) | ||||
| .min(0.0f) | .min(0.0f) | ||||
| ▲ Show 20 Lines • Show All 101 Lines • ▼ Show 20 Lines | geometry_set.modify_geometry_sets([&](GeometrySet &geometry_set) { | ||||
| mesh_component.replace(mesh_out); | mesh_component.replace(mesh_out); | ||||
| BKE_subdiv_free(subdiv); | BKE_subdiv_free(subdiv); | ||||
| }); | }); | ||||
| #endif | #endif | ||||
| params.set_output("Mesh", std::move(geometry_set)); | params.set_output("Mesh", std::move(geometry_set)); | ||||
| } | } | ||||
| } // namespace blender::nodes | } // namespace blender::nodes::node_geo_subdivision_surface_cc | ||||
| void register_node_type_geo_subdivision_surface() | void register_node_type_geo_subdivision_surface() | ||||
| { | { | ||||
| namespace file_ns = blender::nodes::node_geo_subdivision_surface_cc; | |||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| geo_node_type_base( | geo_node_type_base( | ||||
| &ntype, GEO_NODE_SUBDIVISION_SURFACE, "Subdivision Surface", NODE_CLASS_GEOMETRY, 0); | &ntype, GEO_NODE_SUBDIVISION_SURFACE, "Subdivision Surface", NODE_CLASS_GEOMETRY, 0); | ||||
| ntype.declare = blender::nodes::geo_node_subdivision_surface_declare; | ntype.declare = file_ns::geo_node_subdivision_surface_declare; | ||||
| ntype.geometry_node_execute = blender::nodes::geo_node_subdivision_surface_exec; | ntype.geometry_node_execute = file_ns::geo_node_subdivision_surface_exec; | ||||
| ntype.draw_buttons = blender::nodes::geo_node_subdivision_surface_layout; | ntype.draw_buttons = file_ns::geo_node_subdivision_surface_layout; | ||||
| node_type_init(&ntype, blender::nodes::geo_node_subdivision_surface_init); | node_type_init(&ntype, file_ns::geo_node_subdivision_surface_init); | ||||
| node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); | node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); | ||||
| node_type_storage(&ntype, | node_type_storage(&ntype, | ||||
| "NodeGeometrySubdivisionSurface", | "NodeGeometrySubdivisionSurface", | ||||
| node_free_standard_storage, | node_free_standard_storage, | ||||
| node_copy_standard_storage); | node_copy_standard_storage); | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||