diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-06-10 00:28:08 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-06-10 00:28:08 +0400 |
commit | eabb30a2367808c163a90d658c5be586530098ec (patch) | |
tree | e3d1a20fad111127c3c20c3450b003553b171db5 /source/blender/editors/transform/transform_manipulator.c | |
parent | 28add50083204e99121c5290242652ccd3fcca9e (diff) |
patch [#35631] Active element for Lattice
by Kevin Mackay (yakca)
Was one of our TODO's from the wiki.
Diffstat (limited to 'source/blender/editors/transform/transform_manipulator.c')
-rw-r--r-- | source/blender/editors/transform/transform_manipulator.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c index f336fc4651b..d1d40689a4a 100644 --- a/source/blender/editors/transform/transform_manipulator.c +++ b/source/blender/editors/transform/transform_manipulator.c @@ -65,6 +65,7 @@ #include "BKE_particle.h" #include "BKE_pointcache.h" #include "BKE_editmesh.h" +#include "BKE_lattice.h" #include "BIF_gl.h" @@ -469,18 +470,23 @@ int calc_manipulator_stats(const bContext *C) } } else if (obedit->type == OB_LATTICE) { + Lattice *lt = ((Lattice *)obedit->data)->editlatt->latt; BPoint *bp; - Lattice *lt = obedit->data; - bp = lt->editlatt->latt->def; - - a = lt->editlatt->latt->pntsu * lt->editlatt->latt->pntsv * lt->editlatt->latt->pntsw; - while (a--) { - if (bp->f1 & SELECT) { - calc_tw_center(scene, bp->vec); - totsel++; + if ((v3d->around == V3D_ACTIVE) && (bp = BKE_lattice_active_point_get(lt))) { + calc_tw_center(scene, bp->vec); + totsel++; + } + else { + bp = lt->def; + a = lt->pntsu * lt->pntsv * lt->pntsw; + while (a--) { + if (bp->f1 & SELECT) { + calc_tw_center(scene, bp->vec); + totsel++; + } + bp++; } - bp++; } } |