diff options
author | Erik Abrahamsson <erik85> | 2021-08-30 07:27:35 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-08-30 07:27:35 +0300 |
commit | a71d2b26017090e1cf329631d831d11f5b84de0a (patch) | |
tree | 6633ca1f086ed77ee1880080a8e37434e78aecbf /source/blender/makesrna | |
parent | 41eb33794ccd977582185159791805c84730a957 (diff) |
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
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_nodetree.c | 18 |
1 files changed, 18 insertions, 0 deletions
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) |