[Bf-blender-cvs] [fc040335b7a] master: Fix T63980: only copy selected curves in Copy Keyframes from Graph Editor.

Alexander Gavrilov noreply at git.blender.org
Wed May 1 18:32:57 CEST 2019


Commit: fc040335b7a5eeaa3c57bd176656f86f9d56dc48
Author: Alexander Gavrilov
Date:   Wed May 1 19:17:59 2019 +0300
Branches: master
https://developer.blender.org/rBfc040335b7a5eeaa3c57bd176656f86f9d56dc48

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.

===================================================================

M	source/blender/editors/space_graph/graph_edit.c

===================================================================

diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c
index 573e3cb5899..0954538e430 100644
--- a/source/blender/editors/space_graph/graph_edit.c
+++ b/source/blender/editors/space_graph/graph_edit.c
@@ -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);



More information about the Bf-blender-cvs mailing list