From 8884d2d61b3d60d44d4f8aecaba1d0fd121b0bf3 Mon Sep 17 00:00:00 2001 From: Johnny Matthews Date: Wed, 30 Jun 2021 00:03:55 -0500 Subject: 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 --- source/blender/makesrna/intern/rna_nodetree.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 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 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; -- cgit v1.2.3