From 97cb76a45d689a0d39e1d194f51119412e6c8e00 Mon Sep 17 00:00:00 2001 From: Lukas Treyer Date: Fri, 28 Mar 2014 16:41:56 +0600 Subject: Bevel Factor Mapping MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bevel Factor Mapping allows to control the relation between bevel factors (number between 0 and 1) and the rendered start and end point of a beveled spline. There are three options: "Resolution", "Segments", "Spline". "Resolution" option maps bevel factors as it was done < 2.71, "Spline" and "Segments" are new. * "Resolution“: Map the bevel factor to the number of subdivisions of a spline (U resolution). * "Segments“: Map the bevel factor to the length of a segment and to the number of subdivisions of a segment. * "Spline": Map the bevel factor to the length of a spline. Reviewers: yakca, sergey, campbellbarton CC: sanne Differential Revision: https://developer.blender.org/D294 --- source/blender/makesrna/intern/rna_curve.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'source/blender/makesrna/intern/rna_curve.c') diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index ee6d9df1726..31709f90249 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -1326,7 +1326,14 @@ static void rna_def_curve(BlenderRNA *brna) "Allow editing on the Z axis of this curve, also allows tilt and curve radius to be used"}, {0, NULL, 0, NULL, NULL} }; - + + static EnumPropertyItem bevfac_mapping_items[] = { + {CU_BEVFAC_MAP_RESOLU, "RESOLUTION", 0, "Resolution", "Map the bevel factor to the number of subdivisions of a spline (U resolution)"}, + {CU_BEVFAC_MAP_SEGMENT, "SEGMENTS", 0, "Segments", "Map the bevel factor to the length of a segment and to the number of subdivisions of a segment"}, + {CU_BEVFAC_MAP_SPLINE, "SPLINE", 0, "Spline", "Map the bevel factor to the length of a spline"}, + {0, NULL, 0, NULL, NULL} + }; + srna = RNA_def_struct(brna, "Curve", "ID"); RNA_def_struct_ui_text(srna, "Curve", "Curve datablock storing curves, splines and NURBS"); RNA_def_struct_ui_icon(srna, ICON_CURVE_DATA); @@ -1469,6 +1476,18 @@ static void rna_def_curve(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Twist Method", "The type of tilt calculation for 3D Curves"); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); + prop = RNA_def_property(srna, "bevel_factor_mapping_start", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "bevfac1_mapping"); + RNA_def_property_enum_items(prop, bevfac_mapping_items); + RNA_def_property_ui_text(prop, "Start Mapping Type", "Determines how the start bevel factor is mappend to a spline"); + RNA_def_property_update(prop, 0, "rna_Curve_update_data"); + + prop = RNA_def_property(srna, "bevel_factor_mapping_end", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "bevfac2_mapping"); + RNA_def_property_enum_items(prop, bevfac_mapping_items); + RNA_def_property_ui_text(prop, "End Mapping Type", "Determines how the end bevel factor is mappend to a spline"); + RNA_def_property_update(prop, 0, "rna_Curve_update_data"); + /* XXX - would be nice to have a better way to do this, only add for testing. */ prop = RNA_def_property(srna, "twist_smooth", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "twist_smooth"); -- cgit v1.2.3