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:
authorDalai Felinto <dalai@blender.org>2022-06-22 11:34:55 +0300
committerDalai Felinto <dalai@blender.org>2022-06-22 11:48:59 +0300
commit31d80ddeaad2615d258e1d4fa5703308c458055e (patch)
tree681185bb4549076564f2d81e0ccba4dd483923fe /source/blender/blenkernel
parentdf2ab4e758c73bc72a95fcc02ac1e711bbd86b17 (diff)
Revert "LibOverride: Handle dependencies in both directions in partial override cases."
This reverts commit f0b4aa5d59e3b3754bfcf3827f7524d34c809c62. This commit was making files to get bigger and bigger every time they were saved and re-opened. In the orphaned data in the outliner new collections would show up there, even after continuously purging it. This would lead to a massive file which get also very slow. This problem will fix itself after a few re-open/re-saves of the files. For anyone also experimenting this you can fix this faster by purging the unused data multiple times in the file. Example of file from the Project Heist (rev. 1014): heist/pro/shots/010_opening/010_0050/010_0050.anim.blend
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/intern/lib_override.cc58
1 files changed, 2 insertions, 56 deletions
diff --git a/source/blender/blenkernel/intern/lib_override.cc b/source/blender/blenkernel/intern/lib_override.cc
index 0b91a1e2866..22012662180 100644
--- a/source/blender/blenkernel/intern/lib_override.cc
+++ b/source/blender/blenkernel/intern/lib_override.cc
@@ -687,51 +687,6 @@ static void lib_override_group_tag_data_clear(LibOverrideGroupTagData *data)
memset(data, 0, sizeof(*data));
}
-static void lib_override_hierarchy_dependencies_recursive_tag_from(LibOverrideGroupTagData *data)
-{
- Main *bmain = data->bmain;
- ID *id = data->id_root;
- const bool is_override = data->is_override;
-
- if ((*(uint *)&id->tag & data->tag) == 0) {
- /* This ID is not tagged, no reason to proceed further to its parents. */
- return;
- }
-
- MainIDRelationsEntry *entry = static_cast<MainIDRelationsEntry *>(
- BLI_ghash_lookup(bmain->relations->relations_from_pointers, id));
- BLI_assert(entry != nullptr);
-
- if (entry->tags & MAINIDRELATIONS_ENTRY_TAGS_PROCESSED_FROM) {
- /* This ID has already been processed. */
- return;
- }
- /* This way we won't process again that ID, should we encounter it again through another
- * relationship hierarchy. */
- entry->tags |= MAINIDRELATIONS_ENTRY_TAGS_PROCESSED_FROM;
-
- for (MainIDRelationsEntryItem *from_id_entry = entry->from_ids; from_id_entry != nullptr;
- from_id_entry = from_id_entry->next) {
- if ((from_id_entry->usage_flag & IDWALK_CB_OVERRIDE_LIBRARY_NOT_OVERRIDABLE) != 0) {
- /* Never consider non-overridable relationships ('from', 'parents', 'owner' etc. pointers)
- * as actual dependencies. */
- continue;
- }
- /* We only consider IDs from the same library. */
- ID *from_id = from_id_entry->id_pointer.from;
- if (from_id == nullptr || from_id->lib != id->lib ||
- (is_override && !ID_IS_OVERRIDE_LIBRARY(from_id))) {
- /* IDs from different libraries, or non-override IDs in case we are processing overrides,
- * are both barriers of dependency. */
- continue;
- }
- from_id->tag |= data->tag;
- LibOverrideGroupTagData sub_data = *data;
- sub_data.id_root = from_id;
- lib_override_hierarchy_dependencies_recursive_tag_from(&sub_data);
- }
-}
-
/* Tag all IDs in dependency relationships within an override hierarchy/group.
*
* Requires existing `Main.relations`.
@@ -748,13 +703,13 @@ static bool lib_override_hierarchy_dependencies_recursive_tag(LibOverrideGroupTa
BLI_ghash_lookup(bmain->relations->relations_from_pointers, id));
BLI_assert(entry != nullptr);
- if (entry->tags & MAINIDRELATIONS_ENTRY_TAGS_PROCESSED_TO) {
+ if (entry->tags & MAINIDRELATIONS_ENTRY_TAGS_PROCESSED) {
/* This ID has already been processed. */
return (*(uint *)&id->tag & data->tag) != 0;
}
/* This way we won't process again that ID, should we encounter it again through another
* relationship hierarchy. */
- entry->tags |= MAINIDRELATIONS_ENTRY_TAGS_PROCESSED_TO;
+ entry->tags |= MAINIDRELATIONS_ENTRY_TAGS_PROCESSED;
for (MainIDRelationsEntryItem *to_id_entry = entry->to_ids; to_id_entry != nullptr;
to_id_entry = to_id_entry->next) {
@@ -778,15 +733,6 @@ static bool lib_override_hierarchy_dependencies_recursive_tag(LibOverrideGroupTa
}
}
- /* If the current ID is/has been tagged for override above, then check its reversed dependencies
- * (i.e. IDs that depend on the current one).
- *
- * This will cover e.g. the case where user override an armature, and would expect the mesh
- * object deformed by that armature to also be overridden. */
- if ((*(uint *)&id->tag & data->tag) != 0) {
- lib_override_hierarchy_dependencies_recursive_tag_from(data);
- }
-
return (*(uint *)&id->tag & data->tag) != 0;
}