From 5de17660e20efb28719847f24f4b99cd99f1772d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 27 May 2013 23:51:01 +0000 Subject: fix [#35543] Bezier curve width and twist fail to apply when more than 1 point is edited --- source/blender/editors/space_view3d/view3d_buttons.c | 5 +++-- source/blender/makesrna/intern/rna_curve.c | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'source/blender') diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index af013f7613a..b389cdfd4b6 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -382,6 +382,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float if (block) { /* buttons */ uiBut *but; int yi = 200; + const float tilt_limit = DEG2RADF(21600.0f); const int buth = 20 * UI_DPI_FAC; const int but_margin = 2; const char *c; @@ -458,7 +459,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float uiDefButR(block, NUM, 0, IFACE_("Radius"), 0, yi -= buth + but_margin, 200, buth, &data_ptr, "radius", 0, 0.0, 100.0, 1, 3, NULL); uiDefButR(block, NUM, 0, IFACE_("Tilt"), 0, yi -= buth + but_margin, 200, buth, - &data_ptr, "tilt", 0, -FLT_MAX, FLT_MAX, 1, 3, NULL); + &data_ptr, "tilt", 0, -tilt_limit, tilt_limit, 1, 3, NULL); } else if (totcurvedata > 1) { uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, IFACE_("Mean Weight:"), @@ -469,7 +470,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float &(tfp->ve_median[C_RADIUS]), 0.0, 100.0, 1, 3, TIP_("Radius of curve control points")); but = uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, IFACE_("Mean Tilt:"), 0, yi -= buth + but_margin, 200, buth, - &(tfp->ve_median[C_TILT]), -FLT_MAX, FLT_MAX, 1, 3, + &(tfp->ve_median[C_TILT]), -tilt_limit, tilt_limit, 1, 3, TIP_("Tilt of curve control points")); uiButSetUnitType(but, PROP_UNIT_ROTATION); } diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index 0d354b0827f..c9734545245 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -32,6 +32,7 @@ #include "DNA_scene_types.h" #include "BLI_utildefines.h" +#include "BLI_math.h" #include "BKE_font.h" @@ -688,6 +689,7 @@ static void rna_def_bpoint(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; + const float tilt_limit = DEG2RADF(21600.0f); srna = RNA_def_struct(brna, "SplinePoint", NULL); RNA_def_struct_sdna(srna, "BPoint"); @@ -720,7 +722,8 @@ static void rna_def_bpoint(BlenderRNA *brna) /* Number values */ prop = RNA_def_property(srna, "tilt", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "alfa"); - /*RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);*/ + RNA_def_property_range(prop, -tilt_limit, tilt_limit); + RNA_def_property_ui_range(prop, -tilt_limit, tilt_limit, 0.1, 3); RNA_def_property_ui_text(prop, "Tilt", "Tilt in 3D View"); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); -- cgit v1.2.3