diff options
author | Joshua Leung <aligorith@gmail.com> | 2012-07-23 16:10:02 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2012-07-23 16:10:02 +0400 |
commit | e92fea3efbd33d446b74bfa6d38c20f77387547c (patch) | |
tree | e789c127059d38719b31d84c2671f11079124b9d /source/blender/blenloader | |
parent | 02b9ba16bcdd757d3fe98ebcd13dce37869fcf55 (diff) |
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.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 35b1b84bba6..ffc62135607 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -1913,14 +1913,25 @@ static void direct_link_fcurves(FileData *fd, ListBase *list) /* 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) { |