[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [35804] trunk/blender: Bugfixes due to recent RNA renaming:

Joshua Leung aligorith at gmail.com
Sun Mar 27 00:42:52 CET 2011


Revision: 35804
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=35804
Author:   aligorith
Date:     2011-03-26 23:42:51 +0000 (Sat, 26 Mar 2011)
Log Message:
-----------
Bugfixes due to recent RNA renaming:

* 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.

Modified Paths:
--------------
    trunk/blender/release/scripts/modules/animsys_refactor.py
    trunk/blender/source/blender/editors/animation/anim_channels_edit.c

Modified: trunk/blender/release/scripts/modules/animsys_refactor.py
===================================================================
--- trunk/blender/release/scripts/modules/animsys_refactor.py	2011-03-26 20:48:09 UTC (rev 35803)
+++ trunk/blender/release/scripts/modules/animsys_refactor.py	2011-03-26 23:42:51 UTC (rev 35804)
@@ -170,6 +170,15 @@
                 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:

Modified: trunk/blender/source/blender/editors/animation/anim_channels_edit.c
===================================================================
--- trunk/blender/source/blender/editors/animation/anim_channels_edit.c	2011-03-26 20:48:09 UTC (rev 35803)
+++ trunk/blender/source/blender/editors/animation/anim_channels_edit.c	2011-03-26 23:42:51 UTC (rev 35804)
@@ -1687,7 +1687,16 @@
 	/* 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 */




More information about the Bf-blender-cvs mailing list