Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/nodes/geometry/nodes/node_geo_triangulate.cc')
-rw-r--r--source/blender/nodes/geometry/nodes/node_geo_triangulate.cc23
1 files changed, 10 insertions, 13 deletions
diff --git a/source/blender/nodes/geometry/nodes/node_geo_triangulate.cc b/source/blender/nodes/geometry/nodes/node_geo_triangulate.cc
index 03581b28f18..8886c7194db 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_triangulate.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_triangulate.cc
@@ -27,16 +27,14 @@ Mesh *triangulate_mesh(Mesh *mesh,
const int flag);
}
-static bNodeSocketTemplate geo_node_triangulate_in[] = {
- {SOCK_GEOMETRY, N_("Geometry")},
- {SOCK_INT, N_("Minimum Vertices"), 4, 0, 0, 0, 4, 10000},
- {-1, ""},
-};
+namespace blender::nodes {
-static bNodeSocketTemplate geo_node_triangulate_out[] = {
- {SOCK_GEOMETRY, N_("Geometry")},
- {-1, ""},
-};
+static void geo_node_triangulate_declare(NodeDeclarationBuilder &b)
+{
+ b.add_input<decl::Geometry>("Geometry");
+ b.add_input<decl::Int>("Minimum Vertices").default_value(4).min(4).max(10000);
+ b.add_output<decl::Geometry>("Geometry");
+}
static void geo_node_triangulate_layout(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
@@ -50,7 +48,6 @@ static void geo_triangulate_init(bNodeTree *UNUSED(ntree), bNode *node)
node->custom2 = GEO_NODE_TRIANGULATE_NGON_BEAUTY;
}
-namespace blender::nodes {
static void geo_node_triangulate_exec(GeoNodeExecParams params)
{
GeometrySet geometry_set = params.extract_input<GeometrySet>("Geometry");
@@ -79,9 +76,9 @@ void register_node_type_geo_triangulate()
static bNodeType ntype;
geo_node_type_base(&ntype, GEO_NODE_TRIANGULATE, "Triangulate", NODE_CLASS_GEOMETRY, 0);
- node_type_socket_templates(&ntype, geo_node_triangulate_in, geo_node_triangulate_out);
- node_type_init(&ntype, geo_triangulate_init);
+ ntype.declare = blender::nodes::geo_node_triangulate_declare;
+ node_type_init(&ntype, blender::nodes::geo_triangulate_init);
ntype.geometry_node_execute = blender::nodes::geo_node_triangulate_exec;
- ntype.draw_buttons = geo_node_triangulate_layout;
+ ntype.draw_buttons = blender::nodes::geo_node_triangulate_layout;
nodeRegisterType(&ntype);
}