From 7ba59c8a623b51d14843f14388144386ecaf4bdd Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Tue, 14 Feb 2023 17:44:41 +0100 Subject: [PATCH] Assets: show all assets by default instead of current file The "current file" mode is only useful when creating new assets. However, the far more common use case and the one that should require fewer steps is to use existing assets. There is a risk that this causes freezing if the file browser preview caching does not work properly. So we'll have to keep an eye on the bug tracker to see if this is an issue in practice. Pull Request #104749 --- .../editors/asset/intern/asset_library_reference_enum.cc | 2 +- source/blender/editors/space_file/filesel.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/blender/editors/asset/intern/asset_library_reference_enum.cc b/source/blender/editors/asset/intern/asset_library_reference_enum.cc index 95cecfcc249..e94881c47da 100644 --- a/source/blender/editors/asset/intern/asset_library_reference_enum.cc +++ b/source/blender/editors/asset/intern/asset_library_reference_enum.cc @@ -57,7 +57,7 @@ AssetLibraryReference ED_asset_library_reference_from_enum_value(int value) /* Note that there is no check if the path exists here. If an invalid library path is used, the * Asset Browser can give a nice hint on what's wrong. */ if (!user_library) { - library.type = ASSET_LIBRARY_LOCAL; + library.type = ASSET_LIBRARY_ALL; library.custom_library_index = -1; } else { diff --git a/source/blender/editors/space_file/filesel.cc b/source/blender/editors/space_file/filesel.cc index 87d16320362..4d6c94e6bae 100644 --- a/source/blender/editors/space_file/filesel.cc +++ b/source/blender/editors/space_file/filesel.cc @@ -104,7 +104,7 @@ static void fileselect_ensure_updated_asset_params(SpaceFile *sfile) asset_params = sfile->asset_params = static_cast( MEM_callocN(sizeof(*asset_params), "FileAssetSelectParams")); asset_params->base_params.details_flags = U_default.file_space_data.details_flags; - asset_params->asset_library_ref.type = ASSET_LIBRARY_LOCAL; + asset_params->asset_library_ref.type = ASSET_LIBRARY_ALL; asset_params->asset_library_ref.custom_library_index = -1; asset_params->import_type = FILE_ASSET_IMPORT_APPEND_REUSE; } @@ -422,7 +422,7 @@ static void fileselect_refresh_asset_params(FileAssetSelectParams *asset_params) user_library = BKE_preferences_asset_library_find_from_index(&U, library->custom_library_index); if (!user_library) { - library->type = ASSET_LIBRARY_LOCAL; + library->type = ASSET_LIBRARY_ALL; } }