From eabb30a2367808c163a90d658c5be586530098ec Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 9 Jun 2013 20:28:08 +0000 Subject: patch [#35631] Active element for Lattice by Kevin Mackay (yakca) Was one of our TODO's from the wiki. --- .../editors/transform/transform_manipulator.c | 24 ++++++++++++++-------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'source/blender/editors/transform/transform_manipulator.c') 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++; } } -- cgit v1.2.3