diff options
author | Joshua Leung <aligorith@gmail.com> | 2016-02-05 16:34:57 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2016-02-05 16:40:43 +0300 |
commit | c4dc14b079d81fd012383b910291246e7ebf9a04 (patch) | |
tree | 576546590ab4703dad59fea84bd8355683861c48 /source/blender/editors/animation | |
parent | c105c59bb4e00d88c688f63c699dc78c0be4592a (diff) |
Fix T45915: Cannot select keyframes in summary channels in Dope Sheet in TweakMode
When in TweakMode on NLA strips that had an offset, it was not possible to select
those keyframes in the Summary Channel in the Dope Sheet.
The main gist of it is that the current code is from before the summary track was
introduced, and so could assume that ANIM_nla_mapping_get() would work for all channels
present. Thus, simply converting the clicked frame to nla-mapped time once would be
enough. However, for summary channels, nla-mapping_get() doesn't do anything, since
we can potentially include keyframes from several different objects!
Diffstat (limited to 'source/blender/editors/animation')
-rw-r--r-- | source/blender/editors/animation/keyframes_edit.c | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/source/blender/editors/animation/keyframes_edit.c b/source/blender/editors/animation/keyframes_edit.c index dd01e53d099..ba98702e639 100644 --- a/source/blender/editors/animation/keyframes_edit.c +++ b/source/blender/editors/animation/keyframes_edit.c @@ -44,6 +44,7 @@ #include "DNA_scene_types.h" #include "BKE_fcurve.h" +#include "BKE_nla.h" #include "ED_anim_api.h" #include "ED_keyframes_edit.h" @@ -290,9 +291,39 @@ static short summary_keyframes_loop(KeyframeEditData *ked, bAnimContext *ac, Key case ALE_MASKLAY: case ALE_GPFRAME: break; + + case ALE_FCURVE: default: - ret_code = ANIM_fcurve_keyframes_loop(ked, ale->data, key_ok, key_cb, fcu_cb); + { + if (ked->iterflags) { + /* make backups of the current values, so that a localised fix + * (e.g. NLA time remapping) can be applied to these values + */ + float f1 = ked->f1; + float f2 = ked->f2; + + if (ked->iterflags & (KED_F1_NLA_UNMAP | KED_F2_NLA_UNMAP)) { + AnimData *adt = ANIM_nla_mapping_get(ac, ale); + + if (ked->iterflags & KED_F1_NLA_UNMAP) + ked->f1 = BKE_nla_tweakedit_remap(adt, f1, NLATIME_CONVERT_UNMAP); + if (ked->iterflags & KED_F2_NLA_UNMAP) + ked->f2 = BKE_nla_tweakedit_remap(adt, f2, NLATIME_CONVERT_UNMAP); + } + + /* now operate on the channel as per normal */ + ret_code = ANIM_fcurve_keyframes_loop(ked, ale->data, key_ok, key_cb, fcu_cb); + + /* reset */ + ked->f1 = f1; + ked->f2 = f2; + } + else { + /* no special handling required... */ + ret_code = ANIM_fcurve_keyframes_loop(ked, ale->data, key_ok, key_cb, fcu_cb); + } break; + } } if (ret_code) |