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...
This commit is contained in:
2021-06-23 09:51:11 +02:00
parent 071799d4fc
commit 82c17082ba
21 changed files with 293 additions and 102 deletions

View File

@@ -258,7 +258,8 @@ static PyObject *bpy_lib_enter(BPy_Library *self)
BKE_reports_init(&reports, RPT_STORE);
self->blo_handle = BLO_blendhandle_from_file(self->abspath, &reports);
self->blo_handle = BLO_blendhandle_from_file(self->abspath,
&(BlendFileReadReport){.reports = &reports});
if (self->blo_handle == NULL) {
if (BPy_reports_to_error(&reports, PyExc_IOError, true) != -1) {