diff options
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/RNA_enum_items.h | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_curves.c | 8 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_nodetree.c | 10 |
3 files changed, 13 insertions, 7 deletions
diff --git a/source/blender/makesrna/RNA_enum_items.h b/source/blender/makesrna/RNA_enum_items.h index 7c6a434a97a..61c5c1a6c72 100644 --- a/source/blender/makesrna/RNA_enum_items.h +++ b/source/blender/makesrna/RNA_enum_items.h @@ -228,6 +228,8 @@ DEF_ENUM(rna_enum_transform_orientation_items) DEF_ENUM(rna_enum_velocity_unit_items) +DEF_ENUM(rna_enum_curves_types) + /* Not available to RNA pre-processing (`makesrna`). * Defined in editors for example. */ #ifndef RNA_MAKESRNA diff --git a/source/blender/makesrna/intern/rna_curves.c b/source/blender/makesrna/intern/rna_curves.c index b50082056bf..bc3e5203ed0 100644 --- a/source/blender/makesrna/intern/rna_curves.c +++ b/source/blender/makesrna/intern/rna_curves.c @@ -18,6 +18,14 @@ #include "WM_types.h" +const EnumPropertyItem rna_enum_curves_types[] = { + {CURVE_TYPE_CATMULL_ROM, "CATMULL_ROM", 0, "Catmull Rom", ""}, + {CURVE_TYPE_POLY, "POLY", 0, "Poly", ""}, + {CURVE_TYPE_BEZIER, "BEZIER", 0, "Bezier", ""}, + {CURVE_TYPE_NURBS, "NURBS", 0, "NURBS", ""}, + {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 841c250df4c..53f207328c9 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -9575,18 +9575,14 @@ static void def_geo_distribute_points_on_faces(StructRNA *srna) static void def_geo_curve_spline_type(StructRNA *srna) { - static const EnumPropertyItem type_items[] = { - {GEO_NODE_SPLINE_TYPE_BEZIER, "BEZIER", ICON_NONE, "Bezier", "Set the splines to Bezier"}, - {GEO_NODE_SPLINE_TYPE_NURBS, "NURBS", ICON_NONE, "NURBS", "Set the splines to NURBS"}, - {GEO_NODE_SPLINE_TYPE_POLY, "POLY", ICON_NONE, "Poly", "Set the splines to Poly"}, - {0, NULL, 0, NULL, NULL}}; - PropertyRNA *prop; RNA_def_struct_sdna_from(srna, "NodeGeometryCurveSplineType", "storage"); prop = RNA_def_property(srna, "spline_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "spline_type"); - RNA_def_property_enum_items(prop, type_items); + RNA_def_property_enum_items(prop, rna_enum_curves_types); + RNA_def_property_ui_text(prop, "Type", "The curve type to change the selected curves to"); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update"); } |