diff --git a/source/blender/blenkernel/BKE_blender_version.h b/source/blender/blenkernel/BKE_blender_version.h index 593d5176a2f..12fbb689fbf 100644 --- a/source/blender/blenkernel/BKE_blender_version.h +++ b/source/blender/blenkernel/BKE_blender_version.h @@ -29,7 +29,7 @@ extern "C" { /* Blender file format version. */ #define BLENDER_FILE_VERSION BLENDER_VERSION -#define BLENDER_FILE_SUBVERSION 27 +#define BLENDER_FILE_SUBVERSION 28 /* Minimum Blender version that supports reading file written with the current * version. Older Blender versions will test this and cancel loading the file, showing a warning to diff --git a/source/blender/blenloader/intern/versioning_400.cc b/source/blender/blenloader/intern/versioning_400.cc index 22ac8cb1ed4..e7b74cad782 100644 --- a/source/blender/blenloader/intern/versioning_400.cc +++ b/source/blender/blenloader/intern/versioning_400.cc @@ -1521,6 +1521,31 @@ void blo_do_versions_400(FileData *fd, Library * /*lib*/, Main *bmain) } } + if (!MAIN_VERSION_FILE_ATLEAST(bmain, 400, 28)) { + LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) { + LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) { + LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) { + const ListBase *regionbase = (sl == area->spacedata.first) ? &area->regionbase : + &sl->regionbase; + LISTBASE_FOREACH (ARegion *, region, regionbase) { + if (region->regiontype != RGN_TYPE_ASSET_SHELF) { + continue; + } + + RegionAssetShelf *shelf_data = static_cast(region->regiondata); + if (shelf_data && shelf_data->active_shelf) { + AssetShelfSettings &settings = shelf_data->active_shelf->settings; + settings.asset_library_reference.custom_library_index = -1; + settings.asset_library_reference.type = ASSET_LIBRARY_ALL; + } + + region->flag |= RGN_FLAG_HIDDEN; + } + } + } + } + } + /** * Versioning code until next subversion bump goes here. * @@ -1533,31 +1558,5 @@ void blo_do_versions_400(FileData *fd, Library * /*lib*/, Main *bmain) */ { /* Keep this block, even when empty. */ - if (!DNA_struct_member_exists(fd->filesdna, - "AssetShelfSettings", - "AssetLibraryReference", - "asset_library_reference")) - { - LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) { - LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) { - LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) { - const ListBase *regionbase = (sl == area->spacedata.first) ? &area->regionbase : - &sl->regionbase; - LISTBASE_FOREACH (ARegion *, region, regionbase) { - if (region->regiontype != RGN_TYPE_ASSET_SHELF) { - continue; - } - - RegionAssetShelf *shelf_data = static_cast(region->regiondata); - if (shelf_data && shelf_data->active_shelf) { - AssetShelfSettings &settings = shelf_data->active_shelf->settings; - settings.asset_library_reference.custom_library_index = -1; - settings.asset_library_reference.type = ASSET_LIBRARY_ALL; - } - } - } - } - } - } } }