1
1

Compare commits

...

2 Commits

Author SHA1 Message Date
87d654535c Animation: Change active FCurve in box/circle/lasso select
Update the active FCurve when box/circle/lasso-selecting, such that after
the operator has finished the active curve is actually the last-operated-on
FCurve.

The operator already would deactivate the active FCurve. However, it would
not re-activate one any more, which caused the active keyframe to become
inactive.
2020-10-26 18:18:31 +01:00
eccfa53ad4 Fix T81874: Box Select Keyframes doesnt set an active keyframe
Set the active keyframe on box/circle/lasso select in the graph editor.

For every FCurve that is influenced by the select operator that doesn't
have an active keyframe yet, the right-most keyframe is marked as the
active Keyframe.

Note that what is seen as the active keyframe for the graph editor also
depends on the active FCurve, which is not changed by box/circle/lasso
select.
2020-10-26 14:49:14 +01:00

View File

@@ -501,6 +501,24 @@ void GRAPH_OT_select_all(wmOperatorType *ot)
* The selection backend is also reused for the Lasso and Circle select operators.
*/
static short fcurve_activate_keyframe(KeyframeEditData *ked, struct BezTriple *bezt)
{
BKE_fcurve_active_keyframe_set(ked->fcu, bezt);
return 0;
}
/* Mark the last-selected keyframe as "active".
* Does nothing when the FCurve already has an active keyframe. */
static void fcurve_activate_last_selected_key(KeyframeEditData *ked,
FCurve *fcu,
const KeyframeEditFunc ok_cb)
{
if (BKE_fcurve_active_keyframe_index(fcu) != FCURVE_ACTIVE_KEYFRAME_NONE) {
return;
}
ANIM_fcurve_keyframes_loop(ked, fcu, ok_cb, fcurve_activate_keyframe, NULL);
}
/* Box Select only selects keyframes now, as overshooting handles often get caught too,
* which means that they may be inadvertently moved as well. However, incl_handles overrides
* this, and allow handles to be considered independently too.
@@ -610,8 +628,13 @@ static void box_select_graphkeys(bAnimContext *ac,
/* select the curve too now that curve will be touched */
if (selectmode == SELECT_ADD) {
fcu->flag |= FCURVE_SELECTED;
ANIM_set_active_channel(ac, ac->data, ac->datatype, filter, fcu, ANIMTYPE_FCURVE);
}
}
if (ELEM(selectmode, SELECT_ADD, SELECT_REPLACE)) {
fcurve_activate_last_selected_key(&ked, fcu, ok_cb);
}
}
/* un-apply NLA mapping from all the keyframes */