From 748fda32ede88887e1baeccca5c119326e031dd6 Mon Sep 17 00:00:00 2001 From: Johnny Matthews Date: Mon, 3 Oct 2022 15:50:21 -0500 Subject: Geometry Nodes: Set Curve Normal This node allows for curves to have their evaluated normal mode changed between MINIMUM_TWIST and Z_UP. A selection input allows for choosing which spline in the curves object will be affected. Differential Revision: D16118 --- source/blender/makesrna/intern/rna_curves.c | 6 ++++++ source/blender/makesrna/intern/rna_nodetree.c | 12 ++++++++++++ 2 files changed, 18 insertions(+) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_curves.c b/source/blender/makesrna/intern/rna_curves.c index 3d29add3427..a01a2bcb8cd 100644 --- a/source/blender/makesrna/intern/rna_curves.c +++ b/source/blender/makesrna/intern/rna_curves.c @@ -26,6 +26,12 @@ const EnumPropertyItem rna_enum_curves_types[] = { {0, NULL, 0, NULL, NULL}, }; +const EnumPropertyItem rna_enum_curve_normal_modes[] = { + {NORMAL_MODE_MINIMUM_TWIST, "MINIMUM_TWIST", ICON_NONE, "Minimum Twist", ""}, + {NORMAL_MODE_Z_UP, "Z_UP", ICON_NONE, "Z Up", ""}, + {0, NULL, 0, NULL, NULL}, +}; + #ifdef RNA_RUNTIME # include "BLI_math_vector.h" diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index ed5a3563fb5..74b1d9ab970 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -13,6 +13,7 @@ #include "BLT_translation.h" +#include "DNA_curves_types.h" #include "DNA_material_types.h" #include "DNA_mesh_types.h" #include "DNA_modifier_types.h" @@ -9698,6 +9699,17 @@ static void def_geo_curve_set_handle_positions(StructRNA *srna) RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update"); } +static void def_geo_set_curve_normal(StructRNA *srna) +{ + PropertyRNA *prop; + + prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "custom1"); + RNA_def_property_enum_items(prop, rna_enum_curve_normal_modes); + RNA_def_property_ui_text(prop, "Mode", "Mode for curve normal evaluation"); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); +} + static void def_geo_curve_handle_type_selection(StructRNA *srna) { PropertyRNA *prop; -- cgit v1.2.3