[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [28012] trunk/blender/source/blender/ editors: Bugfix #21856: Empty F-Curves created when keyframing with ' auto keyframing mode' set to 'replace' caused problems with bad rotations and scaling to a point.

Joshua Leung aligorith at gmail.com
Mon Apr 5 14:17:35 CEST 2010


Revision: 28012
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=28012
Author:   aligorith
Date:     2010-04-05 14:17:33 +0200 (Mon, 05 Apr 2010)

Log Message:
-----------
Bugfix #21856: Empty F-Curves created when keyframing with 'auto keyframing mode' set to 'replace' caused problems with bad rotations and scaling to a point. 

Now, when the mode is 'replace', no F-Curves are created during keyframing (i.e. only existing F-Curves are used).

---

Also, fixed missing line in previous commit for Select Linked. 

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

Modified: trunk/blender/source/blender/editors/animation/keyframing.c
===================================================================
--- trunk/blender/source/blender/editors/animation/keyframing.c	2010-04-05 11:47:55 UTC (rev 28011)
+++ trunk/blender/source/blender/editors/animation/keyframing.c	2010-04-05 12:17:33 UTC (rev 28012)
@@ -871,21 +871,27 @@
 	
 	/* will only loop once unless the array index was -1 */
 	for (; array_index < array_index_max; array_index++) {
-		/* make sure the F-Curve exists */
-		fcu= verify_fcurve(act, group, rna_path, array_index, 1);
+		/* make sure the F-Curve exists 
+		 *	- if we're replacing keyframes only, DO NOT create new F-Curves if they do not exist yet
+		 *	  but still try to get the F-Curve if it exists...
+		 */
+		fcu= verify_fcurve(act, group, rna_path, array_index, (flag & INSERTKEY_REPLACE)==0);
 		
-		/* set color mode if the F-Curve is new (i.e. without any keyframes) */
-		if ((fcu->totvert == 0) && (flag & INSERTKEY_XYZ2RGB)) {
-			/* for Loc/Rot/Scale and also Color F-Curves, the color of the F-Curve in the Graph Editor,
-			 * is determined by the array index for the F-Curve
-			 */
-			if (ELEM4(RNA_property_subtype(prop), PROP_TRANSLATION, PROP_XYZ, PROP_EULER, PROP_COLOR)) {
-				fcu->color_mode= FCURVE_COLOR_AUTO_RGB;
+		/* we may not have a F-Curve when we're replacing only... */
+		if (fcu) {
+			/* set color mode if the F-Curve is new (i.e. without any keyframes) */
+			if ((fcu->totvert == 0) && (flag & INSERTKEY_XYZ2RGB)) {
+				/* for Loc/Rot/Scale and also Color F-Curves, the color of the F-Curve in the Graph Editor,
+				 * is determined by the array index for the F-Curve
+				 */
+				if (ELEM4(RNA_property_subtype(prop), PROP_TRANSLATION, PROP_XYZ, PROP_EULER, PROP_COLOR)) {
+					fcu->color_mode= FCURVE_COLOR_AUTO_RGB;
+				}
 			}
+			
+			/* insert keyframe */
+			ret += insert_keyframe_direct(ptr, prop, fcu, cfra, flag);
 		}
-		
-		/* insert keyframe */
-		ret += insert_keyframe_direct(ptr, prop, fcu, cfra, flag);
 	}
 	
 	return ret;

Modified: trunk/blender/source/blender/editors/space_action/action_ops.c
===================================================================
--- trunk/blender/source/blender/editors/space_action/action_ops.c	2010-04-05 11:47:55 UTC (rev 28011)
+++ trunk/blender/source/blender/editors/space_action/action_ops.c	2010-04-05 12:17:33 UTC (rev 28012)
@@ -58,6 +58,7 @@
 	WM_operatortype_append(ACTION_OT_select_all_toggle);
 	WM_operatortype_append(ACTION_OT_select_border);
 	WM_operatortype_append(ACTION_OT_select_column);
+	WM_operatortype_append(ACTION_OT_select_linked);
 	WM_operatortype_append(ACTION_OT_select_more);
 	WM_operatortype_append(ACTION_OT_select_less);
 	





More information about the Bf-blender-cvs mailing list