Bugfixes due to recent RNA renaming:
authorJoshua Leung <aligorith@gmail.com>
Sat, 26 Mar 2011 23:42:51 +0000 (23:42 +0000)
committerJoshua Leung <aligorith@gmail.com>
Sat, 26 Mar 2011 23:42:51 +0000 (23:42 +0000)
* Driver F-Curves were not getting fixed by the "FCurve/Driver Version
Fix" tool. This was causing problems such as shapekey drivers from
older (2.56 compatible rigs) failing to run. As well as renaming the
paths for these Driver F-Curves, the "disabled" flags also get cleared
from these drivers so that they can be run again

* "Revive Disabled F-Curves"  operator in Animation Editors can now be
used to revive disabled drivers too.

release/scripts/modules/animsys_refactor.py
source/blender/editors/animation/anim_channels_edit.c

index 464df870e87d6b4219a5adc75e6a31acbbeed6ae..7a83a1434c5c045f0d10bc40a04c3e33fb935683 100644 (file)
@@ -170,6 +170,15 @@ def update_data_paths(rna_update):
                 continue
 
             for fcurve in anim_data.drivers:
+                data_path = fcurve.data_path
+                data_path_new = find_path_new(anim_data_base, data_path, rna_update_dict, rna_update_from_map)
+                # print(data_path_new)
+                if data_path_new != data_path:
+                    if not IS_TESTING:
+                        fcurve.data_path = data_path_new
+                        fcurve.driver.is_valid = True; # reset to allow this to work again
+                    print("driver-fcurve (%s): %s -> %s" % (id_data.name, data_path, data_path_new))
+
                 for var in fcurve.driver.variables:
                     if var.type == 'SINGLE_PROP':
                         for tar in var.targets:
index ad88ece115495e31e0f6a8e99f06d01eb984f0b9..0845014c99e2c0afa625e0757336c2235004f142 100644 (file)
@@ -1687,7 +1687,16 @@ static int animchannels_enable_exec (bContext *C, wmOperator *UNUSED(op))
        /* loop through filtered data and clean curves */
        for (ale= anim_data.first; ale; ale= ale->next) {
                FCurve *fcu = (FCurve *)ale->data;
+               
+               /* remove disabled flags from F-Curves */
                fcu->flag &= ~FCURVE_DISABLED;
+               
+               /* for drivers, let's do the same too */
+               if (fcu->driver)
+                       fcu->driver->flag &= ~DRIVER_FLAG_INVALID;
+                       
+               /* tag everything for updates - in particular, this is needed to get drivers working again */
+               ANIM_list_elem_update(ac.scene, ale);
        }
        
        /* free temp data */