[Bf-blender-cvs] [4ac4547cd15] cycles_oneapi: Fix T98055: Library Filters do not work in Source Files

Sonny Campbell noreply at git.blender.org
Wed Jun 29 10:38:36 CEST 2022


Commit: 4ac4547cd158f4649ec361ae5f257b4b24f6829c
Author: Sonny Campbell
Date:   Mon Jun 27 16:07:36 2022 +0200
Branches: cycles_oneapi
https://developer.blender.org/rB4ac4547cd158f4649ec361ae5f257b4b24f6829c

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

===================================================================

M	source/blender/editors/space_file/filelist.c

===================================================================

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;



More information about the Bf-blender-cvs mailing list