Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2009-11-19 03:37:47 +0300
committerJoshua Leung <aligorith@gmail.com>2009-11-19 03:37:47 +0300
commitabe6b4c0c48093bbe4d3d0b769b2e73816b283f9 (patch)
tree0bec7dfe06c9ff7ee74b4bda68df4b7c557808b8 /source/blender/editors/animation/drivers.c
parent5ed3081e5cbf04a3b0e428a2e65c6d9d019ad275 (diff)
Bugfix:
Adding drivers to single values was broken.
Diffstat (limited to 'source/blender/editors/animation/drivers.c')
-rw-r--r--source/blender/editors/animation/drivers.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c
index 0c2fa0878be..a91e67ffc91 100644
--- a/source/blender/editors/animation/drivers.c
+++ b/source/blender/editors/animation/drivers.c
@@ -147,7 +147,7 @@ short ANIM_add_driver (ID *id, const char rna_path[], int array_index, short fla
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,9 +159,15 @@ short ANIM_add_driver (ID *id, const char rna_path[], int array_index, short fla
/* key entire array convenience method */
if (array_index == -1) {
- array_index= 0;
array_index_max= RNA_property_array_length(&ptr, prop);
+ array_index= 0;
}
+ 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++) {