Minor annoyance with graph editor selection:

Selecting graph keys would toggle channel selection if shift was held.
this was annoying when selecting 2+ unselected keys to have the channel change color each click.
Now set the channel based on the selection state of the point, as long as points are being selected the channel will stay selected too.
This commit is contained in:
2010-12-15 15:59:10 +00:00
parent 9129750787
commit 53adab9870

View File

@@ -955,6 +955,7 @@ static void mouse_graph_keys (bAnimContext *ac, int mval[], short select_mode, s
{
SpaceIpo *sipo= (SpaceIpo *)ac->sa->spacedata.first;
tNearestVertInfo *nvi;
BezTriple *bezt= NULL;
/* find the beztriple that we're selecting, and the handle that was clicked on */
nvi = find_nearest_fcurve_vert(ac, mval);
@@ -984,8 +985,7 @@ static void mouse_graph_keys (bAnimContext *ac, int mval[], short select_mode, s
if ((curves_only == 0) && ((nvi->fcu->flag & FCURVE_PROTECTED)==0)) {
/* only if there's keyframe */
if (nvi->bezt) {
BezTriple *bezt= nvi->bezt;
bezt= nvi->bezt; /* used to check bezt seletion is set */
/* depends on selection mode */
if (select_mode == SELECT_INVERT) {
/* keyframe - invert select of all */
@@ -1041,11 +1041,23 @@ static void mouse_graph_keys (bAnimContext *ac, int mval[], short select_mode, s
/* only change selection of channel when the visibility of keyframes doesn't depend on this */
if ((sipo->flag & SIPO_SELCUVERTSONLY) == 0) {
/* select or deselect curve? */
if (select_mode == SELECT_INVERT)
nvi->fcu->flag ^= FCURVE_SELECTED;
else if (select_mode == SELECT_ADD)
nvi->fcu->flag |= FCURVE_SELECTED;
/* when a single point is selected then dont toggle channel selection */
if(bezt) {
if((bezt->f2|bezt->f1|bezt->f3) & SELECT) {
nvi->fcu->flag |= FCURVE_SELECTED;
}
else {
nvi->fcu->flag &= ~FCURVE_SELECTED;
}
}
else {
if (select_mode == SELECT_INVERT)
nvi->fcu->flag ^= FCURVE_SELECTED;
else if (select_mode == SELECT_ADD)
nvi->fcu->flag |= FCURVE_SELECTED;
}
/* set active F-Curve (NOTE: sync the filter flags with findnearest_fcurve_vert) */
if (nvi->fcu->flag & FCURVE_SELECTED) {
int filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);