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/transform_orientations.c | |
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/transform_orientations.c')
-rw-r--r-- | source/blender/editors/transform/transform_orientations.c | 24 |
1 files changed, 6 insertions, 18 deletions
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 { |