diff options
author | Joshua Leung <aligorith@gmail.com> | 2013-07-01 17:19:38 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2013-07-01 17:19:38 +0400 |
commit | 72a5c1f007564db03c54218a4099bec2e2c8131e (patch) | |
tree | db39a9f081aeca1a889e1b4a1961f257aaa7d99d /source/blender/editors/animation/keyframing.c | |
parent | 4f3f95751ad264eb6be10d3470425e93afc557f6 (diff) |
Bugfix [#35887] Keyframes inserted at wrong time on offsetted NLA Strips when
using "Auto Keying" + "Insert Available Only"
Patch from Campbell.
The problem was that NLA offset/mapping correction was only done when no
destination action was supplied to insert_keyframe(). In most cases, this is not
a problem, since all normal keyframing goes through keyingset or the insert-
button operators, and these just pass action=NULL (since they're too lazy to
look it up). However, there is one situation where this bug gets triggered (the
specific combination of autokeyframing and "insert available only"), where the
caller of insert_keyframe() actually passed in an action (to prevent it from
creating one itself!).
Diffstat (limited to 'source/blender/editors/animation/keyframing.c')
-rw-r--r-- | source/blender/editors/animation/keyframing.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index c7c034da45b..1638e4ce629 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -909,6 +909,7 @@ short insert_keyframe(ReportList *reports, ID *id, bAction *act, const char grou { PointerRNA id_ptr, ptr; PropertyRNA *prop = NULL; + AnimData *adt; FCurve *fcu; int array_index_max = array_index + 1; int ret = 0; @@ -929,8 +930,6 @@ short insert_keyframe(ReportList *reports, ID *id, bAction *act, const char grou /* if no action is provided, keyframe to the default one attached to this ID-block */ if (act == NULL) { - AnimData *adt = BKE_animdata_from_id(id); - /* get action to add F-Curve+keyframe to */ act = verify_adt_action(id, 1); @@ -940,11 +939,12 @@ short insert_keyframe(ReportList *reports, ID *id, bAction *act, const char grou id->name, rna_path); return 0; } - - /* apply NLA-mapping to frame to use (if applicable) */ - cfra = BKE_nla_tweakedit_remap(adt, cfra, NLATIME_CONVERT_UNMAP); } + /* apply NLA-mapping to frame to use (if applicable) */ + adt = BKE_animdata_from_id(id); + cfra = BKE_nla_tweakedit_remap(adt, cfra, NLATIME_CONVERT_UNMAP); + /* key entire array convenience method */ if (array_index == -1) { array_index = 0; |