Revision: 25392
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=25392
Author:   aligorith
Date:     2009-12-15 01:10:03 +0100 (Tue, 15 Dec 2009)

Log Message:
-----------
Bugfix #20384: target data path of driving not correct when loading old rig 
from 2.49b

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/fcurve.c

Modified: trunk/blender/source/blender/blenkernel/intern/fcurve.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/fcurve.c     2009-12-14 
23:35:13 UTC (rev 25391)
+++ trunk/blender/source/blender/blenkernel/intern/fcurve.c     2009-12-15 
00:10:03 UTC (rev 25392)
@@ -828,6 +828,10 @@
        
        /* get property to read from, and get value as appropriate */
        if (RNA_path_resolve_full(&id_ptr, path, &ptr, &prop, &index)) {
+               /* for now, if there is no valid index, fall back to the 
array-index specified separately */
+               if (index == -1)
+                       index= dtar->array_index;
+               
                switch (RNA_property_type(prop)) {
                        case PROP_BOOLEAN:
                                if (RNA_property_array_length(&ptr, prop))
@@ -927,19 +931,19 @@
                                /* more than one target, so average the values 
of the targets */
                                int tot = 0;
                                float value = 0.0f;
-
+                               
                                /* loop through targets, adding (hopefully we 
don't get any overflow!) */
                                for (dtar= driver->targets.first; dtar; 
dtar=dtar->next) {
                                        value += 
driver_get_target_value(driver, dtar);
                                        tot++;
                                }
-
+                               
                                /* return the average of these */
-                               if(driver->type == DRIVER_TYPE_AVERAGE)
+                               if (driver->type == DRIVER_TYPE_AVERAGE)
                                        return (value / (float)tot);
                                else
                                        return value;
-
+                               
                        }
                }
                        break;


_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to