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:
authorSonny Campbell <SonnyCampbell_Unity>2022-06-27 17:07:36 +0300
committerJulian Eisel <julian@blender.org>2022-06-27 17:09:38 +0300
commit64a3a11e1926f047cac0a30cad502ea9e648e763 (patch)
treea77295cdb8b28cc088ede1be50c7d9fae609cde4 /source/blender/editors/space_file
parent6243972319289d86c70ce9946d10909e7eddfdaf (diff)
Fix T98055: Library Filters do not work in Source Files
The fix is to ensure the filter for id type is run when displaying assets from an Asset Library. In the current implementation the id_type filter does not run if a blend file is opened that also happens to be in an Asset Library directory. If we have opened a blend file that is in an Asset Library directory, we now use the same filtering check as for the "Current File" asset library. Differential Revision: https://developer.blender.org/D15284 Reviewed by: Julian Eisel
Diffstat (limited to 'source/blender/editors/space_file')
-rw-r--r--source/blender/editors/space_file/filelist.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c
index 183af0c14f5..24e1faaf4c9 100644
--- a/source/blender/editors/space_file/filelist.c
+++ b/source/blender/editors/space_file/filelist.c
@@ -485,6 +485,7 @@ static int groupname_to_code(const char *group);
static uint64_t groupname_to_filter_id(const char *group);
static void filelist_cache_clear(FileListEntryCache *cache, size_t new_size);
+static bool filelist_intern_entry_is_main_file(const FileListInternEntry *intern_entry);
/* ********** Sort helpers ********** */
@@ -1025,13 +1026,6 @@ static bool is_filtered_lib(FileListInternEntry *file, const char *root, FileLis
return is_filtered_lib_type(file, root, filter) && is_filtered_file_relpath(file, filter);
}
-static bool is_filtered_asset_library(FileListInternEntry *file,
- const char *root,
- FileListFilter *filter)
-{
- return is_filtered_lib_type(file, root, filter) && is_filtered_asset(file, filter);
-}
-
static bool is_filtered_main(FileListInternEntry *file,
const char *UNUSED(dir),
FileListFilter *filter)
@@ -1048,6 +1042,17 @@ static bool is_filtered_main_assets(FileListInternEntry *file,
is_filtered_asset(file, filter);
}
+static bool is_filtered_asset_library(FileListInternEntry *file,
+ const char *root,
+ FileListFilter *filter)
+{
+ if (filelist_intern_entry_is_main_file(file)) {
+ return is_filtered_main_assets(file, root, filter);
+ }
+
+ return is_filtered_lib_type(file, root, filter) && is_filtered_asset(file, filter);
+}
+
void filelist_tag_needs_filtering(FileList *filelist)
{
filelist->flags |= FL_NEED_FILTERING;