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:
authorCampbell Barton <ideasman42@gmail.com>2010-09-02 11:00:34 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-09-02 11:00:34 +0400
commitb2ae9d825c96ed73d2396b8da6e0c019a6384ff7 (patch)
tree267dcc85e082aeb9ca594d3ee752d19c84b5c72e /source/blender/makesrna/intern/rna_curve.c
parent35535c2cb9dce98dc9eb7dec7337cce40ad6d9d9 (diff)
- inconsistent rna names - use 'vertex_group_' as prefix, only ui scripts used this
- change curve offset to be 0.0 for its rest/default value (not 1.0)
Diffstat (limited to 'source/blender/makesrna/intern/rna_curve.c')
-rw-r--r--source/blender/makesrna/intern/rna_curve.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c
index f5eace91831..fb6da576811 100644
--- a/source/blender/makesrna/intern/rna_curve.c
+++ b/source/blender/makesrna/intern/rna_curve.c
@@ -356,6 +356,18 @@ static void rna_Curve_resolution_v_update_data(Main *bmain, Scene *scene, Pointe
rna_Curve_update_data(bmain, scene, ptr);
}
+static float rna_Curve_offset_get(PointerRNA *ptr)
+{
+ Curve *cu= (Curve*)ptr->id.data;
+ return cu->width - 1.0f;
+}
+
+static void rna_Curve_offset_set(PointerRNA *ptr, float value)
+{
+ Curve *cu= (Curve*)ptr->id.data;
+ cu->width= 1.0f + value;
+}
+
/* name functions that ignore the first two ID characters */
void rna_Curve_body_get(PointerRNA *ptr, char *value)
{
@@ -1109,8 +1121,9 @@ static void rna_def_curve(BlenderRNA *brna)
prop= RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "width");
- RNA_def_property_ui_range(prop, 0, 2.0, 0.1, 3);
- RNA_def_property_ui_text(prop, "Width", "Scale the original width (1.0) based on given factor");
+ RNA_def_property_ui_range(prop, -1.0, 1.0, 0.1, 3);
+ RNA_def_property_float_funcs(prop, "rna_Curve_offset_get", "rna_Curve_offset_set", NULL);
+ RNA_def_property_ui_text(prop, "Offset", "Offset the curve to adjust the width of a text");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "extrude", PROP_FLOAT, PROP_NONE);