diff options
author | Julian Eisel <julian@blender.org> | 2021-03-16 15:06:50 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2021-03-16 15:06:50 +0300 |
commit | 0e071e015e76b723dd3ae573ec9aef70ad059902 (patch) | |
tree | 5aeacfff7b4d15776a4a4641e81fd33477697596 /source/blender/blenloader/intern/versioning_290.c | |
parent | 2fad30ba1e4c6691998babff5c0c038b7e808c41 (diff) |
Store active asset library at workspace level
The Asset Browser still has its own active asset library. But for the UI
(e.g. the asset view UI template), there is one active asset library per
workspace now. This is needed because for technical reasons the property
has to be registered in C, ideally you could just register it as custom
property for any use-case and pass that to the asset view template.
Since this isn't possible, an active asset library per workspace seems
reasonable.
Diffstat (limited to 'source/blender/blenloader/intern/versioning_290.c')
-rw-r--r-- | source/blender/blenloader/intern/versioning_290.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/source/blender/blenloader/intern/versioning_290.c b/source/blender/blenloader/intern/versioning_290.c index 9eb6206396d..5f6fe262a8c 100644 --- a/source/blender/blenloader/intern/versioning_290.c +++ b/source/blender/blenloader/intern/versioning_290.c @@ -51,6 +51,7 @@ #include "BKE_animsys.h" #include "BKE_armature.h" +#include "BKE_asset.h" #include "BKE_collection.h" #include "BKE_colortools.h" #include "BKE_cryptomatte.h" @@ -1873,17 +1874,9 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain) { 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; - } - } - } + fd->filesdna, "WorkSpace", "AssetLibraryReference", "active_asset_library")) { + LISTBASE_FOREACH (WorkSpace *, workspace, &bmain->workspaces) { + BKE_asset_library_reference_init_default(&workspace->active_asset_library); } } } |