diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-07-09 07:31:27 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-07-09 07:39:24 +0300 |
commit | bbc4a92318758ae104f796f62c7dceb1a972da44 (patch) | |
tree | 9622ca5d226bb69aeff9d0510d5e00f778e29b4a /source/blender/editors/space_graph | |
parent | ec64bf17e37122d67094f3ba8c9af0d48a856d0c (diff) |
Curve selection, de-duplicate & cleanup
Diffstat (limited to 'source/blender/editors/space_graph')
-rw-r--r-- | source/blender/editors/space_graph/graph_buttons.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_graph/graph_draw.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_graph/graph_select.c | 16 |
3 files changed, 11 insertions, 11 deletions
diff --git a/source/blender/editors/space_graph/graph_buttons.c b/source/blender/editors/space_graph/graph_buttons.c index e0b62722d57..451af0b50f7 100644 --- a/source/blender/editors/space_graph/graph_buttons.c +++ b/source/blender/editors/space_graph/graph_buttons.c @@ -229,7 +229,7 @@ static short get_active_fcurve_keyframe_edit(FCurve *fcu, BezTriple **bezt, BezT * wants to edit numerically, there is likely to only be 1 vert selected */ for (i = 0, b = fcu->bezt; i < fcu->totvert; i++, b++) { - if (BEZSELECTED(b)) { + if (BEZT_ISSEL_ANY(b)) { /* found * - 'previous' is either the one before, of the keyframe itself (which is still fine) * XXX: we can just make this null instead if needed diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c index 87e7cab4d15..91e11ac4b1e 100644 --- a/source/blender/editors/space_graph/graph_draw.c +++ b/source/blender/editors/space_graph/graph_draw.c @@ -229,7 +229,7 @@ static void draw_fcurve_vertices_handles(FCurve *fcu, SpaceIpo *sipo, View2D *v2 * Also, need to take into account whether the keyframe was selected * if a Graph Editor option to only show handles of selected keys is on. */ - if (!sel_handle_only || BEZSELECTED(bezt)) { + if (!sel_handle_only || BEZT_ISSEL_ANY(bezt)) { if ((!prevbezt && (bezt->ipo == BEZT_IPO_BEZ)) || (prevbezt && (prevbezt->ipo == BEZT_IPO_BEZ))) { if ((bezt->f1 & SELECT) == sel) /* && v2d->cur.xmin < bezt->vec[0][0] < v2d->cur.xmax)*/ draw_fcurve_handle_control(bezt->vec[0][0], bezt->vec[0][1], xscale, yscale, hsize); @@ -345,7 +345,7 @@ static void draw_fcurve_handles(SpaceIpo *sipo, FCurve *fcu) * check that keyframe is selected */ if (sipo->flag & SIPO_SELVHANDLESONLY) { - if (BEZSELECTED(bezt) == 0) + if (BEZT_ISSEL_ANY(bezt) == 0) continue; } diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c index 4cf8a1de7ab..79e852c805f 100644 --- a/source/blender/editors/space_graph/graph_select.c +++ b/source/blender/editors/space_graph/graph_select.c @@ -1112,7 +1112,7 @@ typedef enum eGraphVertIndex { static bool fcurve_handle_sel_check(SpaceIpo *sipo, BezTriple *bezt) { if (sipo->flag & SIPO_NOHANDLES) return 0; - if ((sipo->flag & SIPO_SELVHANDLESONLY) && BEZSELECTED(bezt) == 0) return 0; + if ((sipo->flag & SIPO_SELVHANDLESONLY) && BEZT_ISSEL_ANY(bezt) == 0) return 0; return 1; } @@ -1143,7 +1143,7 @@ static void nearest_fcurve_vert_store( /* if there is already a point for the F-Curve, check if this point is closer than that was */ if ((nvi) && (nvi->fcu == fcu)) { /* replace if we are closer, or if equal and that one wasn't selected but we are... */ - if ((nvi->dist > dist) || ((nvi->sel == 0) && BEZSELECTED(bezt))) + if ((nvi->dist > dist) || ((nvi->sel == 0) && BEZT_ISSEL_ANY(bezt))) replace = 1; } /* add new if not replacing... */ @@ -1158,7 +1158,7 @@ static void nearest_fcurve_vert_store( nvi->hpoint = hpoint; nvi->dist = dist; - nvi->sel = BEZSELECTED(bezt); // XXX... should this use the individual verts instead? + nvi->sel = BEZT_ISSEL_ANY(bezt); // XXX... should this use the individual verts instead? /* add to list of matches if appropriate... */ if (replace == 0) @@ -1338,11 +1338,11 @@ static void mouse_graph_keys(bAnimContext *ac, const int mval[2], short select_m if (select_mode == SELECT_INVERT) { /* keyframe - invert select of all */ if (nvi->hpoint == NEAREST_HANDLE_KEY) { - if (BEZSELECTED(bezt)) { - BEZ_DESEL(bezt); + if (BEZT_ISSEL_ANY(bezt)) { + BEZT_DESEL_ALL(bezt); } else { - BEZ_SEL(bezt); + BEZT_SEL_ALL(bezt); } } @@ -1359,7 +1359,7 @@ static void mouse_graph_keys(bAnimContext *ac, const int mval[2], short select_m else { /* if the keyframe was clicked on, select all verts of given beztriple */ if (nvi->hpoint == NEAREST_HANDLE_KEY) { - BEZ_SEL(bezt); + BEZT_SEL_ALL(bezt); } /* otherwise, select the handle that applied */ else if (nvi->hpoint == NEAREST_HANDLE_LEFT) @@ -1393,7 +1393,7 @@ static void mouse_graph_keys(bAnimContext *ac, const int mval[2], short select_m /* take selection status from item that got hit, to prevent flip/flop on channel * selection status when shift-selecting (i.e. "SELECT_INVERT") points */ - if (BEZSELECTED(bezt)) + if (BEZT_ISSEL_ANY(bezt)) nvi->fcu->flag |= FCURVE_SELECTED; else nvi->fcu->flag &= ~FCURVE_SELECTED; |