diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2021-11-30 12:56:14 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2021-11-30 12:56:14 +0300 |
commit | bc1e3238c453a91a34d280031af18b1601cd94b0 (patch) | |
tree | c9df3e3b5ac0bf4434ff095af7c8d55de375725d /source/blender | |
parent | d7f0de0e3aea23afba286297ab98ebdd86a41507 (diff) | |
parent | c12d8a72cef557c0d9c76e78c3754e3009e74efd (diff) |
Merge remote-tracking branch 'origin/blender-v3.0-release'
This includes adjustment of rBc12d8a72cef5 to the new path traversal code
introduced in rBe5e8db73df86.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/BKE_bpath.h | 6 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/bpath.c | 3 | ||||
-rw-r--r-- | source/blender/editors/asset/intern/asset_ops.cc | 5 |
3 files changed, 11 insertions, 3 deletions
diff --git a/source/blender/blenkernel/BKE_bpath.h b/source/blender/blenkernel/BKE_bpath.h index 338aec4ae4f..bae151f6a72 100644 --- a/source/blender/blenkernel/BKE_bpath.h +++ b/source/blender/blenkernel/BKE_bpath.h @@ -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. */ diff --git a/source/blender/blenkernel/intern/bpath.c b/source/blender/blenkernel/intern/bpath.c index cea21d2a946..85e49774dfd 100644 --- a/source/blender/blenkernel/intern/bpath.c +++ b/source/blender/blenkernel/intern/bpath.c @@ -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); } diff --git a/source/blender/editors/asset/intern/asset_ops.cc b/source/blender/editors/asset/intern/asset_ops.cc index 6e81908c24e..c7644288959 100644 --- a/source/blender/editors/asset/intern/asset_ops.cc +++ b/source/blender/editors/asset/intern/asset_ops.cc @@ -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, |