From a71d2b26017090e1cf329631d831d11f5b84de0a Mon Sep 17 00:00:00 2001 From: Erik Abrahamsson Date: Sun, 29 Aug 2021 23:27:35 -0500 Subject: Geometry Nodes: Curve Fill Node This node takes a curve geometry input and creates a filled mesh at Z=0 using a constrained Delaunay triangulation algorithm. Because of the choice of algorithm, the results should be higher quality than the filling for 2D curve objects. This commit adds an initial fairly simple version of the node, but more features may be added in the future, like transferring attributes when necessary, or an index attribute input to break up the calculations into smaller chunks to improve performance. Differential Revision: https://developer.blender.org/D11846 --- source/blender/makesrna/intern/rna_nodetree.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'source/blender/makesrna/intern/rna_nodetree.c') diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 8d672e9b570..9e24a36915e 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -10261,6 +10261,24 @@ static void def_geo_raycast(StructRNA *srna) RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update"); } +static void def_geo_curve_fill(StructRNA *srna) +{ + static const EnumPropertyItem mode_items[] = { + {GEO_NODE_CURVE_FILL_MODE_TRIANGULATED, "TRIANGLES", 0, "Triangles", ""}, + {GEO_NODE_CURVE_FILL_MODE_NGONS, "NGONS", 0, "N-gons", ""}, + {0, NULL, 0, NULL, NULL}, + }; + + PropertyRNA *prop; + RNA_def_struct_sdna_from(srna, "NodeGeometryCurveFill", "storage"); + + prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "mode"); + RNA_def_property_enum_items(prop, mode_items); + RNA_def_property_ui_text(prop, "Mode", ""); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); +} + /* -------------------------------------------------------------------------- */ static void rna_def_shader_node(BlenderRNA *brna) -- cgit v1.2.3