Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Treyer <treyer@arch.ethz.ch>2014-03-28 14:41:56 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2014-03-28 14:44:33 +0400
commit97cb76a45d689a0d39e1d194f51119412e6c8e00 (patch)
treee84bbf4505589a6c03b7a9b698fe48fe4854e202 /source/blender/makesrna/intern/rna_curve.c
parent3977b7612fa5d21d8e5b7af04da571149db7d2d9 (diff)
Bevel Factor Mapping
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
Diffstat (limited to 'source/blender/makesrna/intern/rna_curve.c')
-rw-r--r--source/blender/makesrna/intern/rna_curve.c21
1 files changed, 20 insertions, 1 deletions
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");