diff options
author | Julian Eisel <julian@blender.org> | 2021-03-01 18:45:42 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2021-03-01 18:45:42 +0300 |
commit | bc9eac28bab696de3cbfed8c2dfddd63271edd3f (patch) | |
tree | a0aa27fe2f6669da7b2b7ce16000aad2ff9f6849 /source/blender/blenloader/intern/versioning_290.c | |
parent | 796c599194c4017b7f32970b582d249ca6413289 (diff) |
Initial AssetList API & use it to load assets for the asset view tempate
Lots of hacks and temporary code here. I wanted a first working version to find
possible pain points before getting into details.
Basic idea is to store each asset library in an `AssetList`, with a globally
accessible storage. Internally the list uses the File Browser's `FileList`
which already does a fair amount of heavy lifting (threaded file & external
asset reading, lazy loading of visible previews, ...). The File Browser could
access the global asset-list storage as well.
The asset view template uses the new asset list to load and display the assets.
Current state: {F9856940}
Open TODOs: https://developer.blender.org/maniphest/query/M6RWFxFSDor3/#R
Diffstat (limited to 'source/blender/blenloader/intern/versioning_290.c')
-rw-r--r-- | source/blender/blenloader/intern/versioning_290.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/versioning_290.c b/source/blender/blenloader/intern/versioning_290.c index 29041f4ae9d..fedc003e4ff 100644 --- a/source/blender/blenloader/intern/versioning_290.c +++ b/source/blender/blenloader/intern/versioning_290.c @@ -1755,4 +1755,21 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain) /* Keep this block, even when empty. */ } + + { + if (!DNA_struct_elem_find( + fd->filesdna, "View3D", "AssetLibraryReference", "active_asset_library")) { + LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) { + LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) { + LISTBASE_FOREACH (SpaceLink *, space, &area->spacedata) { + if (space->spacetype == SPACE_VIEW3D) { + View3D *v3d = (View3D *)space; + v3d->active_asset_library.type = ASSET_LIBRARY_LOCAL; + v3d->active_asset_library.custom_library_index = -1; + } + } + } + } + } + } } |