Fix 'missing files' operator not reporting which ID is using the missing filepath.

No idea why this was not reported before... Kind of critical info here.

Committed directly to 4.2 as:
* This is trivial change with extremely small risk of causing issues.
* Gold team at the studio needs it to better cleanup the production
  files for publication.
This commit is contained in:
Bastien Montagne
2024-11-05 19:29:16 +01:00
parent 6a242055a3
commit 6fb6cd64b1

View File

@@ -218,13 +218,33 @@ bool BKE_bpath_foreach_path_allocated_process(BPathForeachPathData *bpath_data,
static bool check_missing_files_foreach_path_cb(BPathForeachPathData *bpath_data,
char * /*path_dst*/,
size_t /*path_dst_maxncpy*/,
const char *path_src)
{
ReportList *reports = (ReportList *)bpath_data->user_data;
if (!BLI_exists(path_src)) {
BKE_reportf(reports, RPT_WARNING, "Path '%s' not found", path_src);
ID *owner_id = bpath_data->owner_id;
if (owner_id) {
if (ID_IS_LINKED(owner_id)) {
BKE_reportf(reports,
RPT_WARNING,
"Path '%s' not found, from linked data-block '%s' (from library '%s')",
path_src,
owner_id->name,
owner_id->lib->runtime.filepath_abs);
}
else {
BKE_reportf(reports,
RPT_WARNING,
"Path '%s' not found, from local data-block '%s'",
path_src,
owner_id->name);
}
}
else {
BKE_reportf(
reports, RPT_WARNING, "Path '%s' not found (no known owner data-block)", path_src);
}
}
return false;