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/space_view3d/drawobject.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/space_view3d/drawobject.c')
-rw-r--r-- | source/blender/editors/space_view3d/drawobject.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 05583f90ba3..0caf679d775 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -1854,7 +1854,7 @@ static void lattice_draw_verts(Lattice *lt, DispList *dl, BPoint *actbp, short s if (bp->hide == 0) { /* check for active BPoint and ensure selected */ if ((bp == actbp) && (bp->f1 & SELECT)) { - UI_ThemeColor(TH_LASTSEL_POINT); + UI_ThemeColor(TH_ACTIVE_VERT); bglVertex3fv(dl ? co : bp->vec); UI_ThemeColor(color); } @@ -5358,7 +5358,7 @@ static void drawhandlesN_active(Nurb *nu) glLineWidth(1); } -static void drawvertsN(Nurb *nu, const char sel, const bool hide_handles, void *lastsel) +static void drawvertsN(Nurb *nu, const char sel, const bool hide_handles, const void *vert) { BezTriple *bezt; BPoint *bp; @@ -5383,8 +5383,8 @@ static void drawvertsN(Nurb *nu, const char sel, const bool hide_handles, void * a = nu->pntsu; while (a--) { if (bezt->hide == 0) { - if (sel == 1 && bezt == lastsel) { - UI_ThemeColor(TH_LASTSEL_POINT); + if (sel == 1 && bezt == vert) { + UI_ThemeColor(TH_ACTIVE_VERT); bglVertex3fv(bezt->vec[1]); if (!hide_handles) { @@ -5411,8 +5411,8 @@ static void drawvertsN(Nurb *nu, const char sel, const bool hide_handles, void * a = nu->pntsu * nu->pntsv; while (a--) { if (bp->hide == 0) { - if (bp == lastsel) { - UI_ThemeColor(TH_LASTSEL_POINT); + if (bp == vert) { + UI_ThemeColor(TH_ACTIVE_VERT); bglVertex3fv(bp->vec); UI_ThemeColor(color); } @@ -5621,6 +5621,7 @@ static void drawnurb(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, Curve *cu = ob->data; Nurb *nu; BevList *bl; + const void *vert = BKE_curve_vert_active_get(cu); const bool hide_handles = (cu->drawflag & CU_HIDE_HANDLES) != 0; int index; unsigned char wire_col[3]; @@ -5700,7 +5701,7 @@ static void drawnurb(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, if (v3d->zbuf) glDepthFunc(GL_ALWAYS); for (nu = nurb; nu; nu = nu->next) { - drawvertsN(nu, 1, hide_handles, cu->lastsel); + drawvertsN(nu, 1, hide_handles, vert); } if (v3d->zbuf) glDepthFunc(GL_LEQUAL); |