17#include <fmt/format.h>
75#include "RNA_prototypes.hh"
86#ifdef DEBUG_OVERRIDE_TIMEIT
90using namespace blender::bke;
124 liboverride->runtime = MEM_new<IDOverrideLibraryRuntime>(__func__);
136 if (id_src->id_type() ==
ID_OB && id_dst->id_type() ==
ID_OB) {
150 const ID **r_owner_id)
154 BLI_assert_msg(owner_id !=
nullptr,
"Liboverride-embedded ID with no owner");
155 if (r_owner_id !=
nullptr) {
156 *r_owner_id = owner_id;
161 if (r_owner_id !=
nullptr) {
164 return id->override_library;
176 const_cast<const ID *
>(
id),
177 const_cast<const ID *
>(owner_id_hint),
178 const_cast<const ID **
>(r_owner_id)));
234 op_dst = op_dst->next, op_src = op_src->next)
248 liboverride->runtime->rna_path_to_override_properties->clear();
266 if ((*liboverride)->runtime !=
nullptr) {
267 MEM_SAFE_DELETE((*liboverride)->runtime);
291 const int lib_id_copy_flags)
302 if (local_id ==
nullptr) {
338 if (reference_key !=
nullptr) {
382 const ID *override_owner_id;
393 const int rnaprop_index)
396 if (anim_data !=
nullptr) {
398 char *index_token_start =
const_cast<char *
>(
400 if (index_token_start !=
nullptr) {
401 const char index_token_start_backup = *index_token_start;
402 *index_token_start =
'\0';
404 anim_data, liboverride_prop->
rna_path, rnaprop_index,
nullptr,
nullptr);
405 *index_token_start = index_token_start_backup;
409 anim_data, liboverride_prop->
rna_path, 0,
nullptr,
nullptr);
411 if (fcurve !=
nullptr) {
464 const bool do_tagged_remap)
477 if (do_tagged_remap) {
479 Key *local_key =
nullptr;
480 if (reference_key !=
nullptr) {
495 if (reference_key !=
nullptr) {
519 if (id_iter->id_type() ==
ID_KE) {
520 id =
reinterpret_cast<Key *
>(id_iter)->from;
524 id->override_library->hierarchy_root == id_hierarchy_root)
526 id->override_library->reference->newid =
id;
527 if (id_iter->id_type() ==
ID_KE) {
529 if (reference_key !=
nullptr) {
530 reference_key->
id.
newid = id_iter;
542 id_remapper.
add(reference_id, local_id);
545 Key *local_key =
nullptr;
546 if (reference_key !=
nullptr) {
547 if (reference_id->
newid !=
nullptr) {
552 id_remapper.
add(&reference_key->
id, &local_key->
id);
558 const ID *id_root_reference,
559 ID *id_hierarchy_root,
560 const ID *id_hierarchy_root_reference,
561 const bool do_no_main,
562 const bool do_fully_editable)
570 BLI_assert(id_hierarchy_root !=
nullptr || id_hierarchy_root_reference !=
nullptr ||
574 BLI_assert(
ELEM(
nullptr, id_hierarchy_root, id_hierarchy_root_reference));
576 if (id_hierarchy_root !=
nullptr) {
589 if (!
ELEM(id_hierarchy_root_reference,
nullptr, id_root_reference)) {
596 const Library *reference_library = id_root_reference->
lib;
601 ListBaseT<LinkData> todo_ids = {
nullptr};
606 if ((reference_id->
tag &
ID_TAG_DOIT) != 0 && reference_id->
lib == reference_library &&
610 todo_id_iter->
data = reference_id;
617 for (todo_id_iter = todo_ids.first(); todo_id_iter !=
nullptr; todo_id_iter = todo_id_iter->
next)
619 reference_id =
static_cast<ID *
>(todo_id_iter->
data);
623 if (reference_id->
newid ==
nullptr) {
629 if (reference_id->
newid ==
nullptr) {
633 if (do_fully_editable) {
641 if (reference_key !=
nullptr) {
646 reference_key->
id.
newid = &local_key->
id;
658 const bool do_remap_liboverride_hierarchy_only = (id_hierarchy_root !=
nullptr && !do_no_main);
660 if (id_hierarchy_root_reference !=
nullptr) {
661 id_hierarchy_root = id_hierarchy_root_reference->
newid;
663 else if (id_root_reference->
newid !=
nullptr &&
664 (id_hierarchy_root ==
nullptr ||
667 id_hierarchy_root = id_root_reference->
newid;
680 if (do_no_main &&
id->lib == id_root_reference->
lib &&
id->newid !=
nullptr) {
681 other_id =
id->
newid;
687 other_id->
lib =
nullptr;
701 if (!do_remap_liboverride_hierarchy_only ||
705 relinked_ids.
append(other_id);
712 ID *local_id = reference_id->
newid;
713 if (other_id == local_id) {
718 if (other_id !=
id) {
719 other_id->
lib = id_root_reference->
lib;
724 for (todo_id_iter = todo_ids.first(); todo_id_iter !=
nullptr;
725 todo_id_iter = todo_id_iter->
next)
727 reference_id =
static_cast<ID *
>(todo_id_iter->
data);
728 ID *local_id = reference_id->
newid;
730 if (local_id ==
nullptr) {
745 relinked_ids.
clear();
749 for (todo_id_iter = todo_ids.first(); todo_id_iter !=
nullptr;
750 todo_id_iter = todo_id_iter->
next)
752 reference_id =
static_cast<ID *
>(todo_id_iter->
data);
754 reference_id->
newid =
nullptr;
758 todo_ids.free_no_destruct();
838 else if (is_missing) {
851 else if (is_missing) {
894 data->linked_object_to_instantiating_collections.lookup_or_add_cb_as(
912 if (
data->scene !=
nullptr) {
914 data,
data->scene->master_collection);
943 const bool check_override)
946 if (
ELEM(other_id,
nullptr, owner_id)) {
950 if (other_id->
lib != owner_id->
lib) {
954 if (check_override) {
957 "When processing liboverrides, the owner ID should always be a liboverride too here.");
969#define HIERARCHY_BREAKING_ID_TYPES ID_SCE, ID_LI, ID_SCR, ID_WM, ID_WS
975#undef HIERARCHY_BREAKING_ID_TYPES
983 ID *
id =
data->root_get();
984 const bool is_override =
data->is_override;
986 if ((*
reinterpret_cast<uint *
>(&
id->tag) &
data->tag) == 0) {
1003 from_id_entry = from_id_entry->
next)
1008 ID *from_id = from_id_entry->id_pointer.from;
1014 data->root_set(from_id);
1029 ID *
id =
data->root_get();
1030 const bool is_override =
data->is_override;
1031 const bool is_resync =
data->is_resync;
1038 return (*
reinterpret_cast<uint *
>(&
id->tag) &
data->tag) != 0;
1045 to_id_entry = to_id_entry->
next)
1050 ID *to_id = to_id_entry->id_pointer.to;
1055 data->root_set(to_id);
1057 id->tag |=
data->tag;
1067 if ((*
reinterpret_cast<uint *
>(&
id->tag) &
data->tag) != 0 && !is_resync) {
1071 return (*
reinterpret_cast<uint *
>(&
id->tag) &
data->tag) != 0;
1077 ID *id_owner =
data->root_get();
1093 to_id_entry = to_id_entry->
next)
1098 ID *to_id = to_id_entry->id_pointer.to;
1111 data->linked_ids_hierarchy_default_override.contains(to_id))
1115 data->root_set(to_id);
1120 data->root_set(id_owner);
1131 collection_object !=
nullptr;
1132 collection_object = collection_object->next)
1134 Object *
object = collection_object->ob;
1135 if (
object ==
nullptr) {
1139 data->linked_ids_hierarchy_default_override.contains(&
object->id))
1146 collection_child !=
nullptr;
1147 collection_child = collection_child->next)
1150 data, collection_child->collection))
1162 ID *id_root =
data->root_get();
1171 ((ob.
id.
tag &
data->tag) ||
data->linked_ids_hierarchy_default_override.contains(&ob.
id)))
1175 if (pchan->custom !=
nullptr && &pchan->custom->id != id_root) {
1176 data->id_tag_clear(&pchan->custom->id,
bool(pchan->custom->id.tag &
ID_TAG_MISSING));
1185 if (!((collection.
id.
tag &
data->tag) != 0 ||
1186 data->linked_ids_hierarchy_default_override.contains(&collection.
id)) ||
1187 &collection.
id == id_root || collection.
id.
lib != id_root->
lib)
1213 ID *id_root =
data->root_get();
1214 ID *hierarchy_root_id =
data->hierarchy_root_get();
1215 const bool is_resync =
data->is_resync;
1219 id_root->
tag |=
data->missing_tag;
1232 const bool use_linked_overrides_set = hierarchy_root_id &&
1233 hierarchy_root_id->
lib == id_root->
lib &&
1234 hierarchy_root_id != id_root;
1237 if (use_linked_overrides_set) {
1238 BLI_assert(
data->linked_ids_hierarchy_default_override.is_empty());
1239 data->linked_ids_hierarchy_default_override.add(id_root);
1240 data->linked_ids_hierarchy_default_override.add(hierarchy_root_id);
1241 data->do_create_linked_overrides_set =
true;
1244 data->root_set(hierarchy_root_id);
1251 data->root_set(id_root);
1252 data->do_create_linked_overrides_set =
false;
1262 if (use_linked_overrides_set) {
1263 data->linked_ids_hierarchy_default_override.clear();
1288 Collection *instantiating_collection =
nullptr;
1289 Collection *instantiating_collection_override_candidate =
nullptr;
1293 data->linked_object_to_instantiating_collections.lookup_default_as(&ob,
nullptr));
1294 if (instantiating_collection_linklist !=
nullptr) {
1295 for (
LinkNode *instantiating_collection_linknode = instantiating_collection_linklist->
list;
1296 instantiating_collection_linknode !=
nullptr;
1297 instantiating_collection_linknode = instantiating_collection_linknode->
next)
1299 instantiating_collection =
static_cast<Collection *
>(
1300 instantiating_collection_linknode->link);
1306 if (instantiating_collection->
id.
tag &
data->tag ||
1307 data->linked_ids_hierarchy_default_override.contains(&instantiating_collection->
id))
1313 instantiating_collection_override_candidate = instantiating_collection;
1314 instantiating_collection =
nullptr;
1318 if (instantiating_collection ==
nullptr &&
1319 instantiating_collection_override_candidate !=
nullptr)
1322 &instantiating_collection_override_candidate->
id,
1332 ID *id_owner =
data->root_get();
1337 ID *id_hierarchy_root =
data->hierarchy_root_get();
1357 to_id_entry = to_id_entry->
next)
1362 ID *to_id = to_id_entry->id_pointer.to;
1374 const Library *reference_lib =
1376 const ID *to_id_reference =
1378 if (to_id_reference->
lib != reference_lib) {
1386 data->root_set(to_id);
1389 data->root_set(id_owner);
1395 ID *id_root =
data->root_get();
1400 ID *id_hierarchy_root =
data->hierarchy_root_get();
1414 ID *id_root_reference,
1415 ID *id_hierarchy_root_reference,
1416 const bool do_fully_editable)
1424 data.is_override =
false;
1425 data.is_resync =
false;
1427 data.root_set(id_root_reference);
1428 data.hierarchy_root_set(id_hierarchy_root_reference);
1439 if (id_hierarchy_root_reference->
lib != id_root_reference->
lib) {
1442 id_root_reference->
lib);
1445 data.is_override =
true;
1446 data.root_set(id_hierarchy_root_reference);
1447 data.hierarchy_root_set(id_hierarchy_root_reference);
1454 bool success =
false;
1455 if (id_hierarchy_root_reference->
lib != id_root_reference->
lib) {
1459 id_hierarchy_root_reference,
1469 id_hierarchy_root_reference,
1486 ID *id_instance_hint,
1488 const Object *old_active_object,
1489 const bool is_resync)
1492 BLI_assert(old_active_object ==
nullptr || view_layer !=
nullptr);
1508 if (is_resync || id_root ==
nullptr || id_root->
newid ==
nullptr) {
1527 switch (id_root->id_type()) {
1529 Object *ob_reference = id_instance_hint !=
nullptr &&
1530 id_instance_hint->id_type() ==
ID_OB ?
1531 reinterpret_cast<Object *
>(id_instance_hint) :
1537 if (ob_reference !=
nullptr) {
1540 else if (id_instance_hint !=
nullptr) {
1543 bmain, scene, (
reinterpret_cast<Collection *
>(id_instance_hint)), collection_new);
1547 bmain, scene, (
reinterpret_cast<Collection *
>(id_root)), collection_new);
1557 if (!all_objects_in_scene->
contains(ob_new)) {
1559 bmain, scene,
reinterpret_cast<Object *
>(id_root), ob_new);
1569 if (view_layer !=
nullptr) {
1577 Collection *default_instantiating_collection = residual_storage;
1580 if (ob_new ==
nullptr || (
ID_IS_LINKED(ob_new) && ob_new->
id.
lib != owner_library)) {
1587 if (old_active_object == &ob) {
1593 if (basact !=
nullptr) {
1594 view_layer->
basact = basact;
1599 if (!all_objects_in_scene->
contains(ob_new)) {
1600 if (id_root !=
nullptr && default_instantiating_collection ==
nullptr) {
1601 ID *id_ref = id_root->
newid !=
nullptr ? id_root->
newid : id_root;
1602 switch (id_ref->id_type()) {
1627 (view_layer !=
nullptr ?
1632 default_instantiating_collection = &collection;
1641 if (default_instantiating_collection ==
nullptr) {
1650 if (id_root !=
nullptr &&
1653 ID *id_ref = id_root->
newid !=
nullptr ? id_root->
newid : id_root;
1654 switch (id_ref->id_type()) {
1659 default_instantiating_collection);
1664 bmain, scene,
nullptr, default_instantiating_collection);
1669 MEM_delete(all_objects_in_scene);
1676 ID *id_root_reference,
1677 ID *id_hierarchy_root_reference,
1678 ID *id_instance_hint,
1679 ID **r_id_root_override,
1680 const bool do_fully_editable)
1682 if (r_id_root_override !=
nullptr) {
1683 *r_id_root_override =
nullptr;
1686 if (id_hierarchy_root_reference ==
nullptr) {
1687 id_hierarchy_root_reference = id_root_reference;
1694 const Object *old_active_object = (view_layer !=
nullptr) ?
1702 id_hierarchy_root_reference,
1709 if (r_id_root_override !=
nullptr) {
1710 *r_id_root_override = id_root_reference->
newid;
1735 if (curr_level > 1000) {
1737 "Levels of dependency relationships between library overrides IDs is way too high, "
1738 "skipping further processing loops (involves at least '%s')",
1754 *r_best_level = curr_level;
1755 return id->override_library->hierarchy_root;
1760 int best_level_placeholder = 0;
1774 int best_level_candidate = curr_level;
1775 ID *best_root_id_candidate =
id;
1778 from_id_entry = from_id_entry->
next)
1783 ID *from_id = from_id_entry->id_pointer.from;
1788 int level_candidate = curr_level + 1;
1791 bmain, from_id, curr_level + 1, &level_candidate);
1792 if (level_candidate > best_level_candidate && root_id_candidate !=
nullptr) {
1793 best_root_id_candidate = root_id_candidate;
1794 best_level_candidate = level_candidate;
1801 int best_level_placeholder = 0;
1804 bmain, id_owner, curr_level + 1, &best_level_placeholder);
1807 BLI_assert(best_root_id_candidate !=
nullptr);
1815 *r_best_level = best_level_candidate;
1816 return best_root_id_candidate;
1835 if (id_root ==
id) {
1841 ID *id_iter = ancestors[i];
1847 from_id_entry = from_id_entry->
next)
1852 ID *from_id = from_id_entry->id_pointer.from;
1857 if (from_id == id_root) {
1861 ancestors.
add(from_id);
1876 if (
id->override_library->hierarchy_root == id_root) {
1884 if (
id->override_library->hierarchy_root !=
nullptr) {
1894 "Inconsistency in library override hierarchy of ID '%s'.\n"
1895 "\tNot enough data to verify validity of current proposed root '%s', assuming "
1896 "already set one '%s' is valid.",
1899 id->override_library->hierarchy_root->name);
1905 id->override_library->reference);
1909 bool do_replace_root = (!
id->override_library->hierarchy_root ||
1911 id->override_library->hierarchy_root->lib !=
id->lib);
1913 from_id_entry = from_id_entry->
next)
1920 if (id_from_ref == from_id_entry->id_pointer.from) {
1923 do_replace_root =
true;
1926 "Inconsistency in library override hierarchy of ID '%s'.\n"
1927 "\tCurrent proposed root '%s' detected as valid, will replace already set one '%s'.",
1930 id->override_library->hierarchy_root->name);
1935 if (!do_replace_root) {
1938 "Inconsistency in library override hierarchy of ID '%s'.\n"
1939 "\tCurrent proposed root '%s' not detected as valid, keeping already set one '%s'.",
1942 id->override_library->hierarchy_root->name);
1948 "Modifying library override hierarchy of ID '%s'.\n"
1949 "\tFrom old root '%s' to new root '%s'.",
1951 id->override_library->hierarchy_root ?
id->override_library->hierarchy_root->name :
1955 id->override_library->hierarchy_root = id_root;
1962 to_id_entry = to_id_entry->
next)
1967 ID *to_id = to_id_entry->id_pointer.to;
1987 if (!
ELEM(
id->override_library->hierarchy_root,
id,
nullptr)) {
1988 std::string error_msg = fmt::format(
1989 "Existing isolated override '{}' has a non-null hierarchy root ('{}'), will be "
1992 id->override_library->hierarchy_root->name);
1999 id->override_library->hierarchy_root =
nullptr;
2004 bool null_hierarchy_root_is_expected =
false;
2006 if (
id->override_library->hierarchy_root !=
nullptr) {
2008 id->override_library->hierarchy_root->lib !=
id->lib)
2010 std::string error_msg = fmt::format(
2011 "Existing override hierarchy root ('{}') for ID '{}' is invalid, will try to find a new "
2013 id->override_library->hierarchy_root !=
nullptr ?
2014 id->override_library->hierarchy_root->name :
2023 id->override_library->hierarchy_root =
nullptr;
2024 null_hierarchy_root_is_expected =
true;
2031 std::string error_msg = fmt::format(
2032 "Existing override hierarchy root ('{}') for ID '{}' is invalid, will try to find a new "
2034 id->override_library->hierarchy_root !=
nullptr ?
2035 id->override_library->hierarchy_root->name :
2039 id->override_library->hierarchy_root =
nullptr;
2040 null_hierarchy_root_is_expected =
true;
2044 processed_ids.
add(
id);
2055 if (!
ELEM(
id->override_library->hierarchy_root, id_root,
nullptr)) {
2058 std::string error_msg = fmt::format(
2059 "Potential inconsistency in library override hierarchy of ID '{}' (current root "
2060 "{}), detected as part of the hierarchy of '{}' (current root '{}')",
2062 id->override_library->hierarchy_root !=
nullptr ?
2063 id->override_library->hierarchy_root->name :
2075 processed_ids.
add(
id);
2079 if (!
id->override_library->hierarchy_root && !null_hierarchy_root_is_expected &&
2082 std::string error_msg = fmt::format(
2083 "Missing library override hierarchy root data for ID '{}', will be changed to use '{}' as "
2097 BLI_assert(
id->override_library->hierarchy_root !=
nullptr);
2110 processed_ids.
add(
id);
2115 processed_ids.
add(
id);
2127 const ID *id_root_reference,
2128 Vector<std::pair<ID *, ID *>> &references_and_new_overrides,
2143 for (
auto [id_reference, id_override_new] : references_and_new_overrides) {
2144 new_overrides.
append(id_override_new);
2146 if (id_override_old ==
nullptr) {
2149 remapper_overrides_old_to_new.
add(id_override_old, id_override_new);
2152 for (
auto item_iter : linkedref_to_old_override.
items()) {
2154 ID *id_override_old_iter = item_iter.value;
2156 nomain_ids.
append(id_override_old_iter);
2160 ID *id_reference_iter = item_iter.key;
2171 if (!id_reference_iter->
newid) {
2172 remapper_overrides_reference_to_old.
add(id_reference_iter, id_override_old_iter);
2181 remapper_overrides_old_to_new,
2187 remapper_overrides_reference_to_old,
2214 std::map<LibOverrideMissingIDsData_Key, LibOverrideMissingIDsData_Value>;
2225 std::string id_name_key(
id->name);
2226 const size_t last_key_index = id_name_key.find_last_not_of(
"0123456789");
2228 BLI_assert(last_key_index != std::string::npos);
2230 if (id_name_key[last_key_index] ==
'.') {
2231 id_name_key.resize(last_key_index);
2238 Main *bmain,
const bool is_relocate)
2248 if ((id_iter->
tag & required_tags) != required_tags) {
2257 if ((id_iter->
tag & required_tags) != required_tags) {
2263 std::pair<LibOverrideMissingIDsData::iterator, bool> value = missing_ids.try_emplace(
2265 value.first->second.push_back(id_iter);
2278 const LibOverrideMissingIDsData::iterator value = missing_ids.find(key);
2279 if (value == missing_ids.end()) {
2282 while (!value->second.empty()) {
2283 ID *match_id = value->second.front();
2284 value->second.pop_front();
2309 ListBaseT<ID> *no_main_ids_list,
2310 Collection *override_resync_residual_storage,
2311 const bool do_hierarchy_enforce,
2312 const bool do_post_process,
2320 const Object *old_active_object =
nullptr;
2335 "Impossible to resync data-block %s and its dependencies, as its linked reference "
2347 data.is_override =
true;
2348 data.is_resync =
true;
2350 data.root_set(id_root);
2361 for (
LinkNode *resync_root_link = id_resync_roots; resync_root_link !=
nullptr;
2362 resync_root_link = resync_root_link->
next)
2364 ID *id_resync_root =
static_cast<ID *
>(resync_root_link->link);
2369 "While dealing with root '%s', resync root ID '%s' (%p) found to be alreaady "
2372 id_resync_root->
name,
2386 reports !=
nullptr ? reports->
reports :
nullptr,
2388 "Impossible to resync data-block %s and its dependencies, as its linked reference "
2398 data.is_override =
true;
2399 data.root_set(id_resync_root);
2404 data.is_override =
false;
2406 data.hierarchy_root_set(
2436 bmain,
id,
nullptr,
nullptr);
2442 ID *reference_id = id_override_library->
reference;
2443 if (reference_id->id_type() !=
id->id_type()) {
2444 switch (
id->id_type()) {
2450 reference_id =
reinterpret_cast<ID *
>(
2460 if (reference_id ==
nullptr) {
2467 if (!linkedref_to_old_override.
contains_as(reference_id)) {
2468 linkedref_to_old_override.
add_as(reference_id,
id);
2472 if ((
id->override_library->reference->tag &
ID_TAG_DOIT) == 0) {
2477 id->override_library->reference->tag |=
ID_TAG_DOIT;
2491 data.is_override =
true;
2492 data.root_set(id_root);
2519 Library *id_root_reference_lib_old = (new_to_old_libraries_map ?
2521 id_root_reference->
lib, id_root_reference->
lib) :
2522 id_root_reference->
lib);
2523 const bool is_relocate = id_root_reference_lib_old != id_root_reference->
lib;
2528 bmain, is_relocate);
2534 ID *id_reference_iter;
2537 !
ELEM(id_reference_iter->
lib, id_root_reference->
lib, id_root_reference_lib_old))
2541 ID *id_override_new = id_reference_iter->
newid;
2542 references_and_new_overrides.
append(std::make_pair(id_reference_iter, id_override_new));
2553 id_reference_iter->
lib);
2554 BLI_assert(id_override_old ==
nullptr || id_override_old->
lib == id_root->
lib);
2555 id_override_new->
lib = id_root->
lib;
2562 if (id_override_old ==
nullptr && (
ID_IS_LINKED(id_override_new) || is_relocate)) {
2564 missing_ids_data, linkedref_to_old_override, id_override_new);
2565 BLI_assert(id_override_old ==
nullptr || id_override_old->
lib == id_override_new->
lib);
2566 if (id_override_old !=
nullptr) {
2567 linkedref_to_old_override.
add_as(id_reference_iter, id_override_old);
2571 if (key_reference_iter && key_override_old) {
2572 linkedref_to_old_override.
add_as(&key_reference_iter->
id, &key_override_old->
id);
2576 "Found missing linked or versioning-generated old override best-match %s for "
2577 "new linked override %s",
2578 id_override_old->
name,
2579 id_override_new->
name);
2588 if (id_override_old !=
nullptr) {
2591 memcpy(id_name_buf, id_override_old->
name,
sizeof(id_name_buf));
2592 memcpy(id_override_old->
name, id_override_new->
name,
sizeof(id_override_old->
name));
2593 memcpy(id_override_new->
name, id_name_buf,
sizeof(id_override_new->
name));
2623 for (; op_new; op_new = op_new->
next, op_old = op_old->
next) {
2649 bmain, id_root_reference, references_and_new_overrides, linkedref_to_old_override);
2664 ID *id_override_new =
id->
newid;
2670 if (id_override_old ==
nullptr) {
2683 if (key_override_old_p !=
nullptr && *key_override_old_p !=
nullptr) {
2687 Key *key_override_old = id_cast<Key *>(
2690 *key_override_old_p = key_override_old;
2706 bool do_clear_parenting_override =
false;
2707 if (id_override_new->id_type() ==
ID_OB) {
2708 Object *ob_old =
reinterpret_cast<Object *
>(id_override_old);
2709 Object *ob_new =
reinterpret_cast<Object *
>(id_override_new);
2719 do_clear_parenting_override =
true;
2736 if (op.operations.is_empty()) {
2739 else if (do_clear_parenting_override) {
2740 if (strstr(op.rna_path,
"matrix_parent_inverse") || strstr(op.rna_path,
"parent_type") ||
2741 strstr(op.rna_path,
"parent_bone") || strstr(op.rna_path,
"parent_vertices"))
2744 "Deleting liboverride property '%s' from object %s, as its parent pointer "
2745 "matches the reference data hierarchy wise",
2746 id_override_new->
name + 2,
2763 if (key_override_old_p !=
nullptr) {
2764 *key_override_old_p =
nullptr;
2768 id_override_old_vector.
append(id_override_old);
2777 id_override_old_vector,
2781 for (
ID *id_override_old : id_override_old_vector) {
2784 id_override_old_vector.
clear();
2789 int user_edited_overrides_deletion_count = 0;
2798 if (
id->newid !=
nullptr &&
id->lib == id_root_reference->
lib) {
2801 if (id_override_old !=
nullptr) {
2809 id_override_old_vector.
append(id_override_old);
2825 else if (hierarchy_root !=
nullptr &&
2845 "Old override %s is being kept around as it was user-edited",
2854 "Old override %s is being deleted even though it was user-edited",
2856 user_edited_overrides_deletion_count++;
2863 else if (
id->override_library->runtime !=
nullptr) {
2873 for (
ID *id_override_old : id_override_old_vector) {
2876 id_override_old_vector.
clear();
2879 linkedref_to_old_override.
clear();
2886 {.prevent_liboverride_hierarchy_root_ensure =
true, .prevent_invariants_update =
true});
2891 if (id_root_reference->
newid !=
nullptr) {
2892 id_root = id_root_reference->
newid;
2895 if (user_edited_overrides_deletion_count > 0) {
2898 "During resync of data-block %s, %d obsolete overrides were deleted, that had "
2899 "local changes defined by user",
2901 user_edited_overrides_deletion_count);
2904 if (do_post_process) {
2916 override_resync_residual_storage,
2966 nullptr,
id,
nullptr,
nullptr);
2989 "Deleting %d unused linked missing IDs and their unused liboverrides (including %d "
3002 Collection *override_resync_residual_storage,
3003 const bool do_hierarchy_enforce,
3006 ListBaseT<ID> no_main_ids_list = {
nullptr};
3008 id_resync_roots.
link = id_root;
3009 id_resync_roots.
next =
nullptr;
3018 override_resync_residual_storage,
3019 do_hierarchy_enforce,
3023 for (
ID &id_iter : no_main_ids_list.items_mutable()) {
3037 const int library_indirect_level,
3038 const bool do_strict_equal)
3040 const int id_lib_level = (
ID_IS_LINKED(
id) ?
id->lib->runtime->temp_index : 0);
3041 return do_strict_equal ? id_lib_level == library_indirect_level :
3042 id_lib_level <= library_indirect_level;
3059 const int library_indirect_level,
3060 bool is_in_partial_resync_hierarchy)
3068 "While processing indirect level %d, ID %s from lib %s of indirect level %d detected "
3069 "as needing resync, skipping",
3070 library_indirect_level,
3081 bool is_reprocessing_current_entry =
false;
3092 if (!is_in_partial_resync_hierarchy) {
3101 is_reprocessing_current_entry =
true;
3105 "ID %s (%p) is detected as part of a hierarchy dependency loop requiring resync, it "
3106 "is now being re-processed to ensure proper tagging of the whole loop",
3121 "ID %s (%p) was marked as a potential root for partial resync, but it is used by "
3122 "%s (%p), which is also tagged for resync, so it is not a root after all",
3134 if (!is_in_partial_resync_hierarchy) {
3144 if (is_in_partial_resync_hierarchy) {
3149 "ID %s (%p) now tagged as needing resync because they are used by %s (%p) "
3150 "that needs to be resynced",
3161 is_in_partial_resync_hierarchy =
true;
3165 if (!is_reprocessing_current_entry) {
3180 entry_item = entry_item->
next)
3185 ID *id_to = entry_item->id_pointer.to;
3194 "Check above ensured `id_to` is a liboverride, so it should be a real one (not "
3195 "an embedded one)");
3203 bmain, id_to, id_root, library_indirect_level, is_in_partial_resync_hierarchy);
3210 if (!is_reprocessing_current_entry) {
3217 if (is_in_partial_resync_hierarchy &&
3224 &
LOG_RESYNC,
"Potential root for partial resync: %s (%p)", id_root->
name, id_root->
lib);
3232 const int library_indirect_level)
3256 if (hierarchy_root ==
nullptr ||
3278 Main *bmain,
ID *
id,
const int library_indirect_level)
3282 if (
id->override_library->hierarchy_root ==
id ||
3286 BLI_assert(
id->override_library->hierarchy_root !=
id ||
3287 id->override_library->runtime ==
nullptr ||
3288 (
id->override_library->runtime->tag &
3306 to_id_entry = to_id_entry->
next)
3311 ID *to_id = to_id_entry->id_pointer.to;
3317 bmain, to_id, library_indirect_level))
3331 const int library_indirect_level)
3362 bmain, id_iter,
nullptr, library_indirect_level,
false);
3414 bmain, id_iter, library_indirect_level))
3420 "ID %s (%p) detected as only related to its hierarchy root by 'reversed' "
3421 "relationship(s) (e.g. object parenting), tagging it as needing "
3429 "ID %s (%p) detected as 'isolated' from its hierarchy root, tagging it as needing "
3462 if (id_iter != hierarchy_root) {
3464 "Found root ID '%s' for partial resync root ID '%s'",
3465 hierarchy_root->
name,
3499 Collection *override_resync_residual_storage,
3500 const int library_indirect_level,
3503 const bool do_reports_recursive_resync_timing = (library_indirect_level != 0);
3520 data.is_override =
false;
3521 data.is_resync =
true;
3534 data.root_set(
id->override_library->reference);
3554 &
LOG_RESYNC,
"ID %s (%p) was already tagged as needing resync",
id->name,
id->lib);
3566 entry_item = entry_item->
next)
3571 ID *id_to = entry_item->id_pointer.to;
3576 "ID %s (%p) now tagged as needing resync because they use linked %s (%p) that "
3577 "now needs to be overridden",
3599 for (
const auto &item : id_roots.
items()) {
3600 ID *id_root = item.key;
3603 "Checking validity of computed TODO data for root '%s'... \n",
3608 ID *id_resync_root =
static_cast<ID *
>(id_resync_root_iter->
link);
3610 if (id_resync_roots->
list != id_resync_roots->
last_node || id_resync_root != id_root) {
3612 "Hierarchy root ID is tagged for resync, yet it is not the only partial "
3613 "resync roots, this should not happen."
3615 "\n\tFirst Resync root ID: %s"
3616 "\n\tLast Resync root ID: %s",
3622 for (
LinkNode *id_resync_root_iter = id_resync_roots->
list; id_resync_root_iter !=
nullptr;
3623 id_resync_root_iter = id_resync_root_iter->
next)
3625 ID *id_resync_root =
static_cast<ID *
>(id_resync_root_iter->link);
3627 if (id_resync_root == id_root) {
3628 if (id_resync_root_iter != id_resync_roots->
list ||
3629 id_resync_root_iter != id_resync_roots->
last_node)
3632 "Resync root ID is same as root ID of the override hierarchy, yet other "
3633 "resync root IDs are also defined, this should not happen at this point."
3635 "\n\tFirst Resync root ID: %s"
3636 "\n\tLast Resync root ID: %s",
3650 ListBaseT<ID> no_main_ids_list = {
nullptr};
3652 for (
const auto &item : id_roots.
items()) {
3653 ID *id_root = item.key;
3662 "Resyncing all dependencies under root %s (%p), first one being '%s'...",
3664 reinterpret_cast<void *
>(
library),
3667 new_to_old_libraries_map,
3671 id_resync_roots->
list,
3673 override_resync_residual_storage,
3679 reports->
count.resynced_lib_overrides++;
3691 for (
ID &id_iter : no_main_ids_list.items_mutable()) {
3694 no_main_ids_list.clear_no_delete();
3702 bool process_lib_level_again =
false;
3710 const bool need_reseync_original = (
id->override_library->runtime !=
nullptr &&
3711 (
id->override_library->runtime->tag &
3714 const bool is_isolated_from_root = (
id->override_library->runtime !=
nullptr &&
3715 (
id->override_library->runtime->tag &
3719 if (need_resync && is_isolated_from_root) {
3723 "Deleting unused ID override %s from library level %d, still found as needing "
3724 "resync, and being isolated from its hierarchy root. This can happen when its "
3725 "otherwise unchanged linked reference was moved around in the library file (e.g. if "
3726 "an object was moved into another sub-collection of the same hierarchy).",
3734 "Keeping user-edited ID override %s from library level %d still found as "
3735 "needing resync, and being isolated from its hierarchy root. This can happen when its "
3736 "otherwise unchanged linked reference was moved around in the library file (e.g. if "
3737 "an object was moved into another sub-collection of the same hierarchy).",
3744 else if (need_resync) {
3745 if (need_reseync_original) {
3747 "ID override %s from library level %d still found as needing resync after "
3748 "tackling library level %d. Since it was originally tagged as such by "
3749 "RNA/liboverride apply code, this whole level of library needs to be processed "
3753 library_indirect_level);
3754 process_lib_level_again =
true;
3763 "ID override %s from library level %d still found as needing resync after "
3764 "tackling library level %d. However, it was not tagged as such by "
3765 "RNA/liboverride apply code, so ignoring it",
3768 library_indirect_level);
3772 else if (need_reseync_original) {
3776 else if (is_isolated_from_root) {
3779 "ID override %s from library level %d still tagged as isolated from its hierarchy root, "
3780 "it should have been either properly resynced or removed at that point.",
3795 {.prevent_liboverride_hierarchy_root_ensure =
true, .prevent_invariants_update =
true});
3813 processed_ids.
add(
id);
3824 if (do_reports_recursive_resync_timing) {
3828 return process_lib_level_again;
3855 "Linked id '%s' from '%s' uses local ID '%s')",
3874 Library *id_lib_valid =
id->lib;
3880 return id_lib_valid;
3883 Library *id_lib = get_real_library(
id);
3885 Library *id_owner_lib = get_real_library(id_owner);
3886 if (id_lib == id_owner_lib) {
3890 const int owner_library_indirect_level = id_owner_lib ? id_owner_lib->
runtime->
temp_index : 0;
3891 auto store_depth_dependencies_info =
3892 [&
data, id_owner,
id, owner_library_indirect_level]() ->
void {
3893 if (owner_library_indirect_level >=
id->lib->runtime->temp_index) {
3894 const int next_temp_index = owner_library_indirect_level + 1;
3897 if (user_ids.
size() > next_temp_index) {
3900 user_ids.
resize(next_temp_index + 1, {
nullptr,
nullptr});
3901 user_ids[next_temp_index] = {id_owner,
id};
3905 data.has_depth_overflows =
true;
3906 store_depth_dependencies_info();
3907 if (
id->lib->runtime->temp_index > 0) {
3915 store_depth_dependencies_info();
3918 if (owner_library_indirect_level >=
id->lib->runtime->temp_index) {
3919 id->lib->runtime->temp_index = owner_library_indirect_level + 1;
3920 data.do_continue =
true;
3936 library.runtime->temp_index = 1;
3953 int library_indirect_level_max = 0;
3955 library_indirect_level_max = std::max(
library.runtime->temp_index, library_indirect_level_max);
3962 std::string deps_chain;
3964 for (
auto [id_owner,
id] : lib_user_ids) {
3966 if (!(
id && id_owner)) {
3969 deps_chain += fmt::format(
3970 "\tDepth level {: >3}: {: >32} | {: <32} ---> {: >32} | {}\n",
3973 id_owner->lib ?
BKE_id_name(id_owner->lib->id) :
"<Local>",
3978 "Levels of indirect usages of library '%s' is way too high, there are most "
3979 "likely dependency loops, skipping further building loops\n%s",
3981 deps_chain.c_str());
3985 return library_indirect_level_max;
3997 Scene *new_scene =
nullptr;
4014 "Provided scene '%s' is not local, using instead local scene '%s', view-layer "
4015 "'%s' as container for the library override leftover collections and objects",
4023 if (!view_layer || !scene) {
4025 "Provided scene '%s' is not usable as container for the library override leftover "
4026 "collections and objects, these may not be instantiated at all",
4032#define OVERRIDE_RESYNC_RESIDUAL_STORAGE_NAME "OVERRIDE_RESYNC_LEFTOVERS"
4035 if (override_resync_residual_storage !=
nullptr &&
4038 override_resync_residual_storage =
nullptr;
4040 if (override_resync_residual_storage ==
nullptr) {
4047 const Object *old_active_object =
nullptr;
4048 if (scene && view_layer) {
4059 while (library_indirect_level >= 0) {
4060 int level_reprocess_count = 0;
4074 new_to_old_libraries_map,
4077 override_resync_residual_storage,
4078 library_indirect_level,
4081 level_reprocess_count++;
4082 if (level_reprocess_count > 100) {
4085 "Need to reprocess resync for library level %d more than %d times, aborting. This is "
4086 "either caused by extremely complex liboverride hierarchies, or a bug",
4087 library_indirect_level,
4088 level_reprocess_count);
4092 "Applying reprocess %d for resyncing at library level %d",
4093 level_reprocess_count,
4094 library_indirect_level);
4096 library_indirect_level--;
4102 if (scene && view_layer) {
4109 override_resync_residual_storage,
4121 "library '%s' contains some linked overrides that required recursive resync, "
4122 "consider updating it",
4144 data.scene =
nullptr;
4147 data.is_override =
true;
4148 data.is_resync =
false;
4150 data.root_set(id_root);
4190 switch (
id.id_type()) {
4192 Object &ob = id_cast<Object &>(
id);
4213 bArmature &arm = id_cast<bArmature &>(
id);
4243 if (
id->override_library) {
4248 if (shape_key !=
nullptr) {
4253 if (node_tree !=
nullptr) {
4258 Collection *master_collection =
reinterpret_cast<Scene *
>(
id)->master_collection;
4259 if (master_collection !=
nullptr) {
4285 std::make_optional<Map<StringRefNull, IDOverrideLibraryProperty *>>();
4311 if (op ==
nullptr) {
4312 op = MEM_new<IDOverrideLibraryProperty>(__func__);
4324 else if (r_created) {
4340 idpoin, library_prop->
rna_path, r_override_poin, r_override_prop, r_index);
4352 opop_dst = opop_dst->next, opop_src = opop_src->next)
4371 const char *old_rna_path,
4372 const char *new_rna_path)
4380 if (liboverride_property ==
nullptr) {
4385 MEM_SAFE_DELETE(liboverride_property->
rna_path);
4389 liboverride_runtime.
add(liboverride_property->
rna_path, liboverride_property);
4396 const bool do_runtime_updates)
4399 liboverride->runtime->rna_path_to_override_properties)
4401 liboverride->runtime->rna_path_to_override_properties->remove(liboverride_property->
rna_path);
4416 if (liboverride_property ==
nullptr) {
4432 ListBaseT<IDOverrideLibraryPropertyOperation> *liboverride_operations,
4433 const char *subitem_main_name,
4434 const char *subitem_other_name,
4435 const std::optional<const ID *> &subitem_main_id,
4436 const std::optional<const ID *> &subitem_other_id,
4437 const size_t offesetof_opop_main_name,
4438 const size_t offesetof_opop_other_name,
4439 const size_t offesetof_opop_main_id,
4440 const size_t offesetof_opop_other_id)
4442 const bool do_ids(subitem_main_id);
4445 liboverride_operations, subitem_main_name,
int(offesetof_opop_main_name)));
4448 reinterpret_cast<Link *
>(opop), subitem_main_name,
int(offesetof_opop_main_name))))
4450 const char *opop_other_name = *
reinterpret_cast<const char **
>(
reinterpret_cast<char *
>(opop) +
4451 offesetof_opop_other_name);
4454 if (do_ids && opop_use_id) {
4456 const ID *opop_main_id = *
reinterpret_cast<const ID **
>(
reinterpret_cast<char *
>(opop) +
4457 offesetof_opop_main_id);
4458 if (*subitem_main_id != opop_main_id) {
4461 const ID *opop_other_id = *
reinterpret_cast<const ID **
>(
reinterpret_cast<char *
>(opop) +
4462 offesetof_opop_other_id);
4463 if (*subitem_other_id != opop_other_id) {
4470 if ((do_ids && opop_use_id) || (!do_ids && !opop_use_id)) {
4471 if (!subitem_other_name && !opop_other_name) {
4474 if (subitem_other_name && opop_other_name &&
STREQ(subitem_other_name, opop_other_name)) {
4487 const char *subitem_refname,
4488 const char *subitem_locname,
4489 const std::optional<const ID *> &subitem_refid,
4490 const std::optional<const ID *> &subitem_locid,
4491 const int subitem_refindex,
4492 const int subitem_locindex,
4496 BLI_assert(!subitem_refid == !subitem_locid);
4499 const int subitem_defindex = -1;
4505 if (subitem_locname !=
nullptr) {
4517 if (opop !=
nullptr) {
4522 if (subitem_refname !=
nullptr) {
4534 if (opop !=
nullptr) {
4542 sizeof(subitem_locindex),
4551 sizeof(subitem_refindex),
4559 if (!strict && (subitem_locindex != subitem_defindex)) {
4563 sizeof(subitem_defindex),
4579 const char *subitem_refname,
4580 const char *subitem_locname,
4581 const std::optional<ID *> &subitem_refid,
4582 const std::optional<ID *> &subitem_locid,
4583 const int subitem_refindex,
4584 const int subitem_locindex,
4589 BLI_assert(!subitem_refid == !subitem_locid);
4592 liboverride_property,
4602 if (opop ==
nullptr) {
4603 opop = MEM_new<IDOverrideLibraryPropertyOperation>(__func__);
4605 if (subitem_locname) {
4608 if (subitem_refname) {
4614 if (subitem_refid) {
4626 else if (r_created) {
4642 if (opop_src->
label) {
4659 MEM_delete(opop->
label);
4679 MEM_SAFE_DELETE(liboverride_property_operation.
label);
4681 MEM_SAFE_DELETE(liboverride_property_operation.
tooltip);
4685bool IDOverrideLibraryPropertyOperation::operator==(
4690 (this->subitem_reference_id ==
b.subitem_reference_id) &&
4691 (this->subitem_local_id ==
b.subitem_local_id) &&
4692 (this->subitem_reference_index ==
b.subitem_reference_index) &&
4693 (this->subitem_local_index ==
b.subitem_local_index) &&
4694 ((!this->subitem_reference_name && !
b.subitem_reference_name) ||
4695 (this->subitem_reference_name &&
b.subitem_reference_name &&
4697 ((!this->subitem_local_name && !
b.subitem_local_name) ||
4698 (this->subitem_local_name &&
b.subitem_local_name &&
4711 switch (liboverride_property_operation->
operation) {
4723 if (!ptr_storage || !*ptr_storage || !prop_storage) {
4724 BLI_assert_msg(0,
"Missing data to apply differential override operation.");
4733 if ((!ptr_dst || !*ptr_dst || !prop_dst) || (!ptr_src || !*ptr_src || !prop_src)) {
4750 "Library override templates have been removed: removing all override data from "
4751 "the data-block '%s'",
4760 "Data corruption: data-block '%s' is using itself as library override reference, "
4761 "removing all override data",
4770 "Data corruption: data-block '%s' is using another local data-block ('%s') as "
4771 "library override reference, removing all override data",
4789 "Data corruption: data-block `%s` has a Library Override property with no RNA path",
4807 ID *liboverride_id =
id;
4850 BLI_assert(local->id_type() == reference->id_type());
4852 if (local->id_type() ==
ID_OB) {
4895 BLI_assert(local->id_type() == reference->id_type());
4907 if (local->id_type() ==
ID_OB) {
4955 if (local->id_type() ==
ID_OB) {
4979 liboverride_match_flags,
4980 &local_report_flags);
4983 CLOG_DEBUG(&
LOG,
"We did restore some properties of %s from its reference", local->
name);
4987 &
LOG,
"We did tag some properties of %s for restoration from its reference", local->
name);
4996 if (r_report_flags !=
nullptr) {
4997 *r_report_flags = (*r_report_flags | local_report_flags);
5046 if (r_report_flags !=
nullptr) {
5060 ID *
id =
static_cast<ID *
>(taskdata);
5073 const bool force_auto,
5074 int *r_report_flags)
5078#ifdef DEBUG_OVERRIDE_TIMEIT
5111 "Ensuring that all view-layers in Main are synced with their collections failed");
5116 create_pool_data.
bmain = bmain;
5139 if (
Collection *scene_collection =
reinterpret_cast<Scene *
>(
id)->master_collection) {
5186 bmain,
reinterpret_cast<int *
>(&create_pool_data.
report_flags));
5191 if (r_report_flags !=
nullptr) {
5199#ifdef DEBUG_OVERRIDE_TIMEIT
5229 const bool do_reset_system_override)
5231 bool was_op_deleted =
false;
5233 if (do_reset_system_override) {
5238 bool do_op_delete =
true;
5240 if (is_collection || op.rna_prop_type ==
PROP_POINTER) {
5255 if (is_collection) {
5275 was_op_deleted =
true;
5279 if (was_op_deleted) {
5286 return was_op_deleted;
5291 const bool do_reset_system_override)
5310 const bool do_reset_system_override)
5317 if (entry_vp ==
nullptr) {
5336 to_id_entry = to_id_entry->
next)
5342 if (to_id_entry->id_pointer.to !=
nullptr) {
5343 ID *to_id = to_id_entry->id_pointer.to;
5353 const bool do_reset_system_override)
5379 if (liboverride_property !=
nullptr) {
5381 liboverride_property->
tag |= tag;
5384 liboverride_property->
tag &= ~tag;
5436 if (op.operations.is_empty()) {
5460 if (id_local->id_type() ==
ID_SCE) {
5520 if (tmp_id ==
nullptr) {
5527 tmp_id->
lib = local->
lib;
5539 if (local_key !=
nullptr && tmp_key !=
nullptr) {
5562 if (local_key !=
nullptr && tmp_key !=
nullptr) {
5570 local_key->
from = local;
5571 tmp_key->
from = tmp_id;
5580 if (local->id_type() ==
ID_AR) {
5584 if (ob.
pose !=
nullptr && ob.
data == local) {
5624 if (
id->override_library !=
nullptr) {
5659 switch (operation) {
5671 return "Insert After";
5673 return "Insert Before";
5683 const char *line_prefix =
"";
5684 if (intro_txt !=
nullptr) {
5685 std::cout << intro_txt <<
"\n";
5690 std::cout << line_prefix << op.
rna_path <<
" [";
5692 std::cout <<
" UNUSED ";
5697 std::cout << line_prefix << line_prefix
5700 std::cout <<
" UNUSED ";
5703 std::cout <<
" MATCH_REF ";
#define FOREACH_MAIN_ID_END
#define FOREACH_MAIN_LISTBASE_ID_END
#define FOREACH_MAIN_LISTBASE_ID_BEGIN(_lb, _id)
#define FOREACH_MAIN_LISTBASE_END
#define FOREACH_MAIN_LISTBASE_BEGIN(_bmain, _lb)
#define FOREACH_MAIN_ID_BEGIN(_bmain, _id)
#define BLI_MEMARENA_STD_BUFSIZE
Platform independent time functions.
Utility defines for timing/benchmarks.
#define TIMEIT_START_AVERAGED(var)
#define TIMEIT_END_AVERAGED(var)
external readfile function prototypes.
#define CLOG_ERROR(clg_ref,...)
#define CLOG_DEBUG(clg_ref,...)
#define CLOG_WARN(clg_ref,...)
ID and Library types, which are fundamental for SDNA.
#define ID_IS_OVERRIDE_LIBRARY_VIRTUAL(_id)
#define ID_IS_PACKED(_id)
#define ID_IS_OVERRIDE_LIBRARY_REAL(_id)
#define ID_IS_LINKED(_id)
#define ID_REAL_USERS(id)
#define ID_IS_OVERRIDE_LIBRARY(_id)
Object groups, one object can be in many groups at once.
Object is a sort of wrapper for general info.
#define OB_DATA_SUPPORT_ID(_id_type)
#define USER_DEVELOPER_TOOL_TEST(userdef, member)
Read Blender memory allocation and freeing.
Provides wrapper around system-specific atomic primitives, and some extensions (faked-atomic operatio...
ATOMIC_INLINE uint32_t atomic_fetch_and_or_uint32(uint32_t *p, uint32_t x)
#define BLI_assert_unreachable()
#define UNUSED_VARS_NDEBUG(...)
#define BLI_assert_msg(a, msg)
ValueIterator values() const &
bool add(const Key &key, const Value &value)
Value lookup_default(const Key &key, const Value &default_value) const
Value & lookup_or_add_cb(const Key &key, const CreateValueF &create_value)
bool add_as(ForwardKey &&key, ForwardValue &&...value)
bool contains_as(const ForwardKey &key) const
bool contains(const Key &key) const
Value lookup_default_as(const ForwardKey &key, ForwardValue &&...default_value) const
Value pop_default(const Key &key, const Value &default_value)
ItemIterator items() const &
bool contains(const Key &key) const
bool remove(const Key &key)
constexpr const char * c_str() const
constexpr StringRefNull()
void append(const T &value)
void resize(const int64_t new_size)
void add(ID *old_id, ID *new_id)
CCL_NAMESPACE_BEGIN struct Options options
void camera(KernelGlobals &kg, const ShadingData &sd, float3 &outview, float &outdepth, float &outdist)
#define OVERRIDE_RESYNC_RESIDUAL_STORAGE_NAME
#define HIERARCHY_BREAKING_ID_TYPES
bool is_auto_resync_enabled()
bNodeTree * node_tree_from_id(ID *id)
static bool lib_override_library_create_do(Main *bmain, Scene *scene, Library *owner_library, ID *id_root_reference, ID *id_hierarchy_root_reference, const bool do_fully_editable)
bool BKE_collection_delete(Main *bmain, Collection *collection, bool hierarchy)
@ RNA_OVERRIDE_MATCH_RESULT_RESTORED
@ RNA_OVERRIDE_MATCH_RESULT_CREATED
@ RNA_OVERRIDE_MATCH_RESULT_INIT
@ RNA_OVERRIDE_MATCH_RESULT_RESTORE_TAGGED
static void lib_override_library_operations_create(Main *bmain, ID *local, const eRNAOverrideMatch liboverride_match_flags, eRNAOverrideMatchResult *r_report_flags)
void BKE_main_relations_free(Main *bmain)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
static void lib_override_library_property_copy(IDOverrideLibraryProperty *op_dst, IDOverrideLibraryProperty *op_src)
void BKE_lib_override_library_tag_set(IDOverrideLibrary &liboverride, IDOverrideLibraryTag tag, bool value)
PointerRNA RNA_property_pointer_get(PointerRNA *ptr, PropertyRNA *prop)
void BKE_lib_override_library_clear(IDOverrideLibrary *liboverride, bool do_id_user)
@ NLATRACK_OVERRIDELIBRARY_LOCAL
char * STRNCPY(char(&dst)[N], const char *src)
Object * BKE_view_layer_active_object_get(const ViewLayer *view_layer)
@ LIBRARY_TAG_RESYNC_REQUIRED
static void lib_override_id_swap(Main *bmain, ID *id_local, ID *id_temp)
IDOverrideLibraryPropertyOperation * BKE_lib_override_library_property_operation_find(IDOverrideLibraryProperty *liboverride_property, const char *subitem_refname, const char *subitem_locname, const std::optional< const ID * > &subitem_refid, const std::optional< const ID * > &subitem_locid, int subitem_refindex, int subitem_locindex, bool strict, bool *r_strict)
void BKE_id_delete(Main *bmain, void *idv, const BKEIDDeleteOptions &options={}) ATTR_NONNULL()
void BKE_lib_query_unused_ids_tag(Main *bmain, int tag, LibQueryUnusedIDsData ¶meters)
MemArena * BLI_memarena_new(size_t bufsize, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL ATTR_NONNULL(2) ATTR_MALLOC
bool BKE_lib_override_library_create(Main *bmain, Scene *scene, ViewLayer *view_layer, Library *owner_library, ID *id_root_reference, ID *id_hierarchy_root_reference, ID *id_instance_hint, ID **r_id_root_override, const bool do_fully_editable)
void BKE_libblock_relink_ex(Main *bmain, void *idv, void *old_idv, void *new_idv, int remap_flags) ATTR_NONNULL(2)
static void lib_override_library_property_delete(IDOverrideLibrary *liboverride, IDOverrideLibraryProperty *liboverride_property, const bool do_runtime_updates)
bool BKE_lib_override_library_is_user_edited(const ID *id)
static int foreachid_is_hierarchy_leaf_fn(LibraryIDLinkCallbackData *cb_data)
static void lib_override_resync_tagging_finalize(Main *bmain, Map< ID *, LinkNodePair * > &id_roots, const int library_indirect_level)
bool BKE_lib_override_library_property_operation_operands_validate(IDOverrideLibraryPropertyOperation *liboverride_property_operation, PointerRNA *ptr_dst, PointerRNA *ptr_src, PointerRNA *ptr_storage, PropertyRNA *prop_dst, PropertyRNA *prop_src, PropertyRNA *prop_storage)
bool BKE_scene_view_layers_synced_ensure(const Main &bmain, const Scene *scene)
static void lib_override_library_property_operation_copy(IDOverrideLibraryPropertyOperation *opop_dst, IDOverrideLibraryPropertyOperation *opop_src)
static bool lib_override_resync_tagging_finalize_recursive_check_from(Main *bmain, ID *id, const int library_indirect_level)
StringRefNull BKE_lib_override_operation_as_string(const eID_OverrideLib_Op operation)
void BLI_insertlinkreplace(ListBase *listbase, void *vreplacelink, void *vnewlink) ATTR_NONNULL(1
PointerRNA RNA_id_pointer_create(ID *id)
static void lib_override_library_id_hierarchy_recursive_reset(Main *bmain, ID *id_root, const bool do_reset_system_override)
static int lib_override_libraries_index_define(Main *bmain)
static void override_library_properties_validate(const ID &id, IDOverrideLibrary &liboverride, ReportList *reports)
void void void void void void BLI_duplicatelist(ListBase *dst, const ListBase *src) ATTR_NONNULL(1
void BKE_pose_ensure(Main *bmain, Object *ob, bArmature *arm, bool do_id_user)
void BKE_lib_override_library_property_operation_ui_info_set(IDOverrideLibraryPropertyOperation &liboverride_property_operation, StringRefNull label, StringRefNull tooltip)
bool BKE_idtype_idcode_is_linkable(short idcode)
@ RNA_OVERRIDE_APPLY_FLAG_SKIP_RESYNC_CHECK
@ RNA_OVERRIDE_APPLY_FLAG_IGNORE_ID_POINTERS
@ RNA_OVERRIDE_APPLY_FLAG_RESTORE_ONLY
@ RNA_OVERRIDE_APPLY_FLAG_NOP
void void BKE_libblock_remap(Main *bmain, void *old_idv, void *new_idv, int remap_flags) ATTR_NONNULL(1
void BKE_lib_override_flag_subdata_local(ID &id)
@ LIBOVERRIDE_PROP_TAG_NEEDS_RETORE
@ LIBOVERRIDE_PROP_OP_TAG_UNUSED
void BKE_main_namemap_destroy(UniqueName_Map **r_name_map) ATTR_NONNULL()
void BKE_id_free_ex(Main *bmain, void *idv, int flag_orig, bool use_flag_from_idtag)
void * BLI_findstring(const ListBase *listbase, const char *id, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void BKE_pose_clear_pointers(bPose *pose)
static bool lib_override_resync_id_lib_level_is_valid(ID *id, const int library_indirect_level, const bool do_strict_equal)
void lib_id_copy_ensure_local(Main *bmain, const ID *old_id, ID *new_id, const int flags)
void BKE_lib_override_id_tag_on_deg_tag_from_user(ID *id)
static ID * lib_override_library_create_from(Main *bmain, Library *owner_library, ID *reference_id, const int lib_id_copy_flags)
static bool lib_override_linked_group_tag_collections_keep_tagged_check_recursive(LibOverrideGroupTagData *data, Collection *collection)
ID * BKE_lib_override_library_create_from_id(Main *bmain, ID *reference_id, bool do_tagged_remap)
@ ID_REMAP_SKIP_INDIRECT_USAGE
@ ID_REMAP_FORCE_USER_REFCOUNT
@ ID_REMAP_FORCE_NEVER_NULL_USAGE
@ ID_REMAP_SKIP_OVERRIDE_LIBRARY
void BKE_lib_override_library_operations_restore(Main *bmain, ID *local, int *r_report_flags)
static CLG_LogRef LOG_RESYNC
static ID * lib_override_library_resync_search_missing_ids_data(LibOverrideMissingIDsData &missing_ids, Map< ID *, ID * > &linkedref_to_old_override, ID *id_override)
@ RNA_OVERRIDE_COMPARE_IGNORE_NON_OVERRIDABLE
@ RNA_OVERRIDE_COMPARE_RESTORE
@ RNA_OVERRIDE_COMPARE_TAG_FOR_RESTORE
@ RNA_OVERRIDE_COMPARE_CREATE
@ RNA_OVERRIDE_COMPARE_IGNORE_OVERRIDDEN
@ LIB_ID_FREE_NO_NAMEMAP_REMOVE
bool BKE_lib_override_library_resync(Main *bmain, Scene *scene, ViewLayer *view_layer, ID *id_root, Collection *override_resync_residual_storage, bool do_hierarchy_enforce, BlendFileReadReport *reports)
static LibOverrideMissingIDsData_Key lib_override_library_resync_missing_id_key(ID *id)
const char * BKE_id_name(const ID &id)
bool BKE_lib_override_library_is_system_defined(const Main *bmain, const ID *id)
void id_fake_user_set(ID *id)
@ LIBOVERRIDE_OP_INSERT_AFTER
@ LIBOVERRIDE_OP_SUBTRACT
@ LIBOVERRIDE_OP_MULTIPLY
@ LIBOVERRIDE_OP_INSERT_BEFORE
bool BKE_lib_override_library_status_check_local(Main *bmain, ID *local)
void BKE_lib_override_library_main_tag(Main *bmain, eID_OverrideLib_PropTag tag, bool do_set)
@ LIBOVERRIDE_FLAG_NO_HIERARCHY
@ LIBOVERRIDE_FLAG_SYSTEM_DEFINED
@ LIB_ID_COPY_RIGID_BODY_NO_COLLECTION_HANDLING
@ LIB_ID_COPY_NO_LIB_OVERRIDE
@ LIB_ID_COPY_NO_LIB_OVERRIDE_LOCAL_DATA_FLAG
void RNA_struct_override_apply(Main *bmain, PointerRNA *id_ptr_dst, PointerRNA *id_ptr_src, PointerRNA *id_ptr_storage, IDOverrideLibrary *liboverride, const eRNAOverrideApplyFlag flag)
LibOverride_HierarchyRoot_ValidateOptions
@ ONLY_PROCESS_NULL_ROOT_POINTERS
@ REPORT_NULL_ROOT_POINTERS
void void BLI_linklist_prepend(LinkNode **listp, void *ptr) ATTR_NONNULL(1)
void BKE_main_namemap_remove_id(Main &bmain, ID &id)
bool BKE_collection_has_object(Collection *collection, const Object *ob)
void BLI_task_pool_work_and_wait(TaskPool *pool)
eMainIDRelationsEntryTags
@ MAINIDRELATIONS_ENTRY_TAGS_PROCESSED_TO
@ MAINIDRELATIONS_ENTRY_TAGS_DOIT
@ MAINIDRELATIONS_ENTRY_TAGS_INPROGRESS
@ MAINIDRELATIONS_ENTRY_TAGS_PROCESSED_FROM
@ MAINIDRELATIONS_ENTRY_TAGS_PROCESSED
void BKE_layer_collection_resync_forbid(Main &bmain)
void * BLI_task_pool_user_data(TaskPool *pool)
void BKE_lib_override_library_update(Main *bmain, ID *local)
@ eShaderFxFlag_OverrideLibrary_Local
void id_sort_by_name(ListBaseT< ID > *lb, ID *id, ID *id_sorting_hint)
static void lib_override_remapper_overrides_add(id::IDRemapper &id_remapper, ID *reference_id, ID *local_id)
int BLI_linklist_index(const LinkNode *list, const void *ptr) ATTR_WARN_UNUSED_RESULT
bool BKE_main_collection_sync_remap(const Main *bmain)
PropertyType RNA_property_type(PropertyRNA *prop)
AnimData * BKE_animdata_from_id(const ID *id)
static void lib_override_overrides_group_tag(LibOverrideGroupTagData *data)
void BKE_lib_override_library_validate(Main *bmain, ID *id, ReportList *reports)
static void lib_override_library_property_clear(IDOverrideLibraryProperty *op)
int BLI_findindex(const ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
Key * BKE_key_from_id(ID *id)
@ G_LIBOVERRIDE_NO_AUTO_RESYNC
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
void BKE_lib_override_library_id_unused_cleanup(ID *local)
void DEG_id_tag_update_ex(Main *bmain, ID *id, unsigned int flags)
void * BLI_findstring_ptr(const ListBase *listbase, const char *id, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void BKE_lib_override_library_main_operations_restore(Main *bmain, int *r_report_flags)
static bool lib_override_hierarchy_dependencies_skip_check(ID *owner_id, ID *other_id, const bool check_override)
static Map< StringRefNull, IDOverrideLibraryProperty * > & override_library_rna_path_mapping_ensure(IDOverrideLibrary *liboverride)
StructRNA * RNA_property_pointer_type(PointerRNA *ptr, PropertyRNA *prop)
void * MEM_new_zeroed(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
static void lib_override_group_tag_data_object_to_collection_init(LibOverrideGroupTagData *data)
void BKE_layer_collection_resync_allow(Main &bmain)
static void lib_override_cleanup_after_resync(Main *bmain)
void BKE_lib_override_library_delete(Main *bmain, ID *id_root)
static bool lib_override_library_resync(Main *bmain, const Map< Library *, Library * > *new_to_old_libraries_map, Scene *scene, ViewLayer *view_layer, ID *id_root, LinkNode *id_resync_roots, ListBaseT< ID > *no_main_ids_list, Collection *override_resync_residual_storage, const bool do_hierarchy_enforce, const bool do_post_process, BlendFileReadReport *reports)
@ TAG_RESYNC_ISOLATED_FROM_ROOT
@ TAG_NEED_RESYNC_ORIGINAL
@ CAM_BGIMG_FLAG_OVERRIDE_LIBRARY_LOCAL
void DEG_id_tag_update(ID *id, unsigned int flags)
void BKE_lib_override_library_main_hierarchy_root_ensure(Main *bmain, LibOverride_HierarchyRoot_ValidateOptions options={}, ReportList *reports=nullptr)
void BKE_report(ReportList *reports, eReportType type, const char *message)
BMesh const char void * data
Key ** BKE_key_from_id_p(ID *id)
void BKE_lib_override_library_properties_tag(IDOverrideLibrary *liboverride, eID_OverrideLib_PropTag tag, bool do_set)
void BKE_collection_add_from_object(Main *bmain, Scene *scene, const Object *ob_src, Collection *collection_dst)
bool BKE_collection_is_in_scene(Collection *collection)
static bool lib_override_library_main_resync_id_skip_check(ID *id, const int library_indirect_level)
bool BKE_collection_is_empty(const Collection *collection)
void BKE_main_ensure_invariants(Main &bmain, std::optional< Span< ID * > > modified_ids=std::nullopt)
static void lib_override_library_create_post_process(Main *bmain, Scene *scene, ViewLayer *view_layer, const Library *owner_library, ID *id_root, ID *id_instance_hint, Collection *residual_storage, const Object *old_active_object, const bool is_resync)
BLI_INLINE IDOverrideLibraryRuntime * override_library_runtime_ensure(IDOverrideLibrary *liboverride)
void BKE_lib_override_library_operations_tag(IDOverrideLibraryProperty *liboverride_property, eID_OverrideLib_PropTag tag, bool do_set)
void * BLI_listbase_findafter_string_ptr(Link *link, const char *id, int offset)
bool BKE_main_view_layers_synced_ensure(const Main *bmain)
FCurve * BKE_animadata_fcurve_find_by_rna_path(AnimData *animdata, const char *rna_path, const int rna_index, bAction **r_action, bool *r_driven)
bool RNA_struct_override_matches(Main *bmain, PointerRNA *ptr_local, PointerRNA *ptr_reference, const char *root_path, const size_t root_path_len, IDOverrideLibrary *liboverride, const eRNAOverrideMatch flags, eRNAOverrideMatchResult *r_report_flags)
void BKE_lib_override_library_make_local(Main *bmain, ID *id)
void BLI_freelinkN(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
size_t BKE_id_multi_tagged_delete(Main *bmain, const BKEIDDeleteOptions &options={}) ATTR_NONNULL()
void BKE_collection_add_from_collection(Main *bmain, Scene *scene, Collection *collection_src, Collection *collection_dst)
static void lib_override_prefill_newid_from_existing_overrides(Main *bmain, ID *id_hierarchy_root)
static IDOverrideLibraryPropertyOperation * liboverride_opop_find_name_lib_iterative(ListBaseT< IDOverrideLibraryPropertyOperation > *liboverride_operations, const char *subitem_main_name, const char *subitem_other_name, const std::optional< const ID * > &subitem_main_id, const std::optional< const ID * > &subitem_other_id, const size_t offesetof_opop_main_name, const size_t offesetof_opop_other_name, const size_t offesetof_opop_main_id, const size_t offesetof_opop_other_id)
bool BKE_view_layer_synced_ensure(const Main &bmain, const Scene *scene, ViewLayer *view_layer)
void BKE_libblock_remap_multiple(Main *bmain, bke::id::IDRemapper &mappings, const int remap_flags)
void BKE_collection_object_add_from(Main *bmain, Scene *scene, Object *ob_src, Object *ob_dst)
void BKE_lib_override_library_copy(ID *dst_id, const ID *src_id, bool do_full_copy)
bool BKE_collection_object_add(Main *bmain, Collection *collection, Object *ob)
static void lib_override_library_remap(Main *bmain, const ID *id_root_reference, Vector< std::pair< ID *, ID * > > &references_and_new_overrides, Map< ID *, ID * > &linkedref_to_old_override)
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
void BKE_lib_override_library_property_operation_delete(IDOverrideLibraryProperty *liboverride_property, IDOverrideLibraryPropertyOperation *liboverride_property_operation)
bool BKE_lib_override_library_status_check_reference(Main *bmain, ID *local)
bool BKE_collection_has_collection(const Collection *parent, const Collection *collection)
void BKE_lib_override_library_id_reset(Main *bmain, ID *id_root, bool do_reset_system_override)
IDOverrideLibraryProperty * BKE_lib_override_library_property_find(IDOverrideLibrary *liboverride, const char *rna_path)
@ LIBRARY_FLAG_IS_ARCHIVE
static void lib_override_resync_tagging_finalize_recurse(Main *bmain, ID *id_root, ID *id_from, const int library_indirect_level, bool is_in_partial_resync_hierarchy)
static void lib_override_linked_group_tag(LibOverrideGroupTagData *data)
static ID * lib_override_root_find(Main *bmain, ID *id, const int curr_level, int *r_best_level)
static bool override_library_is_valid(const ID &id, const IDOverrideLibrary &liboverride, ReportList *reports)
void BKE_main_relations_create(Main *bmain, short flag)
static LibOverrideMissingIDsData lib_override_library_resync_build_missing_ids_data(Main *bmain, const bool is_relocate)
void BKE_id_free(Main *bmain, void *idv)
bool BKE_main_namemap_validate(Main &bmain)
bool BKE_lib_override_library_property_search_and_delete(IDOverrideLibrary *liboverride, const char *rna_path)
void BKE_main_id_tag_all(Main *mainvar, int tag, bool value)
IDOverrideLibrary * BKE_lib_override_library_init(ID *local_id, ID *reference_id)
void BKE_lib_override_library_main_operations_create(Main *bmain, bool force_auto, int *r_report_flags)
void BKE_main_relations_tag_set(Main *bmain, eMainIDRelationsEntryTags tag, bool value)
void BLI_task_pool_free(TaskPool *pool)
void BKE_lib_override_library_main_resync(Main *bmain, const Map< Library *, Library * > *new_to_old_libraries_map, Scene *scene, ViewLayer *view_layer, BlendFileReadReport *reports)
bool RNA_struct_is_ID(const StructRNA *type)
static bool lib_override_library_main_resync_on_library_indirect_level(Main *bmain, const Map< Library *, Library * > *new_to_old_libraries_map, Scene *scene, ViewLayer *view_layer, Collection *override_resync_residual_storage, const int library_indirect_level, BlendFileReadReport *reports)
TaskPool * BLI_task_pool_create(void *userdata, eTaskPriority priority)
static int lib_override_sort_libraries_func(LibraryIDLinkCallbackData *cb_data)
void BKE_main_id_newptr_and_tag_clear(Main *bmain)
Set< Object * > * BKE_scene_objects_as_set(Scene *scene, Set< Object * > *objects_set)
ViewLayer * BKE_view_layer_find(const Scene *scene, const char *layer_name)
static void lib_override_library_property_operation_clear(IDOverrideLibraryPropertyOperation *opop)
void BKE_lib_id_swap(Main *bmain, ID *id_a, ID *id_b, const bool do_self_remap, const int self_remap_flags)
void BKE_lib_override_library_main_update(Main *bmain)
bool BKE_main_global_namemap_get_unique_name(Main &bmain, ID &id, char *r_name)
static void lib_override_library_main_hierarchy_id_root_ensure(Main *bmain, ID *id, Set< ID * > &processed_ids, LibOverride_HierarchyRoot_ValidateOptions options, ReportList *reports)
void BKE_lib_override_library_main_validate(Main *bmain, ReportList *reports)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void void void void BLI_linklist_append(LinkNodePair *list_pair, void *ptr) ATTR_NONNULL(1)
const std::pair< std::string, Library * > LibOverrideMissingIDsData_Key
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_linklist_free(LinkNode *list, LinkNodeFreeFP freefunc)
bool BKE_lib_override_library_is_hierarchy_leaf(Main *bmain, ID *id)
static bool lib_override_hierarchy_dependencies_recursive_tag(LibOverrideGroupTagData *data)
void BKE_lib_override_library_free(IDOverrideLibrary **liboverride, bool do_id_user)
@ COLLECTION_HIDE_VIEWPORT
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC
static void lib_override_linked_group_tag_clear_boneshapes_objects(LibOverrideGroupTagData *data)
void BLI_linklist_append_arena(LinkNodePair *list_pair, void *ptr, struct MemArena *ma) ATTR_NONNULL(1
void * BLI_listbase_bytes_find(const ListBase *listbase, const void *bytes, size_t bytes_size, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
static bool lib_override_hierarchy_dependencies_relationship_skip_check(MainIDRelationsEntryItem *relation_id_entry)
bool BKE_lib_override_library_property_rna_path_change(IDOverrideLibrary *liboverride, const char *old_rna_path, const char *new_rna_path)
IDOverrideLibraryProperty * BKE_lib_override_library_property_get(IDOverrideLibrary *liboverride, const char *rna_path, bool *r_created)
void BKE_lib_override_debug_print(IDOverrideLibrary *liboverride, const char *intro_txt)
void BKE_lib_override_library_main_unused_cleanup(Main *bmain)
bool BKE_lib_override_rna_property_find(PointerRNA *idpoin, const IDOverrideLibraryProperty *library_prop, PointerRNA *r_override_poin, PropertyRNA **r_override_prop, int *r_index)
static void lib_override_library_operations_create_cb(TaskPool *__restrict pool, void *taskdata)
static void lib_override_hierarchy_dependencies_recursive_tag_from(LibOverrideGroupTagData *data)
Base * BKE_view_layer_base_find(ViewLayer *view_layer, Object *ob)
@ ID_TAG_LIBOVERRIDE_NEED_RESYNC
@ ID_TAG_NO_USER_REFCOUNT
@ ID_TAG_LIBOVERRIDE_REFOK
@ ID_TAG_LIBOVERRIDE_AUTOREFRESH
bool BKE_lib_override_library_create_from_tag(Main *bmain, Library *owner_library, const ID *id_root_reference, ID *id_hierarchy_root, const ID *id_hierarchy_root_reference, bool do_no_main, const bool do_fully_editable)
@ eModifierFlag_OverrideLibrary_Local
BLI_INLINE void lib_override_object_posemode_transfer(ID *id_dst, ID *id_src)
static void lib_override_linked_group_tag_recursive(LibOverrideGroupTagData *data)
static void lib_override_group_tag_data_object_to_collection_init_collection_process(LibOverrideGroupTagData *data, Collection *collection)
static bool lib_override_root_is_valid(Main *bmain, ID *id)
const char * RNA_path_array_index_token_find(const char *rna_path, const PropertyRNA *array_prop)
void BKE_libblock_management_main_add(Main *bmain, void *idv)
double BLI_time_now_seconds()
ID * BKE_id_owner_get(ID *id, const bool debug_relationship_assert=true)
void DEG_relations_tag_update(Main *bmain)
@ ID_FLAG_LIB_OVERRIDE_RESYNC_LEFTOVER
@ ID_FLAG_EMBEDDED_DATA_LIB_OVERRIDE
@ BONE_COLLECTION_OVERRIDE_LIBRARY_LOCAL
std::deque< ID * > LibOverrideMissingIDsData_Value
ID * BKE_id_copy_ex(Main *bmain, const ID *id, ID **new_id_p, int flag)
@ IDWALK_CB_OVERRIDE_LIBRARY_NOT_OVERRIDABLE
@ IDWALK_CB_OVERRIDE_LIBRARY_HIERARCHY_DEFAULT
void BKE_lib_override_library_operations_create(Main *bmain, ID *local, int *r_report_flags)
bool BKE_lib_override_library_property_is_animated(const ID *id, const IDOverrideLibraryProperty *liboverride_prop, const PropertyRNA *override_rna_prop, const int rnaprop_index)
static bool lib_override_library_id_reset_do(Main *bmain, ID *id_root, const bool do_reset_system_override)
bool BKE_main_collection_sync(const Main *bmain)
void BKE_lib_override_library_property_delete(IDOverrideLibrary *liboverride, IDOverrideLibraryProperty *liboverride_property)
std::map< LibOverrideMissingIDsData_Key, LibOverrideMissingIDsData_Value > LibOverrideMissingIDsData
static void lib_override_root_hierarchy_set(Main *bmain, ID *id_root, ID *id, ID *id_from, Set< ID * > &processed_ids)
void BKE_libblock_relink_multiple(Main *bmain, const Span< ID * > ids, eIDRemapType remap_type, bke::id::IDRemapper &id_remapper, int remap_flags)
static void lib_override_overrides_group_tag_recursive(LibOverrideGroupTagData *data)
bool RNA_path_resolve_property_full(const PointerRNA *ptr, const char *path, PointerRNA *r_ptr, PropertyRNA **r_prop, int *r_index)
bool RNA_path_resolve_property(const PointerRNA *ptr, const char *path, PointerRNA *r_ptr, PropertyRNA **r_prop)
void BLI_task_pool_push(TaskPool *pool, TaskRunFunction run, void *taskdata, bool free_taskdata, TaskFreeFunction freedata)
void * BLI_memarena_calloc(MemArena *ma, size_t size) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC ATTR_ALLOC_SIZE(2)
void BKE_lib_override_library_id_hierarchy_reset(Main *bmain, ID *id_root, bool do_reset_system_override)
void BKE_library_foreach_ID_link(Main *bmain, ID *id, FunctionRef< LibraryIDLinkCallback > callback, void *user_data, LibraryForeachIDFlag flag)
IDOverrideLibraryPropertyOperation * BKE_lib_override_library_property_operation_get(IDOverrideLibraryProperty *liboverride_property, eID_OverrideLib_Op operation, const char *subitem_refname, const char *subitem_locname, const std::optional< ID * > &subitem_refid, const std::optional< ID * > &subitem_locid, int subitem_refindex, int subitem_locindex, bool strict, bool *r_strict, bool *r_created)
@ LIBOVERRIDE_OP_FLAG_IDPOINTER_ITEM_USE_ID
@ LIBOVERRIDE_OP_FLAG_IDPOINTER_MATCH_REFERENCE
void * BKE_id_new(Main *bmain, short type, const char *name)
void BKE_animdata_liboverride_post_process(ID *id)
struct ID * BKE_id_copy_in_lib(Main *bmain, std::optional< Library * > owner_library, const ID *id, std::optional< const ID * > new_owner_id, ID **new_id_p, int flag)
bool BKE_lib_override_library_id_is_user_deletable(Main *bmain, ID *id)
bool BKE_view_layer_has_collection(const ViewLayer *view_layer, const Collection *collection)
@ CONSTRAINT_OVERRIDE_LIBRARY_LOCAL
void BLI_memarena_free(MemArena *ma) ATTR_NONNULL(1)
IDOverrideLibrary * BKE_lib_override_library_get(Main *bmain, ID *id, ID *owner_id_hint, ID **r_owner_id)
Main * BKE_blender_globals_main_swap(Main *new_gmain)
ListBaseT< ID > * which_libbase(Main *bmain, short type)
Collection * BKE_collection_add(Main *bmain, Collection *collection_parent, const char *name_custom)
int resynced_lib_overrides_libraries_count
struct blender::BlendFileReadReport::@140003175311343306107257242277261221002217304000 count
LinkNode * resynced_lib_overrides_libraries
bool do_resynced_lib_overrides_libraries_list
struct blender::BlendFileReadReport::@070156237370130334241363347365056360307125257043 duration
eCamera_BGImage_Flag flag
ListBaseT< CollectionChild > children
ListBaseT< CollectionObject > gobject
char * subitem_reference_name
eID_OverrideLib_OpFlag flag
eID_OverrideLib_Op operation
struct ID * subitem_local_id
struct ID * subitem_reference_id
int subitem_reference_index
eID_OverrideLib_PropTag tag
char * subitem_local_name
ListBaseT< IDOverrideLibraryPropertyOperation > operations
eID_OverrideLib_PropTag tag
struct IDOverrideLibraryProperty * next
std::optional< Map< StringRefNull, IDOverrideLibraryProperty * > > rna_path_to_override_properties
ListBaseT< IDOverrideLibraryProperty > properties
eID_OverrideLib_Flag flag
struct ID * hierarchy_root
IDOverrideLibraryRuntime * runtime
IDOverrideLibrary * override_library
ID * hierarchy_root_id_reference
void hierarchy_root_set(ID *hierarchy_root_id)
void root_set(ID *id_root)
Set< ID * > linked_ids_hierarchy_default_override
bool id_tag_set(ID *id, const bool is_missing)
bool do_create_linked_overrides_set
Map< Object *, LinkNodePair * > linked_object_to_instantiating_collections
ID * hierarchy_root_get()
ID * hierarchy_root_id_override
bool id_tag_clear(ID *id, const bool is_missing)
eRNAOverrideMatchResult report_flags
Map< Library *, Vector< std::pair< ID *, ID * > > > dependency_trace_data
static constexpr int MAX_DEPENDENCY_DEPTH
FunctionRef< bool(ID *id)> filter_fn
std::array< int, INDEX_ID_MAX > num_total
std::array< int, INDEX_ID_MAX > num_local
LibraryForeachIDCallbackFlag cb_flag
struct Library * archive_parent_library
bke::library::LibraryRuntime * runtime
LibraryForeachIDCallbackFlag usage_flag
MainIDRelationsEntryItem * next
MainIDRelationsEntryItem * from_ids
MainIDRelationsEntryItem * to_ids
Map< const ID *, MainIDRelationsEntry * > * relations_from_pointers
ListBaseT< Collection > collections
MainIDRelations * relations
UniqueName_Map * name_map_global
ListBaseT< Library > libraries
ListBaseT< Object > objects
ListBaseT< Scene > scenes
ListBaseT< ModifierData > modifiers
ListBaseT< ShaderFxData > shader_fx
ListBaseT< bConstraint > constraints
ListBaseT< ViewLayer > view_layers
struct Collection * master_collection
ListBaseT< struct bConstraint > constraints
ListBaseT< bPoseChannel > chanbase