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:
authorSybren A. Stüvel <sybren@blender.org>2021-11-30 12:41:23 +0300
committerSybren A. Stüvel <sybren@blender.org>2021-11-30 12:41:23 +0300
commitc12d8a72cef557c0d9c76e78c3754e3009e74efd (patch)
treede35215da19c383d3bc73bf9ae7c8096210b1431 /source/blender/editors/asset
parente7ae9f493aaa004caf3627489752139f177a807b (diff)
BPath traversing: allow skipping weak library references
Add flag to `BKE_bpath_traverse_id()` and friends to skip weak references (see below). This makes a distinction between "this blend file depends on that file" and "this blend file references that file, but doesn't directly use its data". This distinction is for the Asset Bundle install operator, which refuses to copy the blend file when it's not self-contained. Weak references are those that are not directly used by the blend file, but are still present to allow path rewriting. For example, when an Asset is loaded its originating blend file is saved in `ID::library_weak_reference`; this reference is purely for deduplication purposes, and not for actually loading any data. Reviewed by: mont29, brecht Differential Revision: https://developer.blender.org/D13412
Diffstat (limited to 'source/blender/editors/asset')
-rw-r--r--source/blender/editors/asset/intern/asset_ops.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/editors/asset/intern/asset_ops.cc b/source/blender/editors/asset/intern/asset_ops.cc
index 9d03f6030b5..5ff82fcb0c0 100644
--- a/source/blender/editors/asset/intern/asset_ops.cc
+++ b/source/blender/editors/asset/intern/asset_ops.cc
@@ -912,8 +912,9 @@ static bool has_external_files(Main *bmain, struct ReportList *reports)
BKE_bpath_traverse_main(
bmain,
&external_file_check_callback,
- BKE_BPATH_TRAVERSE_SKIP_PACKED /* Packed files are fine. */
- | BKE_BPATH_TRAVERSE_SKIP_MULTIFILE /* Only report multifiles once, it's enough. */,
+ BKE_BPATH_TRAVERSE_SKIP_PACKED /* Packed files are fine. */
+ | BKE_BPATH_TRAVERSE_SKIP_MULTIFILE /* Only report multifiles once, it's enough. */
+ | BKE_BPATH_TRAVERSE_SKIP_WEAK_REFERENCES /* Only care about actually used files. */,
&callback_info);
return callback_info.external_file_found;
}