Fix T67873: View Selected in Graph Editor (Only Selected Curve
authorPhilipp Oeser <info@graphics-engineer.com>
Tue, 12 Nov 2019 18:36:36 +0000 (19:36 +0100)
committerPhilipp Oeser <info@graphics-engineer.com>
Thu, 21 Nov 2019 12:08:33 +0000 (13:08 +0100)
Keyframes) takes hidden keys into account when calculating zoom

Note that with the 'View Only Selected Curve Keyframes' option enabled,
it is also possible to select [box/circle/lasso] hidden/non-visible
keyframes. Think this should never happen, but that is for a later
commit (along some deduplication of animdata filtering code)

Reviewed By: Severin, Sybren

Maniphest Tasks: T67873

Differential Revision: https://developer.blender.org/D6237

source/blender/editors/space_graph/graph_edit.c

index 1a4881184031fb5ebacff74f137ef21cd15b2120..e7a25f6c659e71a23df4999d3d8320afb0241d5a 100644 (file)
@@ -85,6 +85,7 @@ void get_graph_keyframe_extents(bAnimContext *ac,
                                 const bool include_handles)
 {
   Scene *scene = ac->scene;
+  SpaceGraph *sipo = (SpaceGraph *)ac->sl;
 
   ListBase anim_data = {NULL, NULL};
   bAnimListElem *ale;
@@ -92,6 +93,10 @@ void get_graph_keyframe_extents(bAnimContext *ac,
 
   /* get data to filter, from Dopesheet */
   filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_CURVE_VISIBLE | ANIMFILTER_NODUPLIS);
+  if (sipo->flag & SIPO_SELCUVERTSONLY) {
+    filter |= ANIMFILTER_SEL;
+  }
+
   ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
 
   /* set large values initial values that will be easy to override */