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
This commit is contained in:
parent
6243972319
commit
64a3a11e19
Notes:
blender-bot
2023-02-14 09:19:09 +01:00
Referenced by issue #98055, Asset Library Filters do not work in Source Files
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue