Fix T63980: only copy selected curves in Copy Keyframes from Graph Editor.

Otherwise things can become confusing due to copying unwanted curves,
especially if "Only Selected Curve Keyframes" is enabled, and thus
selected keyframes from other curves may not be visible.

Now Copy Keyframes behaves exactly like Paste Keyframes.
This commit is contained in:
Alexander Gavrilov 2019-05-01 19:17:59 +03:00
parent a9e546f57d
commit fc040335b7
Notes: blender-bot 2023-02-14 02:52:38 +01:00
Referenced by issue #63980, Incorrect pasting of F-Curves in graph editor
1 changed files with 8 additions and 2 deletions

View File

@ -932,9 +932,15 @@ static short copy_graph_keys(bAnimContext *ac)
/* clear buffer first */
ANIM_fcurves_copybuf_free();
/* filter data */
/* filter data
* - First time we try to filter more strictly, allowing only selected channels
* to allow copying animation between channels
*/
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_CURVE_VISIBLE | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
if (ANIM_animdata_filter(ac, &anim_data, filter | ANIMFILTER_SEL, ac->data, ac->datatype) == 0) {
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
}
/* copy keyframes */
ok = copy_animedit_keys(ac, &anim_data);