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).
This commit is contained in:
parent
ad6d897d98
commit
210dc12b53
Notes:
blender-bot
2023-02-14 10:46:06 +01:00
Referenced by issue #39847, Crash on undo or reopening a file
|
@ -42,7 +42,7 @@ extern "C" {
|
|||
* and keep comment above the defines.
|
||||
* Use STRINGIFY() rather than defining with quotes */
|
||||
#define BLENDER_VERSION 270
|
||||
#define BLENDER_SUBVERSION 3
|
||||
#define BLENDER_SUBVERSION 4
|
||||
/* 262 was the last editmesh release but it has compatibility code for bmesh data */
|
||||
#define BLENDER_MINVERSION 262
|
||||
#define BLENDER_MINSUBVERSION 0
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue