Merge remote-tracking branch 'origin/blender-v3.0-release'

This includes adjustment of rBc12d8a72cef5 to the new path traversal code
introduced in rBe5e8db73df86.
This commit is contained in:
2021-11-30 10:56:14 +01:00
3 changed files with 11 additions and 3 deletions

View File

@@ -49,6 +49,12 @@ typedef enum eBPathForeachFlag {
BKE_BPATH_FOREACH_PATH_SKIP_LINKED = (1 << 1),
/** Skip paths when their matching data is packed. */
BKE_BPATH_FOREACH_PATH_SKIP_PACKED = (1 << 2),
/* Skip weak reference paths. Those paths are typically 'nice to have' extra information, but are
* not used as actual source of data by the current .blend file.
*
* NOTE: Currently this only concerns the weak reference to a library file stored in
* `ID::library_weak_reference`. */
BKE_BPATH_TRAVERSE_SKIP_WEAK_REFERENCES = (1 << 5),
/** Flags not affecting the generic BPath API. Those may be used by specific IDTypeInfo
* `foreach_path` implementations and/or callbacks to implement specific behaviors. */

View File

@@ -103,7 +103,8 @@ void BKE_bpath_foreach_path_id(BPathForeachPathData *bpath_data, ID *id)
return;
}
if (id->library_weak_reference != NULL) {
if (id->library_weak_reference != NULL &&
(flag & BKE_BPATH_TRAVERSE_SKIP_WEAK_REFERENCES) == 0) {
BKE_bpath_foreach_path_fixed_process(bpath_data, id->library_weak_reference->library_filepath);
}

View File

@@ -906,8 +906,9 @@ static bool has_external_files(Main *bmain, struct ReportList *reports)
struct FileCheckCallbackInfo callback_info = {reports, false};
eBPathForeachFlag flag = static_cast<eBPathForeachFlag>(
BKE_BPATH_FOREACH_PATH_SKIP_PACKED /* Packed files are fine. */
| BKE_BPATH_FOREACH_PATH_SKIP_MULTIFILE); /* Only report multi-files once, it's enough. */
BKE_BPATH_FOREACH_PATH_SKIP_PACKED /* Packed files are fine. */
| BKE_BPATH_FOREACH_PATH_SKIP_MULTIFILE /* Only report multi-files once, it's enough. */
| BKE_BPATH_TRAVERSE_SKIP_WEAK_REFERENCES); /* Only care about actually used files. */
BPathForeachPathData bpath_data = {
/* bmain */ bmain,