Reports: include parent library in readfile report

Helps troubleshooting indirect links.
This commit is contained in:
Campbell Barton 2014-10-19 12:49:01 +02:00
parent c35a649a0a
commit 923423e4cd
1 changed files with 29 additions and 11 deletions

View File

@ -256,6 +256,12 @@ void blo_reportf_wrap(ReportList *reports, ReportType type, const char *format,
}
}
/* for reporting linking messages */
static const char *library_parent_filepath(Library *lib)
{
return lib->parent ? lib->parent->filepath : "<direct>";
}
static OldNewMap *oldnewmap_new(void)
{
OldNewMap *onm= MEM_callocN(sizeof(*onm), "OldNewMap");
@ -9219,8 +9225,10 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
if (mainptr->curlib->packedfile) {
PackedFile *pf = mainptr->curlib->packedfile;
blo_reportf_wrap(basefd->reports, RPT_INFO, TIP_("Read packed library: '%s'"),
mainptr->curlib->name);
blo_reportf_wrap(
basefd->reports, RPT_INFO, TIP_("Read packed library: '%s', parent '%s'"),
mainptr->curlib->name,
library_parent_filepath(mainptr->curlib));
fd = blo_openblendermemory(pf->data, pf->size, basefd->reports);
@ -9228,8 +9236,11 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
BLI_strncpy(fd->relabase, mainptr->curlib->filepath, sizeof(fd->relabase));
}
else {
blo_reportf_wrap(basefd->reports, RPT_INFO, TIP_("Read library: '%s', '%s'"),
mainptr->curlib->filepath, mainptr->curlib->name);
blo_reportf_wrap(
basefd->reports, RPT_INFO, TIP_("Read library: '%s', '%s', parent '%s'"),
mainptr->curlib->filepath,
mainptr->curlib->name,
library_parent_filepath(mainptr->curlib));
fd = blo_openblenderfile(mainptr->curlib->filepath, basefd->reports);
}
/* allow typing in a new lib path */
@ -9300,10 +9311,13 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
append_id_part(fd, mainptr, id, &realid);
if (!realid) {
blo_reportf_wrap(fd->reports, RPT_WARNING,
TIP_("LIB ERROR: %s: '%s' missing from '%s'"),
BKE_idcode_to_name(GS(id->name)),
id->name + 2, mainptr->curlib->filepath);
blo_reportf_wrap(
fd->reports, RPT_WARNING,
TIP_("LIB ERROR: %s: '%s' missing from '%s', parent '%s'"),
BKE_idcode_to_name(GS(id->name)),
id->name + 2,
mainptr->curlib->filepath,
library_parent_filepath(mainptr->curlib));
}
change_idid_adr(mainlist, basefd, id, realid);
@ -9332,9 +9346,13 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
idn = id->next;
if (id->flag & LIB_READ) {
BLI_remlink(lbarray[a], id);
blo_reportf_wrap(basefd->reports, RPT_WARNING,
TIP_("LIB ERROR: %s: '%s' unread lib block missing from '%s'"),
BKE_idcode_to_name(GS(id->name)), id->name + 2, mainptr->curlib->filepath);
blo_reportf_wrap(
basefd->reports, RPT_WARNING,
TIP_("LIB ERROR: %s: '%s' unread lib block missing from '%s', parent '%s'"),
BKE_idcode_to_name(GS(id->name)),
id->name + 2,
mainptr->curlib->filepath,
library_parent_filepath(mainptr->curlib));
change_idid_adr(mainlist, basefd, id, NULL);
MEM_freeN(id);