48 params.set_output(
"Geometry", geometry_set);
52 #ifndef WITH_OPENSUBDIV
54 TIP_(
"Disabled, Blender was compiled without OpenSubdiv"));
56 const int subdiv_level =
clamp_i(
params.extract_input<
int>(
"Level"), 0, 30);
59 if (subdiv_level == 0) {
60 params.set_output(
"Geometry", std::move(geometry_set));
64 const bool use_crease =
params.extract_input<
bool>(
"Use Creases");
65 const bool boundary_smooth =
params.extract_input<
bool>(
"Boundary Smooth");
66 const bool smooth_uvs =
params.extract_input<
bool>(
"Smooth UVs");
71 mesh_settings.
resolution = (1 << subdiv_level) + 1;
79 subdiv_settings.
level = subdiv_level;
90 if (subdiv ==
nullptr) {
91 params.set_output(
"Geometry", std::move(geometry_set));
106 params.set_output(
"Geometry", std::move(geometry_set));
void BKE_mesh_calc_normals(struct Mesh *me)
void node_type_socket_templates(struct bNodeType *ntype, struct bNodeSocketTemplate *inputs, struct bNodeSocketTemplate *outputs)
#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)
Group RGB to Bright Vector Camera Vector Combine Material Light Line Style Layer Add Ambient Diffuse Glossy Refraction Transparent Toon Principled Hair Volume Principled Light Particle Volume Image Sky Noise Wave Voronoi Brick Texture Vector Combine Vertex Separate Vector White RGB Map Separate Set Z Dilate Combine Combine Color Channel Split ID Combine Luminance Directional Alpha Distance Hue Movie Ellipse Bokeh View Corner Anti Mix RGB Hue Separate TEX_NODE_PROC TEX_NODE_PROC TEX_NODE_PROC TEX_NODE_PROC TEX_NODE_PROC Boolean Random Edge GEO_NODE_SUBDIVISION_SURFACE
void replace_mesh_but_keep_vertex_group_names(Mesh *mesh, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
GeometrySet geometry_set_realize_instances(const GeometrySet &geometry_set)
static void geo_node_subdivision_surface_exec(GeoNodeExecParams params)
static bNodeSocketTemplate geo_node_subdivision_surface_out[]
static bNodeSocketTemplate geo_node_subdivision_surface_in[]
void register_node_type_geo_subdivision_surface()
void geo_node_type_base(bNodeType *ntype, int type, const char *name, short nclass, short flag)
GeometryComponent & get_component_for_write(GeometryComponentType component_type)
const Mesh * get_mesh_for_read() const
eSubdivFVarLinearInterpolation fvar_linear_interpolation
eSubdivVtxBoundaryInterpolation vtx_boundary_interpolation
Compact definition of a node socket.
NodeGeometryExecFunction geometry_node_execute