diff options
Diffstat (limited to 'source/blender/makesrna/intern/rna_curve.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_curve.c | 55 |
1 files changed, 36 insertions, 19 deletions
diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index 3cf6feb005c..99473d13daa 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -74,6 +74,20 @@ EnumPropertyItem curve_type_items[] = { {CU_NURBS, "NURBS", 0, "Ease", ""}, {0, NULL, 0, NULL, NULL}}; +static const EnumPropertyItem curve3d_fill_mode_items[]= { + {0, "FULL", 0, "Full", ""}, + {CU_BACK, "BACK", 0, "Back", ""}, + {CU_FRONT, "FRONT", 0, "Front", ""}, + {CU_FRONT|CU_BACK, "HALF", 0, "Half", ""}, + {0, NULL, 0, NULL, NULL}}; + +static const EnumPropertyItem curve2d_fill_mode_items[]= { + {0, "NONE", 0, "None", ""}, + {CU_BACK, "BACK", 0, "Back", ""}, + {CU_FRONT, "FRONT", 0, "Front", ""}, + {CU_FRONT|CU_BACK, "BOTH", 0, "Both", ""}, + {0, NULL, 0, NULL, NULL}}; + #ifdef RNA_RUNTIME #include "BLI_math.h" @@ -278,6 +292,12 @@ static void rna_Curve_dimension_set(PointerRNA *ptr, int value) } } +static EnumPropertyItem *rna_Curve_fill_mode_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free) +{ + Curve *cu= (Curve*)ptr->id.data; + + return (cu->flag&CU_3D) ? curve3d_fill_mode_items : curve2d_fill_mode_items; +} static int rna_Nurb_length(PointerRNA *ptr) { @@ -1130,15 +1150,15 @@ static void rna_def_curve_spline_points(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_struct_ui_text(srna, "Spline Points", "Collection of spline points"); func= RNA_def_function(srna, "add", "rna_Curve_spline_points_add"); - RNA_def_function_ui_description(func, "Add a number of points to this spline."); + RNA_def_function_ui_description(func, "Add a number of points to this spline"); RNA_def_function_flag(func, FUNC_USE_SELF_ID|FUNC_USE_REPORTS); RNA_def_int(func, "count", 1, 1, INT_MAX, "Number", "Number of points to add to the spline", 1, INT_MAX); /* func= RNA_def_function(srna, "remove", "rna_Curve_spline_remove"); - RNA_def_function_ui_description(func, "Remove a spline from a curve."); + RNA_def_function_ui_description(func, "Remove a spline from a curve"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - parm= RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove."); + parm= RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); */ } @@ -1157,15 +1177,15 @@ static void rna_def_curve_spline_bezpoints(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_struct_ui_text(srna, "Spline Bezier Points", "Collection of spline bezirt points"); func= RNA_def_function(srna, "add", "rna_Curve_spline_bezpoints_add"); - RNA_def_function_ui_description(func, "Add a number of points to this spline."); + RNA_def_function_ui_description(func, "Add a number of points to this spline"); RNA_def_function_flag(func, FUNC_USE_SELF_ID|FUNC_USE_REPORTS); RNA_def_int(func, "count", 1, INT_MIN, INT_MAX, "Number", "Number of points to add to the spline", 0, INT_MAX); /* func= RNA_def_function(srna, "remove", "rna_Curve_spline_remove"); - RNA_def_function_ui_description(func, "Remove a spline from a curve."); + RNA_def_function_ui_description(func, "Remove a spline from a curve"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - parm= RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove."); + parm= RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); */ } @@ -1185,16 +1205,16 @@ static void rna_def_curve_splines(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_struct_ui_text(srna, "Curve Splines", "Collection of curve splines"); func= RNA_def_function(srna, "new", "rna_Curve_spline_new"); - RNA_def_function_ui_description(func, "Add a new spline to the curve."); - parm= RNA_def_enum(func, "type", curve_type_items, CU_POLY, "", "type for the new spline."); + RNA_def_function_ui_description(func, "Add a new spline to the curve"); + parm= RNA_def_enum(func, "type", curve_type_items, CU_POLY, "", "type for the new spline"); RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_pointer(func, "spline", "Spline", "", "The newly created spline."); + parm= RNA_def_pointer(func, "spline", "Spline", "", "The newly created spline"); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "remove", "rna_Curve_spline_remove"); - RNA_def_function_ui_description(func, "Remove a spline from a curve."); + RNA_def_function_ui_description(func, "Remove a spline from a curve"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - parm= RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove."); + parm= RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); @@ -1345,14 +1365,11 @@ static void rna_def_curve(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Dimensions", "Select 2D or 3D curve type"); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); - prop= RNA_def_property(srna, "use_fill_front", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_FRONT); - RNA_def_property_ui_text(prop, "Front", "Draw filled front for extruded/beveled curves"); - RNA_def_property_update(prop, 0, "rna_Curve_update_data"); - - prop= RNA_def_property(srna, "use_fill_back", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_BACK); - RNA_def_property_ui_text(prop, "Back", "Draw filled back for extruded/beveled curves"); + prop= RNA_def_property(srna, "fill_mode", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); + RNA_def_property_enum_items(prop, curve3d_fill_mode_items); + RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Curve_fill_mode_itemf"); + RNA_def_property_ui_text(prop, "Fill Mode", "Mode of filling curve"); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); prop= RNA_def_property(srna, "twist_mode", PROP_ENUM, PROP_NONE); |