diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-08-29 18:52:36 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-08-29 18:52:36 +0400 |
commit | 973e317461c1c4541e04a742c18ca328dd48b35a (patch) | |
tree | cfdc6c6d2ea620b7e80b242e57855150c110732f /source/blender/blenkernel/intern | |
parent | e98ef3ae68bae2dbf05606b3baf2620500c8e132 (diff) |
correct own error r59619 (changes made to patch, adding handle recalculation which is needed after splitting).
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/curve.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index dd5932af895..0255e986661 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -3093,11 +3093,18 @@ void BKE_nurb_handle_calc_simple(Nurb *nu, BezTriple *bezt) BLI_assert(ARRAY_HAS_ITEM(bezt, nu->bezt, nu->pntsu)); - if (index == 0) { - prev = (nu->flag & CU_NURB_CYCLIC) ? &nu->bezt[nu->pntsu - 1] : NULL; + if (nu->pntsu > 1) { + if (index == 0) { + prev = (nu->flagu & CU_NURB_CYCLIC) ? &nu->bezt[nu->pntsu - 1] : NULL; + next = bezt + 1; + } + else if (index == nu->pntsu - 1) { + prev = bezt - 1; + next = (nu->flagu & CU_NURB_CYCLIC) ? &nu->bezt[0] : NULL; + } } - if (index == nu->pntsu - 1) { - next = (nu->flag & CU_NURB_CYCLIC) ? &nu->bezt[0] : NULL; + else { + prev = next = NULL; } BKE_nurb_handle_calc(bezt, prev, next, 0); |