diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2021-11-30 12:41:23 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2021-11-30 12:41:23 +0300 |
commit | c12d8a72cef557c0d9c76e78c3754e3009e74efd (patch) | |
tree | de35215da19c383d3bc73bf9ae7c8096210b1431 /source/blender/blenkernel/intern | |
parent | e7ae9f493aaa004caf3627489752139f177a807b (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/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/bpath.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/bpath.c b/source/blender/blenkernel/intern/bpath.c index 9ce58d8129b..7a7f46a8a2d 100644 --- a/source/blender/blenkernel/intern/bpath.c +++ b/source/blender/blenkernel/intern/bpath.c @@ -586,7 +586,8 @@ void BKE_bpath_traverse_id( return; } - if (id->library_weak_reference != NULL) { + if (id->library_weak_reference != NULL && + (flag & BKE_BPATH_TRAVERSE_SKIP_WEAK_REFERENCES) == 0) { rewrite_path_fixed( id->library_weak_reference->library_filepath, visit_cb, absbase, bpath_user_data); } |