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:
Diffstat (limited to 'source/blender/blenloader/intern/readfile.c')
-rw-r--r--source/blender/blenloader/intern/readfile.c41
1 files changed, 21 insertions, 20 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 47ed4e5c06f..af214b81d52 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);
@@ -4206,6 +4208,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 +4216,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 +4233,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 +4254,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 +5216,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 +5350,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) {
@@ -5444,7 +5454,7 @@ static FileData *read_library_file_data(FileData *basefd,
TIP_("Read packed library: '%s', parent '%s'"),
mainptr->curlib->filepath,
library_parent_filepath(mainptr->curlib));
- fd = blo_filedata_from_memory(pf->data, pf->size, basefd->reports);
+ fd = blo_filedata_from_memory(pf->data, pf->size, basefd->reports->reports);
/* Needed for library_append and read_libraries. */
BLI_strncpy(fd->relabase, mainptr->curlib->filepath_abs, sizeof(fd->relabase));
@@ -5457,7 +5467,7 @@ static FileData *read_library_file_data(FileData *basefd,
mainptr->curlib->filepath_abs,
mainptr->curlib->filepath,
library_parent_filepath(mainptr->curlib));
- fd = blo_filedata_from_file(mainptr->curlib->filepath_abs, basefd->reports);
+ fd = blo_filedata_from_file(mainptr->curlib->filepath_abs, basefd->reports->reports);
}
if (fd) {
@@ -5495,7 +5505,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 +5599,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 +5786,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 +5801,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;
}