Page MenuHome

File Browser "Blend File" recursion level broken (regression)
Closed, ResolvedPublic

Description

Likely caused by rBfc7beac8d6f4.

Short description of error
The "Blend File" recursion level in the File Browser doesn't work at all anymore.

Exact steps for others to reproduce the error

  • FileLink
  • Navigate to some directory with .blend files
  • In the display settings popup, set Recursions to Blend File
  • The data-blocks of the .blend files will not be shown, in older versions they do show up.

This patch fixes the issue:

1diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c
2index 60fe5364aba..181369ed657 100644
3--- a/source/blender/editors/space_file/filelist.c
4+++ b/source/blender/editors/space_file/filelist.c
5@@ -3219,6 +3219,7 @@ typedef struct FileListReadJob {
6 } FileListReadJob;
7
8 static bool filelist_readjob_should_recurse_into_entry(const int max_recursion,
9+ const bool is_lib,
10 const int current_recursion_level,
11 FileListInternEntry *entry)
12 {
13@@ -3226,10 +3227,14 @@ static bool filelist_readjob_should_recurse_into_entry(const int max_recursion,
14 /* Recursive loading is disabled. */
15 return false;
16 }
17- if (current_recursion_level >= max_recursion) {
18+ if (!is_lib && current_recursion_level > max_recursion) {
19 /* No more levels of recursion left. */
20 return false;
21 }
22+ if (!is_lib && (current_recursion_level >= max_recursion) &&
23+ ((entry->typeflag & (FILE_TYPE_BLENDER | FILE_TYPE_BLENDER_BACKUP)) == 0)) {
24+ return false;
25+ }
26 if (entry->typeflag & FILE_TYPE_BLENDERLIB) {
27 /* Libraries are already loaded recursively when recursive loaded is used. No need to add
28 * them another time. This loading is done with the `LIST_LIB_RECURSIVE` option. */
29@@ -3345,7 +3350,8 @@ static void filelist_readjob_do(const bool do_lib,
30 entry->name = fileentry_uiname(root, entry->relpath, entry->typeflag, dir);
31 entry->free_name = true;
32
33- if (filelist_readjob_should_recurse_into_entry(max_recursion, recursion_level, entry)) {
34+ if (filelist_readjob_should_recurse_into_entry(
35+ max_recursion, is_lib, recursion_level, entry)) {
36 /* We have a directory we want to list, add it to todo list! */
37 BLI_join_dirfile(dir, sizeof(dir), root, entry->relpath);
38 BLI_path_normalize_dir(job_params->main_name, dir);

But it brings back some confusing logic that I'd prefer to have refactored a bit. So letting @Jeroen Bakker (jbakker) take this over.