17 b.add_input<
decl::Int>(
N_(
"Level")).default_value(1).min(0).max(6);
39 subdiv_settings.
level = 1;
48 if (subdiv ==
nullptr) {
55 mesh_component.
replace(mesh_out);
64 #ifndef WITH_OPENSUBDIV
65 params.error_message_add(NodeWarningType::Error,
66 TIP_(
"Disabled, Blender was compiled without OpenSubdiv"));
67 params.set_default_remaining_outputs();
72 const int subdiv_level =
clamp_i(
params.extract_input<
int>(
"Level"), 0, 11);
74 if (subdiv_level == 0) {
75 params.set_output(
"Mesh", std::move(geometry_set));
82 params.set_output(
"Mesh", std::move(geometry_set));
@ GEO_COMPONENT_TYPE_MESH
#define GEO_NODE_SUBDIVIDE_MESH
#define NODE_CLASS_GEOMETRY
void nodeRegisterType(struct bNodeType *ntype)
eSubdivVtxBoundaryInterpolation BKE_subdiv_vtx_boundary_interpolation_from_subsurf(int boundary_smooth)
void BKE_subdiv_free(Subdiv *subdiv)
Subdiv * BKE_subdiv_update_from_mesh(Subdiv *subdiv, const SubdivSettings *settings, const struct Mesh *mesh)
eSubdivFVarLinearInterpolation BKE_subdiv_fvar_interpolation_from_uv_smooth(int uv_smooth)
struct Mesh * BKE_subdiv_to_mesh(struct Subdiv *subdiv, const SubdivToMeshSettings *settings, const struct Mesh *coarse_mesh)
MINLINE int clamp_i(int value, int min, int max)
void replace(Mesh *mesh, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
static void node_declare(NodeDeclarationBuilder &b)
static void geometry_set_mesh_subdivide(GeometrySet &geometry_set, const int level)
static void node_geo_exec(GeoNodeExecParams params)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
void register_node_type_geo_mesh_subdivide()
void geo_node_type_base(bNodeType *ntype, int type, const char *name, short nclass)
GeometryComponent & get_component_for_write(GeometryComponentType component_type)
const Mesh * get_mesh_for_read() const
void modify_geometry_sets(ForeachSubGeometryCallback callback)
eSubdivFVarLinearInterpolation fvar_linear_interpolation
eSubdivVtxBoundaryInterpolation vtx_boundary_interpolation
NodeGeometryExecFunction geometry_node_execute
NodeDeclareFunction declare