diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-11-15 10:37:47 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-11-15 10:37:47 +0400 |
commit | e8906f5254cdedb0dcbfab31a800ba1f9ed860f5 (patch) | |
tree | 495ef9912afeb4623681998cb153673d45102a95 /source/blender/editors/transform/transform_manipulator.c | |
parent | 4371db4b3340a193f99c35941243cc206ea7de95 (diff) |
Fix #29253: 3D Manipulator: "Active Element" not supported for curves
This funcitonality simply wasn't implemented for curves yet, implemented it now.
Diffstat (limited to 'source/blender/editors/transform/transform_manipulator.c')
-rw-r--r-- | source/blender/editors/transform/transform_manipulator.c | 91 |
1 files changed, 50 insertions, 41 deletions
diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c index 5b275a572cb..63495d54cf1 100644 --- a/source/blender/editors/transform/transform_manipulator.c +++ b/source/blender/editors/transform/transform_manipulator.c @@ -71,6 +71,7 @@ #include "WM_types.h" #include "ED_armature.h" +#include "ED_curve.h" #include "ED_mesh.h" #include "ED_particle.h" #include "ED_view3d.h" @@ -390,56 +391,64 @@ int calc_manipulator_stats(const bContext *C) } else if ELEM(obedit->type, OB_CURVE, OB_SURF) { Curve *cu= obedit->data; - Nurb *nu; - BezTriple *bezt; - BPoint *bp; - ListBase *nurbs= curve_editnurbs(cu); - - nu= nurbs->first; - while(nu) { - if(nu->type == CU_BEZIER) { - bezt= nu->bezt; - a= nu->pntsu; - while(a--) { - /* exceptions - * if handles are hidden then only check the center points. - * If the center knot is selected then only use this as the center point. - */ - if (cu->drawflag & CU_HIDE_HANDLES) { - if (bezt->f2 & SELECT) { - calc_tw_center(scene, bezt->vec[1]); - totsel++; + float center[3]; + + if (v3d->around==V3D_ACTIVE && ED_curve_actSelection(cu, center)) { + calc_tw_center(scene, center); + totsel++; + } + else { + Nurb *nu; + BezTriple *bezt; + BPoint *bp; + ListBase *nurbs= curve_editnurbs(cu); + + nu= nurbs->first; + while(nu) { + if(nu->type == CU_BEZIER) { + bezt= nu->bezt; + a= nu->pntsu; + while(a--) { + /* exceptions + * if handles are hidden then only check the center points. + * If the center knot is selected then only use this as the center point. + */ + if (cu->drawflag & CU_HIDE_HANDLES) { + if (bezt->f2 & SELECT) { + calc_tw_center(scene, bezt->vec[1]); + totsel++; + } } - } - else if (bezt->f2 & SELECT) { - calc_tw_center(scene, bezt->vec[1]); - totsel++; - } - else { - if(bezt->f1) { - calc_tw_center(scene, bezt->vec[0]); + else if (bezt->f2 & SELECT) { + calc_tw_center(scene, bezt->vec[1]); totsel++; } - if(bezt->f3) { - calc_tw_center(scene, bezt->vec[2]); - totsel++; + else { + if(bezt->f1) { + calc_tw_center(scene, bezt->vec[0]); + totsel++; + } + if(bezt->f3) { + calc_tw_center(scene, bezt->vec[2]); + totsel++; + } } + bezt++; } - bezt++; } - } - else { - bp= nu->bp; - a= nu->pntsu*nu->pntsv; - while(a--) { - if(bp->f1 & SELECT) { - calc_tw_center(scene, bp->vec); - totsel++; + else { + bp= nu->bp; + a= nu->pntsu*nu->pntsv; + while(a--) { + if(bp->f1 & SELECT) { + calc_tw_center(scene, bp->vec); + totsel++; + } + bp++; } - bp++; } + nu= nu->next; } - nu= nu->next; } } else if(obedit->type==OB_MBALL) { |