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:
authorCharlie Jolly <charlie>2022-01-20 21:06:25 +0300
committerCharlie Jolly <mistajolly@gmail.com>2022-01-20 22:04:09 +0300
commitcc1a48e39514a38eceb3ab353e6916ad4d7621d4 (patch)
tree5f1282131169fdc5b816700e1cce29f21f51c227 /source/blender/makesrna/intern/rna_nodetree.c
parent6baccc36a02ec602b954bb4d2a1646725b40e0bf (diff)
Geometry Nodes: Curve Primitive Arc
This adds a new curve primitive to generate arcs. Radius mode (default): Generates a fixed radius arc on XY plane with controls for Angle, Sweep and Invert. Points mode: Generates a three point curve arc from Start to End via Middle with an Angle Offset and option to invert the arc. There are also outputs for arc center, radius and normal direction relative to the Z-axis. This patch is based on previous patches D11713 and D13100 from @guitargeek. Thank you. Reviewed By: HooglyBoogly Differential Revision: https://developer.blender.org/D13640
Diffstat (limited to 'source/blender/makesrna/intern/rna_nodetree.c')
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c27
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 775c7a68f65..adb6b1e4e34 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -10139,6 +10139,33 @@ static void def_geo_curve_primitive_circle(StructRNA *srna)
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update");
}
+static void def_geo_curve_primitive_arc(StructRNA *srna)
+{
+ static const EnumPropertyItem mode_items[] = {
+
+ {GEO_NODE_CURVE_PRIMITIVE_ARC_TYPE_POINTS,
+ "POINTS",
+ ICON_NONE,
+ "Points",
+ "Define arc by 3 points on circle. Arc is calculated between start and end points"},
+ {GEO_NODE_CURVE_PRIMITIVE_ARC_TYPE_RADIUS,
+ "RADIUS",
+ ICON_NONE,
+ "Radius",
+ "Define radius with a float"},
+ {0, NULL, 0, NULL, NULL},
+ };
+
+ PropertyRNA *prop;
+
+ RNA_def_struct_sdna_from(srna, "NodeGeometryCurvePrimitiveArc", "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 radius and placement");
+ RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update");
+}
+
static void def_geo_curve_primitive_line(StructRNA *srna)
{
static const EnumPropertyItem mode_items[] = {