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:
authorBastien Montagne <bastien@blender.org>2021-06-23 10:51:11 +0300
committerBastien Montagne <bastien@blender.org>2021-06-23 11:37:00 +0300
commit82c17082ba0e53d782ac6be703d71d188a331dde (patch)
tree3bdb6f1a86bc8bf506d28046ada40b7f881dba86 /source/blender/blenloader
parent071799d4fc44f422abacbdad09bb45fb95de89f2 (diff)
Revert "Revert "Enhanced stats/reports for blendfile reading.""
This reverts commit rB3a48147b8ab92, and fixes the issues with linking etc. Change compared to previous buggy commit (rBf8d219dfd4c31) is that new `BlendFileReadReports` reports are now passed to the lowest level function generating the `FileData` (`filedata_new()`), which ensures (and asserts) that all code using it does have a valid non-NULL pointer to a `BlendFileReadReport` data. Sorry for the noise, it's always when you think a change is trivial and do not test it well enough that you end up doing those kind of mistakes...
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/BLO_read_write.h11
-rw-r--r--source/blender/blenloader/BLO_readfile.h33
-rw-r--r--source/blender/blenloader/intern/blend_validate.c3
-rw-r--r--source/blender/blenloader/intern/readblenentry.c14
-rw-r--r--source/blender/blenloader/intern/readfile.c80
-rw-r--r--source/blender/blenloader/intern/readfile.h14
-rw-r--r--source/blender/blenloader/intern/readfile_tempload.c3
-rw-r--r--source/blender/blenloader/intern/versioning_280.c8
-rw-r--r--source/blender/blenloader/tests/blendfile_loading_base_test.cc3
9 files changed, 105 insertions, 64 deletions
diff --git a/source/blender/blenloader/BLO_read_write.h b/source/blender/blenloader/BLO_read_write.h
index ea0532d884b..86c7c367816 100644
--- a/source/blender/blenloader/BLO_read_write.h
+++ b/source/blender/blenloader/BLO_read_write.h
@@ -54,6 +54,7 @@ typedef struct BlendExpander BlendExpander;
typedef struct BlendLibReader BlendLibReader;
typedef struct BlendWriter BlendWriter;
+struct BlendFileReadReport;
struct Main;
struct ReportList;
@@ -216,7 +217,7 @@ bool BLO_read_requires_endian_switch(BlendDataReader *reader);
bool BLO_read_data_is_undo(BlendDataReader *reader);
void BLO_read_data_globmap_add(BlendDataReader *reader, void *oldaddr, void *newaddr);
void BLO_read_glob_list(BlendDataReader *reader, struct ListBase *list);
-struct ReportList *BLO_read_data_reports(BlendDataReader *reader);
+struct BlendFileReadReport *BLO_read_data_reports(BlendDataReader *reader);
/* Blend Read Lib API
* ===================
@@ -233,7 +234,7 @@ ID *BLO_read_get_new_id_address(BlendLibReader *reader, struct Library *lib, str
/* Misc. */
bool BLO_read_lib_is_undo(BlendLibReader *reader);
struct Main *BLO_read_lib_get_main(BlendLibReader *reader);
-struct ReportList *BLO_read_lib_reports(BlendLibReader *reader);
+struct BlendFileReadReport *BLO_read_lib_reports(BlendLibReader *reader);
/* Blend Expand API
* ===================
@@ -250,8 +251,10 @@ void BLO_expand_id(BlendExpander *expander, struct ID *id);
* ===================
*/
-void BLO_reportf_wrap(struct ReportList *reports, ReportType type, const char *format, ...)
- ATTR_PRINTF_FORMAT(3, 4);
+void BLO_reportf_wrap(struct BlendFileReadReport *reports,
+ ReportType type,
+ const char *format,
+ ...) ATTR_PRINTF_FORMAT(3, 4);
#ifdef __cplusplus
}
diff --git a/source/blender/blenloader/BLO_readfile.h b/source/blender/blenloader/BLO_readfile.h
index 89db216aada..307c09f8ff5 100644
--- a/source/blender/blenloader/BLO_readfile.h
+++ b/source/blender/blenloader/BLO_readfile.h
@@ -89,6 +89,35 @@ struct BlendFileReadParams {
int undo_direction; /* eUndoStepDir */
};
+typedef struct BlendFileReadReport {
+ /* General reports handling. */
+ struct ReportList *reports;
+
+ /* Timing informations .*/
+ struct {
+ double whole;
+ double libraries;
+ double lib_overrides;
+ double lib_overrides_resync;
+ double lib_overrides_recursive_resync;
+ } duration;
+
+ /* Count informations. */
+ struct {
+ /* Some numbers of IDs that ended up in a specific state, or required some specific process
+ * during this file read. */
+ int missing_libraries;
+ int missing_linked_id;
+ /* Number of root override IDs that were resynced. */
+ int resynced_lib_overrides;
+ } count;
+
+ /* Number of libraries which had overrides that needed to be resynced, and a single linked list
+ * of those. */
+ int resynced_lib_overrides_libraries_count;
+ struct LinkNode *resynced_lib_overrides_libraries;
+} BlendFileReadReport;
+
/* skip reading some data-block types (may want to skip screen data too). */
typedef enum eBLOReadSkip {
BLO_READ_SKIP_NONE = 0,
@@ -101,7 +130,7 @@ typedef enum eBLOReadSkip {
BlendFileData *BLO_read_from_file(const char *filepath,
eBLOReadSkip skip_flags,
- struct ReportList *reports);
+ struct BlendFileReadReport *reports);
BlendFileData *BLO_read_from_memory(const void *mem,
int memsize,
eBLOReadSkip skip_flags,
@@ -125,7 +154,7 @@ struct BLODataBlockInfo {
struct AssetMetaData *asset_data;
};
-BlendHandle *BLO_blendhandle_from_file(const char *filepath, struct ReportList *reports);
+BlendHandle *BLO_blendhandle_from_file(const char *filepath, struct BlendFileReadReport *reports);
BlendHandle *BLO_blendhandle_from_memory(const void *mem, int memsize);
struct LinkNode *BLO_blendhandle_get_datablock_names(BlendHandle *bh,
diff --git a/source/blender/blenloader/intern/blend_validate.c b/source/blender/blenloader/intern/blend_validate.c
index f3fc1453461..0f729304128 100644
--- a/source/blender/blenloader/intern/blend_validate.c
+++ b/source/blender/blenloader/intern/blend_validate.c
@@ -83,7 +83,8 @@ bool BLO_main_validate_libraries(Main *bmain, ReportList *reports)
}
BKE_library_filepath_set(bmain, curlib, curlib->filepath);
- BlendHandle *bh = BLO_blendhandle_from_file(curlib->filepath_abs, reports);
+ BlendHandle *bh = BLO_blendhandle_from_file(curlib->filepath_abs,
+ &(BlendFileReadReport){.reports = reports});
if (bh == NULL) {
BKE_reportf(reports,
diff --git a/source/blender/blenloader/intern/readblenentry.c b/source/blender/blenloader/intern/readblenentry.c
index 19033ba9bf1..1a324d56f06 100644
--- a/source/blender/blenloader/intern/readblenentry.c
+++ b/source/blender/blenloader/intern/readblenentry.c
@@ -68,7 +68,7 @@ void BLO_blendhandle_print_sizes(BlendHandle *bh, void *fp);
* \param reports: Report errors in opening the file (can be NULL).
* \return A handle on success, or NULL on failure.
*/
-BlendHandle *BLO_blendhandle_from_file(const char *filepath, ReportList *reports)
+BlendHandle *BLO_blendhandle_from_file(const char *filepath, BlendFileReadReport *reports)
{
BlendHandle *bh;
@@ -88,7 +88,8 @@ BlendHandle *BLO_blendhandle_from_memory(const void *mem, int memsize)
{
BlendHandle *bh;
- bh = (BlendHandle *)blo_filedata_from_memory(mem, memsize, NULL);
+ bh = (BlendHandle *)blo_filedata_from_memory(
+ mem, memsize, &(BlendFileReadReport){.reports = NULL});
return bh;
}
@@ -366,14 +367,13 @@ void BLO_blendhandle_close(BlendHandle *bh)
*/
BlendFileData *BLO_read_from_file(const char *filepath,
eBLOReadSkip skip_flags,
- ReportList *reports)
+ BlendFileReadReport *reports)
{
BlendFileData *bfd = NULL;
FileData *fd;
fd = blo_filedata_from_file(filepath, reports);
if (fd) {
- fd->reports = reports;
fd->skip_flags = skip_flags;
bfd = blo_read_file_internal(fd, filepath);
blo_filedata_free(fd);
@@ -399,9 +399,8 @@ BlendFileData *BLO_read_from_memory(const void *mem,
BlendFileData *bfd = NULL;
FileData *fd;
- fd = blo_filedata_from_memory(mem, memsize, reports);
+ fd = blo_filedata_from_memory(mem, memsize, &(BlendFileReadReport){.reports = reports});
if (fd) {
- fd->reports = reports;
fd->skip_flags = skip_flags;
bfd = blo_read_file_internal(fd, "");
blo_filedata_free(fd);
@@ -428,9 +427,8 @@ BlendFileData *BLO_read_from_memfile(Main *oldmain,
FileData *fd;
ListBase old_mainlist;
- fd = blo_filedata_from_memfile(memfile, params, reports);
+ fd = blo_filedata_from_memfile(memfile, params, &(BlendFileReadReport){.reports = reports});
if (fd) {
- fd->reports = reports;
fd->skip_flags = params->skip_flags;
BLI_strncpy(fd->relabase, filename, sizeof(fd->relabase));
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index dab630d451c..9a3da412524 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -72,6 +72,8 @@
#include "BLI_mmap.h"
#include "BLI_threads.h"
+#include "PIL_time.h"
+
#include "BLT_translation.h"
#include "BKE_anim_data.h"
@@ -227,7 +229,7 @@ typedef struct BHeadN {
* bit kludge but better than doubling up on prints,
* we could alternatively have a versions of a report function which forces printing - campbell
*/
-void BLO_reportf_wrap(ReportList *reports, ReportType type, const char *format, ...)
+void BLO_reportf_wrap(BlendFileReadReport *reports, ReportType type, const char *format, ...)
{
char fixed_buf[1024]; /* should be long enough */
@@ -239,7 +241,7 @@ void BLO_reportf_wrap(ReportList *reports, ReportType type, const char *format,
fixed_buf[sizeof(fixed_buf) - 1] = '\0';
- BKE_report(reports, type, fixed_buf);
+ BKE_report(reports->reports, type, fixed_buf);
if (G.background == 0) {
printf("%s: %s\n", BKE_report_type_str(type), fixed_buf);
@@ -1331,8 +1333,10 @@ static ssize_t fd_read_from_memfile(FileData *filedata,
return 0;
}
-static FileData *filedata_new(void)
+static FileData *filedata_new(BlendFileReadReport *reports)
{
+ BLI_assert(reports != NULL);
+
FileData *fd = MEM_callocN(sizeof(FileData), "FileData");
fd->filedes = -1;
@@ -1344,6 +1348,8 @@ static FileData *filedata_new(void)
fd->globmap = oldnewmap_new();
fd->libmap = oldnewmap_new();
+ fd->reports = reports;
+
return fd;
}
@@ -1371,7 +1377,7 @@ static FileData *blo_decode_and_check(FileData *fd, ReportList *reports)
}
static FileData *blo_filedata_from_file_descriptor(const char *filepath,
- ReportList *reports,
+ BlendFileReadReport *reports,
int file)
{
FileDataReadFn *read_fn = NULL;
@@ -1386,7 +1392,7 @@ static FileData *blo_filedata_from_file_descriptor(const char *filepath,
/* Regular file. */
errno = 0;
if (read(file, header, sizeof(header)) != sizeof(header)) {
- BKE_reportf(reports,
+ BKE_reportf(reports->reports,
RPT_WARNING,
"Unable to read '%s': %s",
filepath,
@@ -1416,7 +1422,7 @@ static FileData *blo_filedata_from_file_descriptor(const char *filepath,
(header[0] == 0x1f && header[1] == 0x8b)) {
gzfile = BLI_gzopen(filepath, "rb");
if (gzfile == (gzFile)Z_NULL) {
- BKE_reportf(reports,
+ BKE_reportf(reports->reports,
RPT_WARNING,
"Unable to open '%s': %s",
filepath,
@@ -1431,11 +1437,11 @@ static FileData *blo_filedata_from_file_descriptor(const char *filepath,
}
if (read_fn == NULL) {
- BKE_reportf(reports, RPT_WARNING, "Unrecognized file format '%s'", filepath);
+ BKE_reportf(reports->reports, RPT_WARNING, "Unrecognized file format '%s'", filepath);
return NULL;
}
- FileData *fd = filedata_new();
+ FileData *fd = filedata_new(reports);
fd->filedes = file;
fd->gzfiledes = gzfile;
@@ -1448,12 +1454,12 @@ static FileData *blo_filedata_from_file_descriptor(const char *filepath,
return fd;
}
-static FileData *blo_filedata_from_file_open(const char *filepath, ReportList *reports)
+static FileData *blo_filedata_from_file_open(const char *filepath, BlendFileReadReport *reports)
{
errno = 0;
const int file = BLI_open(filepath, O_BINARY | O_RDONLY, 0);
if (file == -1) {
- BKE_reportf(reports,
+ BKE_reportf(reports->reports,
RPT_WARNING,
"Unable to open '%s': %s",
filepath,
@@ -1469,14 +1475,14 @@ static FileData *blo_filedata_from_file_open(const char *filepath, ReportList *r
/* cannot be called with relative paths anymore! */
/* on each new library added, it now checks for the current FileData and expands relativeness */
-FileData *blo_filedata_from_file(const char *filepath, ReportList *reports)
+FileData *blo_filedata_from_file(const char *filepath, BlendFileReadReport *reports)
{
FileData *fd = blo_filedata_from_file_open(filepath, reports);
if (fd != NULL) {
/* needed for library_append and read_libraries */
BLI_strncpy(fd->relabase, filepath, sizeof(fd->relabase));
- return blo_decode_and_check(fd, reports);
+ return blo_decode_and_check(fd, reports->reports);
}
return NULL;
}
@@ -1487,7 +1493,7 @@ FileData *blo_filedata_from_file(const char *filepath, ReportList *reports)
*/
static FileData *blo_filedata_from_file_minimal(const char *filepath)
{
- FileData *fd = blo_filedata_from_file_open(filepath, NULL);
+ FileData *fd = blo_filedata_from_file_open(filepath, &(BlendFileReadReport){.reports = NULL});
if (fd != NULL) {
decode_blender_header(fd);
if (fd->flags & FD_FLAGS_FILE_OK) {
@@ -1542,14 +1548,15 @@ static int fd_read_gzip_from_memory_init(FileData *fd)
return 1;
}
-FileData *blo_filedata_from_memory(const void *mem, int memsize, ReportList *reports)
+FileData *blo_filedata_from_memory(const void *mem, int memsize, BlendFileReadReport *reports)
{
if (!mem || memsize < SIZEOFBLENDERHEADER) {
- BKE_report(reports, RPT_WARNING, (mem) ? TIP_("Unable to read") : TIP_("Unable to open"));
+ BKE_report(
+ reports->reports, RPT_WARNING, (mem) ? TIP_("Unable to read") : TIP_("Unable to open"));
return NULL;
}
- FileData *fd = filedata_new();
+ FileData *fd = filedata_new(reports);
const char *cp = mem;
fd->buffer = mem;
@@ -1568,26 +1575,26 @@ FileData *blo_filedata_from_memory(const void *mem, int memsize, ReportList *rep
fd->flags |= FD_FLAGS_NOT_MY_BUFFER;
- return blo_decode_and_check(fd, reports);
+ return blo_decode_and_check(fd, reports->reports);
}
FileData *blo_filedata_from_memfile(MemFile *memfile,
const struct BlendFileReadParams *params,
- ReportList *reports)
+ BlendFileReadReport *reports)
{
if (!memfile) {
- BKE_report(reports, RPT_WARNING, "Unable to open blend <memory>");
+ BKE_report(reports->reports, RPT_WARNING, "Unable to open blend <memory>");
return NULL;
}
- FileData *fd = filedata_new();
+ FileData *fd = filedata_new(reports);
fd->memfile = memfile;
fd->undo_direction = params->undo_direction;
fd->read = fd_read_from_memfile;
fd->flags |= FD_FLAGS_NOT_MY_BUFFER;
- return blo_decode_and_check(fd, reports);
+ return blo_decode_and_check(fd, reports->reports);
}
void blo_filedata_free(FileData *fd)
@@ -4206,6 +4213,7 @@ BlendFileData *blo_read_file_internal(FileData *fd, const char *filepath)
}
if ((fd->skip_flags & BLO_READ_SKIP_DATA) == 0) {
+ fd->reports->duration.libraries = PIL_check_seconds_timer();
read_libraries(fd, &mainlist);
blo_join_main(&mainlist);
@@ -4213,6 +4221,8 @@ BlendFileData *blo_read_file_internal(FileData *fd, const char *filepath)
lib_link_all(fd, bfd->main);
after_liblink_merged_bmain_process(bfd->main);
+ fd->reports->duration.libraries = PIL_check_seconds_timer() - fd->reports->duration.libraries;
+
/* Skip in undo case. */
if (fd->memfile == NULL) {
/* Note that we can't recompute user-counts at this point in undo case, we play too much with
@@ -4228,7 +4238,7 @@ BlendFileData *blo_read_file_internal(FileData *fd, const char *filepath)
blo_split_main(&mainlist, bfd->main);
LISTBASE_FOREACH (Main *, mainvar, &mainlist) {
BLI_assert(mainvar->versionfile != 0);
- do_versions_after_linking(mainvar, fd->reports);
+ do_versions_after_linking(mainvar, fd->reports->reports);
}
blo_join_main(&mainlist);
@@ -4249,8 +4259,13 @@ BlendFileData *blo_read_file_internal(FileData *fd, const char *filepath)
* we can re-generate overrides from their references. */
if (fd->memfile == NULL) {
/* Do not apply in undo case! */
- BKE_lib_override_library_main_validate(bfd->main, fd->reports);
+ fd->reports->duration.lib_overrides = PIL_check_seconds_timer();
+
+ BKE_lib_override_library_main_validate(bfd->main, fd->reports->reports);
BKE_lib_override_library_main_update(bfd->main);
+
+ fd->reports->duration.lib_overrides = PIL_check_seconds_timer() -
+ fd->reports->duration.lib_overrides;
}
BKE_collections_after_lib_link(bfd->main);
@@ -5206,7 +5221,7 @@ static void library_link_end(Main *mainl,
* or they will go again through do_versions - bad, very bad! */
split_main_newid(mainvar, main_newid);
- do_versions_after_linking(main_newid, (*fd)->reports);
+ do_versions_after_linking(main_newid, (*fd)->reports->reports);
add_main_to_main(mainvar, main_newid);
}
@@ -5340,7 +5355,7 @@ static void read_library_linked_id(
id->name + 2,
mainvar->curlib->filepath_abs,
library_parent_filepath(mainvar->curlib));
- basefd->library_id_missing_count++;
+ basefd->reports->count.missing_linked_id++;
/* Generate a placeholder for this ID (simplified version of read_libblock actually...). */
if (r_id) {
@@ -5495,7 +5510,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);
- basefd->library_file_missing_count++;
+ basefd->reports->count.missing_libraries++;
}
return fd;
@@ -5589,15 +5604,6 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
mainptr->curlib->filedata = NULL;
}
BKE_main_free(main_newid);
-
- if (basefd->library_file_missing_count != 0 || basefd->library_id_missing_count != 0) {
- BKE_reportf(basefd->reports,
- RPT_WARNING,
- "LIB: %d libraries and %d linked data-blocks are missing, please check the "
- "Info and Outliner editors for details",
- basefd->library_file_missing_count,
- basefd->library_id_missing_count);
- }
}
void *BLO_read_get_new_data_address(BlendDataReader *reader, const void *old_address)
@@ -5785,7 +5791,7 @@ void BLO_read_glob_list(BlendDataReader *reader, ListBase *list)
link_glob_list(reader->fd, list);
}
-ReportList *BLO_read_data_reports(BlendDataReader *reader)
+BlendFileReadReport *BLO_read_data_reports(BlendDataReader *reader)
{
return reader->fd->reports;
}
@@ -5800,7 +5806,7 @@ Main *BLO_read_lib_get_main(BlendLibReader *reader)
return reader->main;
}
-ReportList *BLO_read_lib_reports(BlendLibReader *reader)
+BlendFileReadReport *BLO_read_lib_reports(BlendLibReader *reader)
{
return reader->fd->reports;
}
diff --git a/source/blender/blenloader/intern/readfile.h b/source/blender/blenloader/intern/readfile.h
index d1d4e0b3256..b04043f9641 100644
--- a/source/blender/blenloader/intern/readfile.h
+++ b/source/blender/blenloader/intern/readfile.h
@@ -145,11 +145,7 @@ typedef struct FileData {
ListBase *old_mainlist;
struct IDNameLib_Map *old_idmap;
- struct ReportList *reports;
- /* Counters for amount of missing libraries, and missing IDs in libraries.
- * Used to generate a synthetic report in the UI. */
- int library_file_missing_count;
- int library_id_missing_count;
+ struct BlendFileReadReport *reports;
} FileData;
#define SIZEOFBLENDERHEADER 12
@@ -161,11 +157,13 @@ void blo_split_main(ListBase *mainlist, struct Main *main);
BlendFileData *blo_read_file_internal(FileData *fd, const char *filepath);
-FileData *blo_filedata_from_file(const char *filepath, struct ReportList *reports);
-FileData *blo_filedata_from_memory(const void *mem, int memsize, struct ReportList *reports);
+FileData *blo_filedata_from_file(const char *filepath, struct BlendFileReadReport *reports);
+FileData *blo_filedata_from_memory(const void *mem,
+ int memsize,
+ struct BlendFileReadReport *reports);
FileData *blo_filedata_from_memfile(struct MemFile *memfile,
const struct BlendFileReadParams *params,
- struct ReportList *reports);
+ struct BlendFileReadReport *reports);
void blo_clear_proxy_pointers_from_lib(struct Main *oldmain);
void blo_make_packed_pointer_map(FileData *fd, struct Main *oldmain);
diff --git a/source/blender/blenloader/intern/readfile_tempload.c b/source/blender/blenloader/intern/readfile_tempload.c
index 4566e1e9b4d..f440a06acf8 100644
--- a/source/blender/blenloader/intern/readfile_tempload.c
+++ b/source/blender/blenloader/intern/readfile_tempload.c
@@ -40,7 +40,8 @@ TempLibraryContext *BLO_library_temp_load_id(struct Main *real_main,
/* Copy the file path so any path remapping is performed properly. */
STRNCPY(temp_lib_ctx->bmain_base->name, real_main->name);
- temp_lib_ctx->blendhandle = BLO_blendhandle_from_file(blend_file_path, reports);
+ temp_lib_ctx->blendhandle = BLO_blendhandle_from_file(
+ blend_file_path, &(BlendFileReadReport){.reports = reports});
BLO_library_link_params_init(
&temp_lib_ctx->liblink_params, temp_lib_ctx->bmain_base, 0, LIB_TAG_TEMP_MAIN);
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index bf8f7eeca5c..0059074c8ad 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -1912,7 +1912,9 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
FOREACH_NODETREE_END;
if (error & NTREE_DOVERSION_NEED_OUTPUT) {
- BKE_report(fd->reports, RPT_ERROR, "Eevee material conversion problem. Error in console");
+ BKE_report(fd->reports != NULL ? fd->reports->reports : NULL,
+ RPT_ERROR,
+ "Eevee material conversion problem. Error in console");
printf(
"You need to connect Principled and Eevee Specular shader nodes to new material "
"output "
@@ -1920,7 +1922,9 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
}
if (error & NTREE_DOVERSION_TRANSPARENCY_EMISSION) {
- BKE_report(fd->reports, RPT_ERROR, "Eevee material conversion problem. Error in console");
+ BKE_report(fd->reports != NULL ? fd->reports->reports : NULL,
+ RPT_ERROR,
+ "Eevee material conversion problem. Error in console");
printf(
"You need to combine transparency and emission shaders to the converted Principled "
"shader nodes.\n");
diff --git a/source/blender/blenloader/tests/blendfile_loading_base_test.cc b/source/blender/blenloader/tests/blendfile_loading_base_test.cc
index 280a4b42b36..e93348b2158 100644
--- a/source/blender/blenloader/tests/blendfile_loading_base_test.cc
+++ b/source/blender/blenloader/tests/blendfile_loading_base_test.cc
@@ -123,7 +123,8 @@ bool BlendfileLoadingBaseTest::blendfile_load(const char *filepath)
char abspath[FILENAME_MAX];
BLI_path_join(abspath, sizeof(abspath), test_assets_dir.c_str(), filepath, NULL);
- bfile = BLO_read_from_file(abspath, BLO_READ_SKIP_NONE, nullptr /* reports */);
+ BlendFileReadReport bf_reports = {NULL};
+ bfile = BLO_read_from_file(abspath, BLO_READ_SKIP_NONE, &bf_reports);
if (bfile == nullptr) {
ADD_FAILURE() << "Unable to load file '" << filepath << "' from test assets dir '"
<< test_assets_dir << "'";