diff options
author | Bastien Montagne <bastien@blender.org> | 2022-06-07 13:50:25 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2022-06-07 13:53:04 +0300 |
commit | 16934c198aab9413b0848c128af3b17a04219f25 (patch) | |
tree | 7e2520f1044b08c9f6d6d8a5b1f203fb5ec53a83 /source/blender/blenkernel/intern | |
parent | 4412e14708c5625c3fe84bc75fce2ca6de6f58c9 (diff) |
LibOverride: Attempt to improve handling of cyclic deps between libraries.
Those cyclic dependencies (lib_A depends on a texture from lib_B, which
links geometry from lib_A) are bad, but previous code did not always
helped much in idendtifying to actuall issue point.
Now, reduce maximum 'recursion' level to 100 (this should already never
be reached in practice), and additionally report warnings when reaching
level 90, so that user gets more context data to identify more easily
the culprit.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/lib_override.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/lib_override.cc b/source/blender/blenkernel/intern/lib_override.cc index 168feebedec..aa43ca94c99 100644 --- a/source/blender/blenkernel/intern/lib_override.cc +++ b/source/blender/blenkernel/intern/lib_override.cc @@ -2423,7 +2423,7 @@ static int lib_override_sort_libraries_func(LibraryIDLinkCallbackData *cb_data) if (id != nullptr && ID_IS_LINKED(id) && id->lib != id_owner->lib) { const int owner_library_indirect_level = ID_IS_LINKED(id_owner) ? id_owner->lib->temp_index : 0; - if (owner_library_indirect_level > 200) { + if (owner_library_indirect_level > 100) { CLOG_ERROR(&LOG, "Levels of indirect usages of libraries is way too high, there are most likely " "dependency loops, skipping further building loops (involves at least '%s' from " @@ -2434,6 +2434,16 @@ static int lib_override_sort_libraries_func(LibraryIDLinkCallbackData *cb_data) id->lib->filepath); return IDWALK_RET_NOP; } + if (owner_library_indirect_level > 90) { + CLOG_WARN( + &LOG, + "Levels of indirect usages of libraries is suspiciously too high, there are most likely " + "dependency loops (involves at least '%s' from '%s' and '%s' from '%s')", + id_owner->name, + id_owner->lib->filepath, + id->name, + id->lib->filepath); + } if (owner_library_indirect_level >= id->lib->temp_index) { id->lib->temp_index = owner_library_indirect_level + 1; |