diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2014-04-23 19:59:35 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2014-04-23 20:02:48 +0400 |
commit | 210dc12b530b0a2f3d74469ec6d93514ce2682d5 (patch) | |
tree | 84ab1f928c777c9e8c5753da0c86908ba5a167b6 /source/blender/blenloader/intern | |
parent | ad6d897d98ce8c8ad31c37da7f4faafbbb11ef95 (diff) |
Fix T39847: Followup to rB6babb4d12b8b.
As suggested by Campbell, bump subversion and reset all ui_previews data (so that any file that could
have been corrupted in past two weeks because of this bug is fixed and valid again).
Diffstat (limited to 'source/blender/blenloader/intern')
-rw-r--r-- | source/blender/blenloader/intern/versioning_270.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c index a09b02eca78..507d711ce9e 100644 --- a/source/blender/blenloader/intern/versioning_270.c +++ b/source/blender/blenloader/intern/versioning_270.c @@ -46,6 +46,7 @@ #include "DNA_genfile.h" +#include "BLI_blenlib.h" #include "BLI_math.h" #include "BKE_main.h" @@ -180,6 +181,29 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main) } } + if (!MAIN_VERSION_ATLEAST(main, 270, 4)) { + /* ui_previews were not handled correctly when copying areas, leading to corrupted files (see T39847). + * This will always reset situation to a valid state. + */ + bScreen *sc; + + for (sc = main->screen.first; sc; sc = sc->id.next) { + ScrArea *sa; + for (sa = sc->areabase.first; sa; sa = sa->next) { + SpaceLink *sl; + + for (sl = sa->spacedata.first; sl; sl = sl->next) { + ARegion *ar; + ListBase *lb = (sl == sa->spacedata.first) ? &sa->regionbase : &sl->regionbase; + + for (ar = lb->first; ar; ar = ar->next) { + BLI_listbase_clear(&ar->ui_previews); + } + } + } + } + } + if (!DNA_struct_elem_find(fd->filesdna, "Material", "int", "mode2")) { /* will be replaced with version check when other new flag is added to mode2 */ Material *ma; |