Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Eisel <julian@blender.org>2021-07-21 20:22:44 +0300
committerJulian Eisel <julian@blender.org>2021-07-21 20:35:39 +0300
commit10e28bd27017664064b1fb93f1ed347d6b404ae6 (patch)
tree32408fee2bad70af7eeb66f3f189cef8ae7612ee /source/blender/blenloader/intern
parent8de2b6a02020ad0bc4e4ad7868988a37251e3f88 (diff)
Assets: Replace duplicated asset library reference type from DNA
Since recently it's possible to access assets from outside the File/Asset Browser, via the asset view template. So we are slowly moving away from file space specific code to dedicated asset system code. I introduced `AssetLibraryReference` as a duplicate of `FileSelectAssetLibraryUID`, with a plan to delete the latter in a separate cleanup commit. That's exactly what this commit is. This will cause Asset Browsers to open with the default "Current File" Asset Library. We could avoid that, but it's a minor issue really.
Diffstat (limited to 'source/blender/blenloader/intern')
-rw-r--r--source/blender/blenloader/intern/versioning_300.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/versioning_300.c b/source/blender/blenloader/intern/versioning_300.c
index 2bb64717615..bc73dbac589 100644
--- a/source/blender/blenloader/intern/versioning_300.c
+++ b/source/blender/blenloader/intern/versioning_300.c
@@ -580,5 +580,22 @@ void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain)
BKE_asset_library_reference_init_default(&workspace->asset_library);
}
}
+
+ if (!DNA_struct_elem_find(
+ fd->filesdna, "FileAssetSelectParams", "AssetLibraryReference", "asset_library")) {
+ LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
+ LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
+ LISTBASE_FOREACH (SpaceLink *, space, &area->spacedata) {
+ if (space->spacetype == SPACE_FILE) {
+ SpaceFile *sfile = (SpaceFile *)space;
+ if (sfile->browse_mode != FILE_BROWSE_MODE_ASSETS) {
+ continue;
+ }
+ BKE_asset_library_reference_init_default(&sfile->asset_params->asset_library);
+ }
+ }
+ }
+ }
+ }
}
}