diff options
author | Johnny Matthews <guitargeek> | 2021-07-12 20:10:56 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-07-12 20:11:52 +0300 |
commit | 2a41ab5e6ca48c7ae2392c567c74162e34a74c9b (patch) | |
tree | bbab22ccd7aa2fb55c3a2b2fb6ada6bb2da06638 /source/blender/makesrna/intern | |
parent | a072e87e04ee583f899db4bd174e1804c97b3c9d (diff) |
Geometry Nodes: Curve Primitive Quadrilateral
This commit adds a curve primitive node for creating squares,
rectangles, trapezoids, kites, and parallelograms. It also includes
a mode where the four points are just vector inputs.
Differential Revision: https://developer.blender.org/D11665
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r-- | source/blender/makesrna/intern/rna_nodetree.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 5c363a3e6b6..d576a5b7db6 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -9947,6 +9947,45 @@ static void def_geo_switch(StructRNA *srna) RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update"); } +static void def_geo_curve_primitive_quadrilateral(StructRNA *srna) +{ + PropertyRNA *prop; + + static EnumPropertyItem mode_items[] = { + {GEO_NODE_CURVE_PRIMITIVE_QUAD_MODE_RECTANGLE, + "RECTANGLE", + 0, + "Rectangle", + "Create a rectangle"}, + {GEO_NODE_CURVE_PRIMITIVE_QUAD_MODE_PARALLELOGRAM, + "PARALLELOGRAM", + 0, + "Parallelogram", + "Create a parallelogram"}, + {GEO_NODE_CURVE_PRIMITIVE_QUAD_MODE_TRAPEZOID, + "TRAPEZOID", + 0, + "Trapezoid", + "Create a trapezoid"}, + {GEO_NODE_CURVE_PRIMITIVE_QUAD_MODE_KITE, "KITE", 0, "Kite", "Create a Kite / Dart"}, + {GEO_NODE_CURVE_PRIMITIVE_QUAD_MODE_POINTS, + "POINTS", + 0, + "Points", + "Create a quadrilateral from four points"}, + {0, NULL, 0, NULL, NULL}, + }; + + RNA_def_struct_sdna_from(srna, "NodeGeometryCurvePrimitiveQuad", "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_enum_default(prop, GEO_NODE_CURVE_PRIMITIVE_QUAD_MODE_RECTANGLE); + RNA_def_property_ui_text(prop, "Mode", ""); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update"); +} + static void def_geo_curve_resample(StructRNA *srna) { PropertyRNA *prop; |