diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-08-29 06:32:51 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-08-29 06:32:51 +0400 |
commit | 95fcf02500408e6457806e8a293572b9ef91381a (patch) | |
tree | 97ccd8d57e3e26f895b46a36a08081afaa04ca01 /source/blender/blenkernel/intern/curve.c | |
parent | e7d725eefda42ec315d887cfa91c733f26b0f3b1 (diff) |
patch [#36336] Split operator for curves and surfaces
by Kevin Mackay (yakca)
The operator follows roughly the same behaviour as the split operator for a mesh (Ykey).
Diffstat (limited to 'source/blender/blenkernel/intern/curve.c')
-rw-r--r-- | source/blender/blenkernel/intern/curve.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index e41b1999198..dd5932af895 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -3084,6 +3084,24 @@ void BKE_nurb_handles_calc(Nurb *nu) /* first, if needed, set handle flags */ calchandlesNurb_intern(nu, FALSE); } +/* similar to BKE_nurb_handle_calc but for curves and + * figures out the previous and next for us */ +void BKE_nurb_handle_calc_simple(Nurb *nu, BezTriple *bezt) +{ + int index = (int)(bezt - nu->bezt); + BezTriple *prev, *next; + + 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 (index == nu->pntsu - 1) { + next = (nu->flag & CU_NURB_CYCLIC) ? &nu->bezt[0] : NULL; + } + + BKE_nurb_handle_calc(bezt, prev, next, 0); +} void BKE_nurb_handles_test(Nurb *nu) { |