diff options
author | Kevin Mackay <mackay.ka@gmail.com> | 2014-01-27 08:18:40 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-01-27 08:21:04 +0400 |
commit | fbc7ab30ff025ad3db59a73e2901883986e2e81e (patch) | |
tree | 3cbb2d7d4e6749d9216a73cbc45b323f03bd381f /source/blender/editors/transform | |
parent | f91368d82216497482a011e6b0987d3a5cdac951 (diff) |
Curves: save active point to file
Changed curve active point from pointer to index. Allows curve active point to be saved to file and retained between modes for free. Also some small optimisations by removing pointer look up code.
- Made active point access functions into BKE API calls.
- Fixes operators where curve de-selection resulted in unsel-active point.
- Split curve delete into 2 functions
Diffstat (limited to 'source/blender/editors/transform')
3 files changed, 8 insertions, 20 deletions
diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 85a2da10596..55ecc53fd01 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -1667,7 +1667,7 @@ void calculateCenter(TransInfo *t) float center[3]; Curve *cu = (Curve *)t->obedit->data; - if (ED_curve_actSelection(cu, center)) { + if (ED_curve_active_center(cu, center)) { copy_v3_v3(t->center, center); calculateCenter2D(t); break; diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c index ddbb05f2536..fc4e5fcb8e5 100644 --- a/source/blender/editors/transform/transform_manipulator.c +++ b/source/blender/editors/transform/transform_manipulator.c @@ -397,7 +397,7 @@ int calc_manipulator_stats(const bContext *C) Curve *cu = obedit->data; float center[3]; - if (v3d->around == V3D_ACTIVE && ED_curve_actSelection(cu, center)) { + if (v3d->around == V3D_ACTIVE && ED_curve_active_center(cu, center)) { calc_tw_center(scene, center); totsel++; } diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c index be8bc460764..1cb441b5b16 100644 --- a/source/blender/editors/transform/transform_orientations.c +++ b/source/blender/editors/transform/transform_orientations.c @@ -705,27 +705,15 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3], } /* end editmesh */ else if (ELEM(obedit->type, OB_CURVE, OB_SURF)) { Curve *cu = obedit->data; - Nurb *nu; - BezTriple *bezt; + Nurb *nu = NULL; + BezTriple *bezt = NULL; int a; ListBase *nurbs = BKE_curve_editNurbs_get(cu); - if (activeOnly && cu->lastsel) { - for (nu = nurbs->first; nu; nu = nu->next) { - if (nu->type == CU_BEZIER) { - if (ARRAY_HAS_ITEM((BezTriple *)cu->lastsel, nu->bezt, nu->pntsu)) { - bezt = cu->lastsel; - BKE_nurb_bezt_calc_normal(nu, bezt, normal); - BKE_nurb_bezt_calc_plane(nu, bezt, plane); - break; - } - } - else { - if (ARRAY_HAS_ITEM((BPoint *)cu->lastsel, nu->bp, nu->pntsu)) { - /* do nothing */ - break; - } - } + if (activeOnly && BKE_curve_nurb_vert_active_get(cu, &nu, (void *)&bezt)) { + if (nu->type == CU_BEZIER) { + BKE_nurb_bezt_calc_normal(nu, bezt, normal); + BKE_nurb_bezt_calc_plane(nu, bezt, plane); } } else { |