diff options
author | Johnny Matthews <johnny.matthews@gmail.com> | 2022-10-03 23:50:21 +0300 |
---|---|---|
committer | Johnny Matthews <johnny.matthews@gmail.com> | 2022-10-03 23:50:21 +0300 |
commit | 748fda32ede88887e1baeccca5c119326e031dd6 (patch) | |
tree | 652739a7349b1ca901cb2dad8b049014e0e99b6c /source/blender/makesrna | |
parent | b475506cfbd35fe2d356ce43a6a3e1f93bd6602b (diff) |
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
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/RNA_enum_items.h | 1 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_curves.c | 6 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_nodetree.c | 12 |
3 files changed, 19 insertions, 0 deletions
diff --git a/source/blender/makesrna/RNA_enum_items.h b/source/blender/makesrna/RNA_enum_items.h index 4bbf2caf7a8..53241c4a809 100644 --- a/source/blender/makesrna/RNA_enum_items.h +++ b/source/blender/makesrna/RNA_enum_items.h @@ -230,6 +230,7 @@ DEF_ENUM(rna_enum_transform_orientation_items) DEF_ENUM(rna_enum_velocity_unit_items) DEF_ENUM(rna_enum_curves_types) +DEF_ENUM(rna_enum_curve_normal_modes) /* Not available to RNA pre-processing (`makesrna`). * Defined in editors for example. */ 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; |