[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [57902] trunk/blender/source/blender/ editors/animation/keyframing.c: Bugfix [#35887] Keyframes inserted at wrong time on offsetted NLA Strips when

Joshua Leung aligorith at gmail.com
Mon Jul 1 15:19:39 CEST 2013


Revision: 57902
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=57902
Author:   aligorith
Date:     2013-07-01 13:19:38 +0000 (Mon, 01 Jul 2013)
Log Message:
-----------
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!).

Modified Paths:
--------------
    trunk/blender/source/blender/editors/animation/keyframing.c

Modified: trunk/blender/source/blender/editors/animation/keyframing.c
===================================================================
--- trunk/blender/source/blender/editors/animation/keyframing.c	2013-07-01 13:02:53 UTC (rev 57901)
+++ trunk/blender/source/blender/editors/animation/keyframing.c	2013-07-01 13:19:38 UTC (rev 57902)
@@ -909,6 +909,7 @@
 {	
 	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 @@
 	
 	/* 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 @@
 			            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;




More information about the Bf-blender-cvs mailing list