diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2010-10-04 14:06:18 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2010-10-04 14:06:18 +0400 |
commit | a6d62bf0db09ae2759fd45abb3af563fefc13690 (patch) | |
tree | 417a63d0fa3861e6c30c92a25d42161c197ad430 /source/blender/makesrna/intern/rna_curve.c | |
parent | 636e555ec2aa862d23470c8c2cd0d48cb1b9125d (diff) |
Recalc knots when toggling nurb cyclic flags
Diffstat (limited to 'source/blender/makesrna/intern/rna_curve.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_curve.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index 37be1d89d30..50c21640554 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -399,12 +399,24 @@ void rna_Curve_body_set(PointerRNA *ptr, const char *value) BLI_strncpy(cu->str, value, len+1); } -static void rna_Nurb_update_handle_data(Main *bmain, Scene *scene, PointerRNA *ptr) +static void rna_Nurb_update_cyclic_u(Main *bmain, Scene *scene, PointerRNA *ptr) { Nurb *nu= (Nurb*)ptr->data; - if(nu->type == CU_BEZIER) + if(nu->type == CU_BEZIER) { calchandlesNurb(nu); + } else { + nurbs_knot_calc_u(nu); + } + + rna_Curve_update_data(bmain, scene, ptr); +} + +static void rna_Nurb_update_cyclic_v(Main *bmain, Scene *scene, PointerRNA *ptr) +{ + Nurb *nu= (Nurb*)ptr->data; + + nurbs_knot_calc_v(nu); rna_Curve_update_data(bmain, scene, ptr); } @@ -1356,12 +1368,12 @@ static void rna_def_curve_nurb(BlenderRNA *brna) prop= RNA_def_property(srna, "use_cyclic_u", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flagu", CU_NURB_CYCLIC); RNA_def_property_ui_text(prop, "Cyclic U", "Make this curve or surface a closed loop in the U direction"); - RNA_def_property_update(prop, 0, "rna_Nurb_update_handle_data"); /* only needed for cyclic_u because cyclic_v cant do bezier */ + RNA_def_property_update(prop, 0, "rna_Nurb_update_cyclic_u"); prop= RNA_def_property(srna, "use_cyclic_v", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flagv", CU_NURB_CYCLIC); RNA_def_property_ui_text(prop, "Cyclic V", "Make this surface a closed loop in the V direction"); - RNA_def_property_update(prop, 0, "rna_Curve_update_data"); + RNA_def_property_update(prop, 0, "rna_Nurb_update_cyclic_u"); /* Note, endpoint and bezier flags should never be on at the same time! */ |