diff options
author | Johnny Matthews <guitargeek> | 2021-06-30 08:03:55 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-06-30 08:03:55 +0300 |
commit | 8884d2d61b3d60d44d4f8aecaba1d0fd121b0bf3 (patch) | |
tree | 261d52300cd907ec19db9a43e53909c682123e75 /source/blender/makesrna/intern/rna_nodetree.c | |
parent | c36d2a9a7a2a01fdaeea98270ef1eb2314dfada3 (diff) |
Geometry Nodes: Curve Primitive Bezier Segment
Creates a Curve with 1 Bezier Spline from four positions (start,
start handle, end handle, end) and a resolution. The handles are
aligned and mirrored automatically. An "Offset" mode is also included
to allow specifying the handles relative to the control points.
The default settings recreate the existing default Bezier Curve in the
3D viewport add menu.
Differential Revision: https://developer.blender.org/D11648
Diffstat (limited to 'source/blender/makesrna/intern/rna_nodetree.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_nodetree.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 13abadf809b..b3f46509955 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -8967,6 +8967,33 @@ static void def_geo_boolean(StructRNA *srna) RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update"); } +static void def_geo_curve_primitive_bezier_segment(StructRNA *srna) +{ + static const EnumPropertyItem mode_items[] = { + + {GEO_NODE_CURVE_PRIMITIVE_BEZIER_SEGMENT_POSITION, + "POSITION", + ICON_NONE, + "Position", + "The start and end handles are fixed positions"}, + {GEO_NODE_CURVE_PRIMITIVE_BEZIER_SEGMENT_OFFSET, + "OFFSET", + ICON_NONE, + "Offset", + "The start and end handles are offsets from the spline's control points"}, + {0, NULL, 0, NULL, NULL}, + }; + + PropertyRNA *prop; + + RNA_def_struct_sdna_from(srna, "NodeGeometryCurvePrimitiveBezierSegment", "storage"); + + prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, mode_items); + RNA_def_property_ui_text(prop, "Mode", "Method used to determine control handles"); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update"); +} + static void def_geo_triangulate(StructRNA *srna) { PropertyRNA *prop; |