[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [49135] trunk/blender/source/blender/ blenloader/intern/readfile.c: Bugfix [#32155] Driver error saves in file and isnt reset on load

Joshua Leung aligorith at gmail.com
Mon Jul 23 14:10:05 CEST 2012


Revision: 49135
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49135
Author:   aligorith
Date:     2012-07-23 12:10:02 +0000 (Mon, 23 Jul 2012)
Log Message:
-----------
Bugfix [#32155] Driver error saves in file and isnt reset on load

Error flags set on Drivers and F-Curves when they can't be evaluated or flushed
properly are now cleared when loading files, allowing drivers to be re-evaluated
when a file is reloaded. This means that if a driver couldn't be used in the
previous session due to the set of extension modules active at the time (and was
thus disabled), reloading the file with the necessary extensions loaded means
that the driver can work out of the box without manually re-enabling.

Modified Paths:
--------------
    trunk/blender/source/blender/blenloader/intern/readfile.c

Modified: trunk/blender/source/blender/blenloader/intern/readfile.c
===================================================================
--- trunk/blender/source/blender/blenloader/intern/readfile.c	2012-07-23 09:20:11 UTC (rev 49134)
+++ trunk/blender/source/blender/blenloader/intern/readfile.c	2012-07-23 12:10:02 UTC (rev 49135)
@@ -1913,14 +1913,25 @@
 		/* group */
 		fcu->grp = newdataadr(fd, fcu->grp);
 		
+		/* clear disabled flag - allows disabled drivers to be tried again ([#32155]),
+		 * but also means that another method for "reviving disabled F-Curves" exists
+		 */
+		fcu->flag &= ~FCURVE_DISABLED;
+		
 		/* driver */
 		fcu->driver= newdataadr(fd, fcu->driver);
 		if (fcu->driver) {
 			ChannelDriver *driver= fcu->driver;
 			DriverVar *dvar;
 			
+			/* compiled expression data will need to be regenerated (old pointer may still be set here) */
 			driver->expr_comp = NULL;
 			
+			/* give the driver a fresh chance - the operating environment may be different now 
+			 * (addons, etc. may be different) so the driver namespace may be sane now [#32155]
+			 */
+			driver->flag &= ~DRIVER_FLAG_INVALID;
+			
 			/* relink variables, targets and their paths */
 			link_list(fd, &driver->variables);
 			for (dvar= driver->variables.first; dvar; dvar= dvar->next) {




More information about the Bf-blender-cvs mailing list