[Bf-blender-cvs] [7ddc49ad34a] blender-v2.91-release: Fix T81905: Active keyframe unavailable when handle selected

Campbell Barton noreply at git.blender.org
Thu Oct 22 06:58:02 CEST 2020


Commit: 7ddc49ad34acc21dc69ca82c9913234033f7c209
Author: Campbell Barton
Date:   Thu Oct 22 15:46:31 2020 +1100
Branches: blender-v2.91-release
https://developer.blender.org/rB7ddc49ad34acc21dc69ca82c9913234033f7c209

Fix T81905: Active keyframe unavailable when handle selected

Selecting an F-Curve handle caused an assertion as well as treating
the key-frame as inactive.

Allow active the keyframe to be active when it's handle is selected,
as is done with bezier curves.

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

M	source/blender/blenkernel/intern/fcurve.c

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

diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c
index fafcbaec10f..dcf4c78dfd8 100644
--- a/source/blender/blenkernel/intern/fcurve.c
+++ b/source/blender/blenkernel/intern/fcurve.c
@@ -842,7 +842,8 @@ bool BKE_fcurve_calc_range(
 void BKE_fcurve_active_keyframe_set(FCurve *fcu, const BezTriple *active_bezt)
 {
   /* The active keyframe should always be selected. */
-  BLI_assert(active_bezt == NULL || (active_bezt->f2 & SELECT));
+  BLI_assert((active_bezt == NULL) ||
+             ((active_bezt->f1 | active_bezt->f2 | active_bezt->f3) & SELECT));
   fcu->active_keyframe_index = (active_bezt == NULL) ? FCURVE_ACTIVE_KEYFRAME_NONE :
                                                        active_bezt - fcu->bezt;
 }
@@ -861,7 +862,7 @@ int BKE_fcurve_active_keyframe_index(const FCurve *fcu)
   }
 
   const BezTriple *active_bezt = &fcu->bezt[active_keyframe_index];
-  if ((active_bezt->f2 & SELECT) == 0) {
+  if (((active_bezt->f1 | active_bezt->f2 | active_bezt->f3) & SELECT) == 0) {
     /* The active keyframe should always be selected. If it's not selected, it can't be active. */
     return FCURVE_ACTIVE_KEYFRAME_NONE;
   }



More information about the Bf-blender-cvs mailing list