Graph Editor: Selecting F-Curve channels + keyframes now sets active F-Curve correctly.
This commit is contained in:
@@ -1220,7 +1220,7 @@ static void mouse_anim_channels (bAnimContext *ac, float x, int channel_index, s
|
||||
}
|
||||
|
||||
/* if group is selected now, make group the 'active' one in the visible list */
|
||||
if ((agrp->flag & AGRP_SELECTED) && (selectmode != SELECT_INVERT))
|
||||
if (agrp->flag & AGRP_SELECTED)
|
||||
ANIM_set_active_channel(ac->data, ac->datatype, filter, agrp, ANIMTYPE_GROUP);
|
||||
}
|
||||
}
|
||||
@@ -1240,17 +1240,23 @@ static void mouse_anim_channels (bAnimContext *ac, float x, int channel_index, s
|
||||
}
|
||||
else if ((x < (offset+17)) && (ac->spacetype==SPACE_IPO)) {
|
||||
/* toggle visibility */
|
||||
// XXX this is supposed to be button before name, though this sometimes fails
|
||||
fcu->flag ^= FCURVE_VISIBLE;
|
||||
}
|
||||
else {
|
||||
/* select/deselect */
|
||||
fcu->flag ^= FCURVE_SELECTED;
|
||||
if (selectmode == SELECT_INVERT) {
|
||||
/* inverse selection status of this F-Curve only */
|
||||
fcu->flag ^= FCURVE_SELECTED;
|
||||
}
|
||||
else {
|
||||
/* select F-Curve by itself */
|
||||
ANIM_deselect_anim_channels(ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR);
|
||||
fcu->flag |= FCURVE_SELECTED;
|
||||
}
|
||||
|
||||
/* if F-Curve is selected now, make F-Curve the 'active' one in the visible list */
|
||||
if (fcu->flag & FCURVE_SELECTED)
|
||||
fcu->flag |= FCURVE_ACTIVE;
|
||||
else
|
||||
fcu->flag &= ~FCURVE_ACTIVE;
|
||||
ANIM_set_active_channel(ac->data, ac->datatype, filter, fcu, ANIMTYPE_FCURVE);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -661,6 +661,7 @@ static void mouse_graph_keys (bAnimContext *ac, int mval[], short selectmode)
|
||||
FCurve *fcu;
|
||||
BezTriple *bezt;
|
||||
short handle;
|
||||
int filter;
|
||||
|
||||
/* find the beztriple that we're selecting, and the handle that was clicked on */
|
||||
handle= findnearest_fcurve_vert(ac, mval, &fcu, &bezt);
|
||||
@@ -719,16 +720,16 @@ static void mouse_graph_keys (bAnimContext *ac, int mval[], short selectmode)
|
||||
}
|
||||
|
||||
/* select or deselect curve? */
|
||||
if (selectmode == SELECT_INVERT) {
|
||||
if (selectmode == SELECT_INVERT)
|
||||
fcu->flag ^= FCURVE_SELECTED;
|
||||
|
||||
if (fcu->flag & FCURVE_SELECTED)
|
||||
fcu->flag |= FCURVE_ACTIVE;
|
||||
else
|
||||
fcu->flag &= ~FCURVE_ACTIVE;
|
||||
}
|
||||
else if (selectmode == SELECT_ADD)
|
||||
fcu->flag |= (FCURVE_ACTIVE|FCURVE_SELECTED);
|
||||
fcu->flag |= FCURVE_SELECTED;
|
||||
|
||||
/* set active F-Curve (NOTE: sync the filter flags with findnearest_fcurve_vert) */
|
||||
if (fcu->flag & FCURVE_SELECTED) {
|
||||
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY);
|
||||
ANIM_set_active_channel(ac->data, ac->datatype, filter, fcu, ANIMTYPE_FCURVE);
|
||||
}
|
||||
}
|
||||
|
||||
/* Option 2) Selects all the keyframes on either side of the current frame (depends on which side the mouse is on) */
|
||||
@@ -881,7 +882,6 @@ static int graphkeys_clickselect_invoke(bContext *C, wmOperator *op, wmEvent *ev
|
||||
else {
|
||||
/* select keyframe under mouse */
|
||||
mouse_graph_keys(&ac, mval, selectmode); // xxx curves only should become an arg
|
||||
// XXX activate transform...
|
||||
}
|
||||
|
||||
/* set notifier tha things have changed */
|
||||
|
||||
Reference in New Issue
Block a user