diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-01-26 12:55:41 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-01-26 13:08:43 +0300 |
commit | 027361c898b343a9c89182ebc15c1737e60946fc (patch) | |
tree | 7c974b999b9b8fcd1a527f3db9a5bfadfae5932d /source/blender/blenkernel/intern/curve.c | |
parent | 9415976d1785cd615f7585d3e4343a5474b8fe2e (diff) |
Fix T41834: Ctrl+LMB, Extrude Curves 2+ splines
Extrude and Ctrl+LMB now support multiple selected vertices.
Also maintain active vertices.
D964 by Tyler Sliwkanich with own modifications
Diffstat (limited to 'source/blender/blenkernel/intern/curve.c')
-rw-r--r-- | source/blender/blenkernel/intern/curve.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index f1e9f2b19d7..51330f27fea 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -3351,6 +3351,21 @@ void BKE_nurb_handle_calc_simple(Nurb *nu, BezTriple *bezt) } } +void BKE_nurb_handle_calc_simple_auto(Nurb *nu, BezTriple *bezt) +{ + if (nu->pntsu > 1) { + const char h1_back = bezt->h1, h2_back = bezt->h2; + + bezt->h1 = bezt->h2 = HD_AUTO; + + /* Override handle types to HD_AUTO and recalculate */ + BKE_nurb_handle_calc_simple(nu, bezt); + + bezt->h1 = h1_back; + bezt->h2 = h2_back; + } +} + /** * Use when something has changed handle positions. * @@ -3608,24 +3623,12 @@ void BKE_nurbList_handles_recalculate(ListBase *editnurb, const bool calc_length if (h1_select || h2_select) { - /* Override handle types to HD_AUTO and recalculate */ - - char h1_back, h2_back; float co1_back[3], co2_back[3]; - h1_back = bezt->h1; - h2_back = bezt->h2; - - bezt->h1 = HD_AUTO; - bezt->h2 = HD_AUTO; - copy_v3_v3(co1_back, bezt->vec[0]); copy_v3_v3(co2_back, bezt->vec[2]); - BKE_nurb_handle_calc_simple(nu, bezt); - - bezt->h1 = h1_back; - bezt->h2 = h2_back; + BKE_nurb_handle_calc_simple_auto(nu, bezt); if (h1_select) { if (!calc_length) { |