diff options
author | Bastien Montagne <bastien@blender.org> | 2021-02-27 15:10:27 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2021-02-27 15:12:07 +0300 |
commit | aad2f1510a80313a2272d131327442dc50152cbd (patch) | |
tree | a2546c46cc867e9b2b68b141b3c5f7803c6ef0f1 /source | |
parent | 28f0a4b27e5b98e9060c3c86062b4155d70d94f3 (diff) |
Fix T86028: Crash when loading file with missing libraries.
Regression from rB53d13b6f5387c68.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index dd855ebae0b..c0293c1f8f2 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -5242,7 +5242,7 @@ static int has_linked_ids_to_read(Main *mainvar) } static void read_library_linked_id( - ReportList *reports, FileData *fd, Main *mainvar, ID *id, ID **r_id) + FileData *basefd, FileData *fd, Main *mainvar, ID *id, ID **r_id) { BHead *bhead = NULL; const bool is_valid = BKE_idtype_idcode_is_linkable(GS(id->name)) || @@ -5253,7 +5253,7 @@ static void read_library_linked_id( } if (!is_valid) { - BLO_reportf_wrap(reports, + BLO_reportf_wrap(basefd->reports, RPT_ERROR, TIP_("LIB: %s: '%s' is directly linked from '%s' (parent '%s'), but is a " "non-linkable data type"), @@ -5272,14 +5272,14 @@ static void read_library_linked_id( read_libblock(fd, mainvar, bhead, id->tag, false, r_id); } else { - BLO_reportf_wrap(reports, + BLO_reportf_wrap(basefd->reports, RPT_INFO, TIP_("LIB: %s: '%s' missing from '%s', parent '%s'"), BKE_idtype_idcode_to_name(GS(id->name)), id->name + 2, mainvar->curlib->filepath_abs, library_parent_filepath(mainvar->curlib)); - fd->library_id_missing_count++; + basefd->library_id_missing_count++; /* Generate a placeholder for this ID (simplified version of read_libblock actually...). */ if (r_id) { @@ -5313,7 +5313,7 @@ static void read_library_linked_ids(FileData *basefd, * we go back to a single linked data when loading the file. */ ID **realid = NULL; if (!BLI_ghash_ensure_p(loaded_ids, id->name, (void ***)&realid)) { - read_library_linked_id(basefd->reports, fd, mainvar, id, realid); + read_library_linked_id(basefd, fd, mainvar, id, realid); } /* realid shall never be NULL - unless some source file/lib is broken @@ -5434,7 +5434,7 @@ static FileData *read_library_file_data(FileData *basefd, if (fd == NULL) { BLO_reportf_wrap( basefd->reports, RPT_INFO, TIP_("Cannot find lib '%s'"), mainptr->curlib->filepath_abs); - fd->library_file_missing_count++; + basefd->library_file_missing_count++; } return fd; @@ -5483,9 +5483,6 @@ static void read_libraries(FileData *basefd, ListBase *mainlist) /* Test if linked data-locks need to read further linked data-locks * and create link placeholders for them. */ BLO_expand_main(fd, mainptr); - - basefd->library_file_missing_count += fd->library_file_missing_count; - basefd->library_id_missing_count += fd->library_id_missing_count; } } } |