[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [24665] trunk/blender/source/blender/ editors/animation/drivers.c: Bugfix:

Joshua Leung aligorith at gmail.com
Thu Nov 19 01:37:47 CET 2009


Revision: 24665
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=24665
Author:   aligorith
Date:     2009-11-19 01:37:47 +0100 (Thu, 19 Nov 2009)

Log Message:
-----------
Bugfix:

Adding drivers to single values was broken.

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

Modified: trunk/blender/source/blender/editors/animation/drivers.c
===================================================================
--- trunk/blender/source/blender/editors/animation/drivers.c	2009-11-18 22:02:02 UTC (rev 24664)
+++ trunk/blender/source/blender/editors/animation/drivers.c	2009-11-19 00:37:47 UTC (rev 24665)
@@ -147,7 +147,7 @@
 	PointerRNA id_ptr, ptr;
 	PropertyRNA *prop;
 	FCurve *fcu;
-	int array_index_max = array_index+1;
+	int array_index_max;
 	int done = 0;
 	
 	/* validate pointer first - exit if failure */
@@ -159,10 +159,16 @@
 	
 	/* key entire array convenience method */
 	if (array_index == -1) {
+		array_index_max= RNA_property_array_length(&ptr, prop);
 		array_index= 0;
-		array_index_max= RNA_property_array_length(&ptr, prop);
 	}
+	else
+		array_index_max= array_index;
 	
+	/* maximum index should be greater than the start index */
+	if (array_index == array_index_max)
+		array_index_max += 1;
+	
 	/* will only loop once unless the array index was -1 */
 	for (; array_index < array_index_max; array_index++) {
 		/* create F-Curve with Driver */





More information about the Bf-blender-cvs mailing list