diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-11-03 20:16:19 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-11-03 20:16:19 +0400 |
commit | b99f6e3d082b1b47591cdae1d2f3b78a75dd719b (patch) | |
tree | ff5e76ae5c12f071a86496b161df50655a925c73 /source/blender/makesrna/intern/rna_curve.c | |
parent | 665f602f152984f5a6f4ea05a2a90382acbf700a (diff) |
Fix #29005: Bezier/Surface Datablock switching bug?
This commit updates curve datablock to respect curve dimension flag
when setting datablock for curve.
Not ideal but this makes behavior quite expected, avoids big changes in
curves core stuff which depends on object type and prevents restrictions
on changing data datablock which works in general cases.
Diffstat (limited to 'source/blender/makesrna/intern/rna_curve.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_curve.c | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index cbac594a80f..1f52b0ac149 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -271,23 +271,10 @@ static void rna_Curve_dimension_set(PointerRNA *ptr, int value) ListBase *nurbs= BKE_curve_nurbs(cu); Nurb *nu= nurbs->first; - if(value==CU_3D) { - cu->flag |= CU_3D; - for( ; nu; nu= nu->next) { - nu->flag &= ~CU_2D; - } - } - else { - cu->flag &= ~CU_3D; - for( ; nu; nu= nu->next) { - nu->flag |= CU_2D; - test2DNurb(nu); - - /* since the handles are moved they need to be auto-located again */ - if(nu->type == CU_BEZIER) - calchandlesNurb(nu); - } - } + if(value==CU_3D) cu->flag |= CU_3D; + else cu->flag &= ~CU_3D; + + update_curve_dimension(cu); } static EnumPropertyItem *rna_Curve_fill_mode_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *UNUSED(free)) |