67#include "RNA_prototypes.hh"
76#ifdef DEBUG_OVERRIDE_TIMEIT
134 const ID **r_owner_id)
138 BLI_assert_msg(owner_id !=
nullptr,
"Liboverride-embedded ID with no owner");
139 if (r_owner_id !=
nullptr) {
140 *r_owner_id = owner_id;
145 if (r_owner_id !=
nullptr) {
148 return id->override_library;
160 const_cast<const ID *
>(
id),
161 const_cast<const ID *
>(owner_id_hint),
162 const_cast<const ID **
>(r_owner_id)));
220 op_dst = op_dst->
next, op_src = op_src->
next)
253 if ((*liboverride)->runtime !=
nullptr) {
254 if ((*liboverride)->runtime->rna_path_to_override_properties !=
nullptr) {
255 BLI_ghash_free((*liboverride)->runtime->rna_path_to_override_properties,
nullptr,
nullptr);
268 const int lib_id_copy_flags)
279 if (local_id ==
nullptr) {
315 if (reference_key !=
nullptr) {
359 const ID *override_owner_id;
370 const int rnaprop_index)
373 if (anim_data !=
nullptr) {
375 char *index_token_start =
const_cast<char *
>(
377 if (index_token_start !=
nullptr) {
378 const char index_token_start_backup = *index_token_start;
379 *index_token_start =
'\0';
381 anim_data, liboverride_prop->
rna_path, rnaprop_index,
nullptr,
nullptr);
382 *index_token_start = index_token_start_backup;
386 anim_data, liboverride_prop->
rna_path, 0,
nullptr,
nullptr);
388 if (fcurve !=
nullptr) {
441 const bool do_tagged_remap)
454 if (do_tagged_remap) {
456 Key *local_key =
nullptr;
457 if (reference_key !=
nullptr) {
472 if (reference_key !=
nullptr) {
497 id =
reinterpret_cast<Key *
>(id_iter)->from;
501 id->override_library->hierarchy_root == id_hierarchy_root)
503 id->override_library->reference->newid =
id;
506 if (reference_key !=
nullptr) {
507 reference_key->
id.
newid = id_iter;
519 id_remapper.
add(reference_id, local_id);
522 Key *local_key =
nullptr;
523 if (reference_key !=
nullptr) {
524 if (reference_id->
newid !=
nullptr) {
529 id_remapper.
add(&reference_key->
id, &local_key->
id);
535 const ID *id_root_reference,
536 ID *id_hierarchy_root,
537 const ID *id_hierarchy_root_reference,
538 const bool do_no_main,
539 const bool do_fully_editable)
547 BLI_assert(id_hierarchy_root !=
nullptr || id_hierarchy_root_reference !=
nullptr ||
551 BLI_assert(
ELEM(
nullptr, id_hierarchy_root, id_hierarchy_root_reference));
553 if (id_hierarchy_root !=
nullptr) {
566 if (!
ELEM(id_hierarchy_root_reference,
nullptr, id_root_reference)) {
573 const Library *reference_library = id_root_reference->
lib;
583 if ((reference_id->
tag &
ID_TAG_DOIT) != 0 && reference_id->
lib == reference_library &&
587 todo_id_iter->
data = reference_id;
594 for (todo_id_iter =
static_cast<LinkData *
>(todo_ids.
first); todo_id_iter !=
nullptr;
595 todo_id_iter = todo_id_iter->
next)
597 reference_id =
static_cast<ID *
>(todo_id_iter->
data);
601 if (reference_id->
newid ==
nullptr) {
607 if (reference_id->
newid ==
nullptr) {
611 if (do_fully_editable) {
619 if (reference_key !=
nullptr) {
624 reference_key->
id.
newid = &local_key->
id;
636 const bool do_remap_liboverride_hierarchy_only = (id_hierarchy_root !=
nullptr && !do_no_main);
638 if (id_hierarchy_root_reference !=
nullptr) {
639 id_hierarchy_root = id_hierarchy_root_reference->
newid;
641 else if (id_root_reference->
newid !=
nullptr &&
642 (id_hierarchy_root ==
nullptr ||
645 id_hierarchy_root = id_root_reference->
newid;
658 if (do_no_main &&
id->lib == id_root_reference->
lib &&
id->newid !=
nullptr) {
659 other_id =
id->
newid;
665 other_id->
lib =
nullptr;
679 if (!do_remap_liboverride_hierarchy_only ||
683 relinked_ids.
append(other_id);
690 ID *local_id = reference_id->
newid;
691 if (other_id == local_id) {
696 if (other_id !=
id) {
697 other_id->
lib = id_root_reference->
lib;
702 for (todo_id_iter =
static_cast<LinkData *
>(todo_ids.
first); todo_id_iter !=
nullptr;
703 todo_id_iter = todo_id_iter->
next)
705 reference_id =
static_cast<ID *
>(todo_id_iter->
data);
706 ID *local_id = reference_id->
newid;
708 if (local_id ==
nullptr) {
723 relinked_ids.
clear();
727 for (todo_id_iter =
static_cast<LinkData *
>(todo_ids.
first); todo_id_iter !=
nullptr;
728 todo_id_iter = todo_id_iter->
next)
730 reference_id =
static_cast<ID *
>(todo_id_iter->
data);
732 reference_id->
newid =
nullptr;
814 else if (is_missing) {
827 else if (is_missing) {
864 Object *ob = collection_object->ob;
872 reinterpret_cast<void ***
>(&collections_linkedlist_p)))
874 *collections_linkedlist_p =
static_cast<LinkNodePair *
>(
892 if (
data->scene !=
nullptr) {
894 data,
data->scene->master_collection);
923 const bool check_override)
926 if (
ELEM(other_id,
nullptr, owner_id)) {
930 if (other_id->
lib != owner_id->
lib) {
934 if (check_override) {
937 "When processing liboverrides, the owner ID should always be a liboverride too here.");
949#define HIERARCHY_BREAKING_ID_TYPES ID_SCE, ID_LI, ID_SCR, ID_WM, ID_WS
955#undef HIERARCHY_BREAKING_ID_TYPES
963 ID *
id =
data->root_get();
964 const bool is_override =
data->is_override;
966 if ((*
reinterpret_cast<uint *
>(&
id->tag) &
data->tag) == 0) {
984 from_id_entry = from_id_entry->
next)
989 ID *from_id = from_id_entry->id_pointer.from;
995 data->root_set(from_id);
1010 ID *
id =
data->root_get();
1011 const bool is_override =
data->is_override;
1012 const bool is_resync =
data->is_resync;
1020 return (*
reinterpret_cast<uint *
>(&
id->tag) &
data->tag) != 0;
1027 to_id_entry = to_id_entry->
next)
1032 ID *to_id = *to_id_entry->id_pointer.to;
1037 data->root_set(to_id);
1039 id->tag |=
data->tag;
1049 if ((*
reinterpret_cast<uint *
>(&
id->tag) &
data->tag) != 0 && !is_resync) {
1053 return (*
reinterpret_cast<uint *
>(&
id->tag) &
data->tag) != 0;
1059 ID *id_owner =
data->root_get();
1076 to_id_entry = to_id_entry->
next)
1081 ID *to_id = *to_id_entry->id_pointer.to;
1094 data->linked_ids_hierarchy_default_override.contains(to_id))
1098 data->root_set(to_id);
1103 data->root_set(id_owner);
1115 collection_object !=
nullptr;
1116 collection_object = collection_object->
next)
1118 Object *
object = collection_object->ob;
1119 if (
object ==
nullptr) {
1123 data->linked_ids_hierarchy_default_override.contains(&
object->id))
1131 collection_child !=
nullptr;
1132 collection_child = collection_child->
next)
1135 data, collection_child->collection))
1147 ID *id_root =
data->root_get();
1152 if (ob->id.lib != id_root->
lib) {
1155 if (ob->type ==
OB_ARMATURE && ob->pose !=
nullptr &&
1156 ((ob->id.tag &
data->tag) ||
1157 data->linked_ids_hierarchy_default_override.contains(&ob->id)))
1161 pchan = pchan->
next)
1163 if (pchan->custom !=
nullptr && &pchan->custom->id != id_root) {
1164 data->id_tag_clear(&pchan->custom->id,
bool(pchan->custom->id.tag &
ID_TAG_MISSING));
1173 if (!((collection->id.tag &
data->tag) != 0 ||
1174 data->linked_ids_hierarchy_default_override.contains(&collection->id)) ||
1175 &collection->id == id_root || collection->id.
lib != id_root->
lib)
1200 ID *id_root =
data->root_get();
1201 ID *hierarchy_root_id =
data->hierarchy_root_get();
1202 const bool is_resync =
data->is_resync;
1206 id_root->
tag |=
data->missing_tag;
1219 const bool use_linked_overrides_set = hierarchy_root_id &&
1220 hierarchy_root_id->
lib == id_root->
lib &&
1221 hierarchy_root_id != id_root;
1224 if (use_linked_overrides_set) {
1225 BLI_assert(
data->linked_ids_hierarchy_default_override.is_empty());
1226 data->linked_ids_hierarchy_default_override.add(id_root);
1227 data->linked_ids_hierarchy_default_override.add(hierarchy_root_id);
1228 data->do_create_linked_overrides_set =
true;
1231 data->root_set(hierarchy_root_id);
1238 data->root_set(id_root);
1239 data->do_create_linked_overrides_set =
false;
1249 if (use_linked_overrides_set) {
1250 data->linked_ids_hierarchy_default_override.clear();
1275 Collection *instantiating_collection =
nullptr;
1276 Collection *instantiating_collection_override_candidate =
nullptr;
1281 if (instantiating_collection_linklist !=
nullptr) {
1282 for (
LinkNode *instantiating_collection_linknode = instantiating_collection_linklist->
list;
1283 instantiating_collection_linknode !=
nullptr;
1284 instantiating_collection_linknode = instantiating_collection_linknode->
next)
1286 instantiating_collection =
static_cast<Collection *
>(
1287 instantiating_collection_linknode->link);
1293 if (instantiating_collection->
id.
tag &
data->tag ||
1294 data->linked_ids_hierarchy_default_override.contains(&instantiating_collection->
id))
1300 instantiating_collection_override_candidate = instantiating_collection;
1301 instantiating_collection =
nullptr;
1305 if (instantiating_collection ==
nullptr &&
1306 instantiating_collection_override_candidate !=
nullptr)
1309 &instantiating_collection_override_candidate->
id,
1319 ID *id_owner =
data->root_get();
1324 ID *id_hierarchy_root =
data->hierarchy_root_get();
1345 to_id_entry = to_id_entry->
next)
1350 ID *to_id = *to_id_entry->id_pointer.to;
1362 const Library *reference_lib =
1364 const ID *to_id_reference =
1366 if (to_id_reference->
lib != reference_lib) {
1374 data->root_set(to_id);
1377 data->root_set(id_owner);
1383 ID *id_root =
data->root_get();
1388 ID *id_hierarchy_root =
data->hierarchy_root_get();
1402 ID *id_root_reference,
1403 ID *id_hierarchy_root_reference,
1404 const bool do_fully_editable)
1412 data.is_override =
false;
1413 data.is_resync =
false;
1415 data.root_set(id_root_reference);
1416 data.hierarchy_root_set(id_hierarchy_root_reference);
1427 if (id_hierarchy_root_reference->
lib != id_root_reference->
lib) {
1430 id_root_reference->
lib);
1433 data.is_override =
true;
1434 data.root_set(id_hierarchy_root_reference);
1435 data.hierarchy_root_set(id_hierarchy_root_reference);
1442 bool success =
false;
1443 if (id_hierarchy_root_reference->
lib != id_root_reference->
lib) {
1447 id_hierarchy_root_reference,
1457 id_hierarchy_root_reference,
1474 ID *id_instance_hint,
1476 const Object *old_active_object,
1477 const bool is_resync)
1480 BLI_assert(old_active_object ==
nullptr || view_layer !=
nullptr);
1496 if (is_resync || id_root ==
nullptr || id_root->
newid ==
nullptr) {
1515 switch (
GS(id_root->
name)) {
1517 Object *ob_reference = id_instance_hint !=
nullptr &&
GS(id_instance_hint->
name) ==
ID_OB ?
1518 reinterpret_cast<Object *
>(id_instance_hint) :
1524 if (ob_reference !=
nullptr) {
1527 else if (id_instance_hint !=
nullptr) {
1530 bmain, scene, (
reinterpret_cast<Collection *
>(id_instance_hint)), collection_new);
1534 bmain, scene, (
reinterpret_cast<Collection *
>(id_root)), collection_new);
1546 bmain, scene,
reinterpret_cast<Object *
>(id_root), ob_new);
1556 if (view_layer !=
nullptr) {
1564 Collection *default_instantiating_collection = residual_storage;
1566 Object *ob_new =
reinterpret_cast<Object *
>(ob->id.newid);
1567 if (ob_new ==
nullptr || (
ID_IS_LINKED(ob_new) && ob_new->
id.
lib != owner_library)) {
1574 if (old_active_object == ob) {
1580 if (basact !=
nullptr) {
1581 view_layer->
basact = basact;
1587 if (id_root !=
nullptr && default_instantiating_collection ==
nullptr) {
1588 ID *id_ref = id_root->
newid !=
nullptr ? id_root->
newid : id_root;
1589 switch (
GS(id_ref->
name)) {
1614 (view_layer !=
nullptr ?
1619 default_instantiating_collection = collection;
1628 if (default_instantiating_collection ==
nullptr) {
1637 if (id_root !=
nullptr &&
1640 ID *id_ref = id_root->
newid !=
nullptr ? id_root->
newid : id_root;
1641 switch (
GS(id_ref->
name)) {
1646 default_instantiating_collection);
1651 bmain, scene,
nullptr, default_instantiating_collection);
1663 ID *id_root_reference,
1664 ID *id_hierarchy_root_reference,
1665 ID *id_instance_hint,
1666 ID **r_id_root_override,
1667 const bool do_fully_editable)
1669 if (r_id_root_override !=
nullptr) {
1670 *r_id_root_override =
nullptr;
1673 if (id_hierarchy_root_reference ==
nullptr) {
1674 id_hierarchy_root_reference = id_root_reference;
1681 const Object *old_active_object = (view_layer !=
nullptr) ?
1689 id_hierarchy_root_reference,
1696 if (r_id_root_override !=
nullptr) {
1697 *r_id_root_override = id_root_reference->
newid;
1722 if (curr_level > 1000) {
1724 "Levels of dependency relationships between library overrides IDs is way too high, "
1725 "skipping further processing loops (involves at least '%s')",
1742 *r_best_level = curr_level;
1743 return id->override_library->hierarchy_root;
1748 int best_level_placeholder = 0;
1762 int best_level_candidate = curr_level;
1763 ID *best_root_id_candidate =
id;
1766 from_id_entry = from_id_entry->
next)
1771 ID *from_id = from_id_entry->id_pointer.from;
1776 int level_candidate = curr_level + 1;
1779 bmain, from_id, curr_level + 1, &level_candidate);
1780 if (level_candidate > best_level_candidate && root_id_candidate !=
nullptr) {
1781 best_root_id_candidate = root_id_candidate;
1782 best_level_candidate = level_candidate;
1789 int best_level_placeholder = 0;
1792 bmain, id_owner, curr_level + 1, &best_level_placeholder);
1795 BLI_assert(best_root_id_candidate !=
nullptr);
1803 *r_best_level = best_level_candidate;
1804 return best_root_id_candidate;
1823 if (id_root ==
id) {
1829 ID *id_iter = ancestors[
i];
1836 from_id_entry = from_id_entry->
next)
1841 ID *from_id = from_id_entry->id_pointer.from;
1846 if (from_id == id_root) {
1850 ancestors.
add(from_id);
1865 if (
id->override_library->hierarchy_root == id_root) {
1873 if (
id->override_library->hierarchy_root !=
nullptr) {
1883 "Inconsistency in library override hierarchy of ID '%s'.\n"
1884 "\tNot enough data to verify validity of current proposed root '%s', assuming "
1885 "already set one '%s' is valid.",
1888 id->override_library->hierarchy_root->name);
1898 bool do_replace_root = (!
id->override_library->hierarchy_root ||
1900 id->override_library->hierarchy_root->lib !=
id->lib);
1902 from_id_entry = from_id_entry->
next)
1909 if (id_from_ref == from_id_entry->id_pointer.from) {
1912 do_replace_root =
true;
1915 "Inconsistency in library override hierarchy of ID '%s'.\n"
1916 "\tCurrent proposed root '%s' detected as valid, will replace already set one '%s'.",
1919 id->override_library->hierarchy_root->name);
1924 if (!do_replace_root) {
1927 "Inconsistency in library override hierarchy of ID '%s'.\n"
1928 "\tCurrent proposed root '%s' not detected as valid, keeping already set one '%s'.",
1931 id->override_library->hierarchy_root->name);
1938 "Modifying library override hierarchy of ID '%s'.\n"
1939 "\tFrom old root '%s' to new root '%s'.",
1941 id->override_library->hierarchy_root ?
id->override_library->hierarchy_root->name :
1945 id->override_library->hierarchy_root = id_root;
1953 to_id_entry = to_id_entry->
next)
1958 ID *to_id = *to_id_entry->id_pointer.to;
1977 processed_ids.
add(
id);
1980 if (
id->override_library->hierarchy_root !=
nullptr) {
1982 id->override_library->hierarchy_root->lib !=
id->lib)
1986 "Existing override hierarchy root ('%s') for ID '%s' is invalid, will try to find a "
1988 id->override_library->hierarchy_root !=
nullptr ?
1989 id->override_library->hierarchy_root->name :
1992 id->override_library->hierarchy_root =
nullptr;
2002 "Existing override hierarchy root ('%s') for ID '%s' is invalid, will try to find a "
2004 id->override_library->hierarchy_root !=
nullptr ?
2005 id->override_library->hierarchy_root->name :
2008 id->override_library->hierarchy_root =
nullptr;
2012 processed_ids.
add(
id);
2023 if (!
ELEM(
id->override_library->hierarchy_root, id_root,
nullptr)) {
2027 "Potential inconsistency in library override hierarchy of ID '%s' (current root "
2028 "%s), detected as part of the hierarchy of '%s' (current root '%s')",
2030 id->override_library->hierarchy_root !=
nullptr ?
2031 id->override_library->hierarchy_root->name :
2037 processed_ids.
add(
id);
2043 BLI_assert(
id->override_library->hierarchy_root !=
nullptr);
2052 const ID *id_root_reference,
2054 GHash *linkedref_to_old_override)
2068 for (
auto [id_reference, id_override_new] : references_and_new_overrides) {
2069 new_overrides.
append(id_override_new);
2070 ID *id_override_old =
static_cast<ID *
>(
2072 if (id_override_old ==
nullptr) {
2075 remapper_overrides_old_to_new.
add(id_override_old, id_override_new);
2079 GHASH_ITER (linkedref_to_old_override_iter, linkedref_to_old_override) {
2081 ID *id_override_old_iter =
static_cast<ID *
>(
2084 nomain_ids.
append(id_override_old_iter);
2088 ID *id_reference_iter =
static_cast<ID *
>(
2100 if (!id_reference_iter->
newid) {
2101 remapper_overrides_reference_to_old.
add(id_reference_iter, id_override_old_iter);
2110 remapper_overrides_old_to_new,
2116 remapper_overrides_reference_to_old,
2143 std::map<LibOverrideMissingIDsData_Key, LibOverrideMissingIDsData_Value>;
2154 std::string id_name_key(
id->name);
2155 const size_t last_key_index = id_name_key.find_last_not_of(
"0123456789");
2157 BLI_assert(last_key_index != std::string::npos);
2159 if (id_name_key[last_key_index] ==
'.') {
2160 id_name_key.resize(last_key_index);
2167 Main *bmain,
const bool is_relocate)
2177 if ((id_iter->
tag & required_tags) != required_tags) {
2186 if ((id_iter->
tag & required_tags) != required_tags) {
2192 std::pair<LibOverrideMissingIDsData::iterator, bool> value = missing_ids.try_emplace(
2194 value.first->second.push_back(id_iter);
2205 const LibOverrideMissingIDsData::iterator value = missing_ids.find(key);
2206 if (value == missing_ids.end()) {
2209 if (value->second.empty()) {
2212 ID *match_id = value->second.front();
2213 value->second.pop_front();
2225 Collection *override_resync_residual_storage,
2226 const bool do_hierarchy_enforce,
2227 const bool do_post_process,
2235 const Object *old_active_object =
nullptr;
2247 "Impossible to resync data-block %s and its dependencies, as its linked reference "
2259 data.is_override =
true;
2260 data.is_resync =
true;
2262 data.root_set(id_root);
2274 for (
LinkNode *resync_root_link = id_resync_roots; resync_root_link !=
nullptr;
2275 resync_root_link = resync_root_link->
next)
2277 ID *id_resync_root =
static_cast<ID *
>(resync_root_link->link);
2282 "While dealing with root '%s', resync root ID '%s' (%p) found to be alreaady "
2285 id_resync_root->
name,
2301 "Impossible to resync data-block %s and its dependencies, as its linked reference "
2312 data.is_override =
true;
2313 data.root_set(id_resync_root);
2318 data.is_override =
false;
2320 data.hierarchy_root_set(
2350 bmain,
id,
nullptr,
nullptr);
2356 ID *reference_id = id_override_library->
reference;
2357 if (
GS(reference_id->
name) !=
GS(
id->name)) {
2358 switch (
GS(
id->name)) {
2364 reference_id =
reinterpret_cast<ID *
>(
2374 if (reference_id ==
nullptr) {
2386 if ((
id->override_library->reference->tag &
ID_TAG_DOIT) == 0) {
2391 id->override_library->reference->tag |=
ID_TAG_DOIT;
2405 data.is_override =
true;
2406 data.root_set(id_root);
2434 Library *id_root_reference_lib_old = (new_to_old_libraries_map ?
2436 id_root_reference->
lib, id_root_reference->
lib) :
2437 id_root_reference->
lib);
2438 const bool is_relocate = id_root_reference_lib_old != id_root_reference->
lib;
2443 bmain, is_relocate);
2449 ID *id_reference_iter;
2452 !
ELEM(id_reference_iter->
lib, id_root_reference->
lib, id_root_reference_lib_old))
2456 ID *id_override_new = id_reference_iter->
newid;
2457 references_and_new_overrides.
append(std::make_pair(id_reference_iter, id_override_new));
2459 ID *id_override_old =
static_cast<ID *
>(
2468 id_reference_iter->
lib);
2469 BLI_assert(id_override_old ==
nullptr || id_override_old->
lib == id_root->
lib);
2470 id_override_new->
lib = id_root->
lib;
2477 if (id_override_old ==
nullptr && (
ID_IS_LINKED(id_override_new) || is_relocate)) {
2480 BLI_assert(id_override_old ==
nullptr || id_override_old->
lib == id_override_new->
lib);
2481 if (id_override_old !=
nullptr) {
2482 BLI_ghash_insert(linkedref_to_old_override, id_reference_iter, id_override_old);
2486 if (key_reference_iter && key_override_old) {
2488 linkedref_to_old_override, &key_reference_iter->
id, &key_override_old->
id);
2493 "Found missing linked old override best-match %s for new linked override %s",
2494 id_override_old->
name,
2495 id_override_new->
name);
2504 if (id_override_old !=
nullptr) {
2507 memcpy(id_name_buf, id_override_old->
name,
sizeof(id_name_buf));
2508 memcpy(id_override_old->
name, id_override_new->
name,
sizeof(id_override_old->
name));
2509 memcpy(id_override_new->
name, id_name_buf,
sizeof(id_override_new->
name));
2539 for (; op_new; op_new = op_new->
next, op_old = op_old->
next) {
2565 bmain, id_root_reference, references_and_new_overrides, linkedref_to_old_override);
2580 ID *id_override_new =
id->
newid;
2586 if (id_override_old ==
nullptr) {
2599 if (key_override_old_p !=
nullptr && *key_override_old_p !=
nullptr) {
2603 Key *key_override_old =
static_cast<Key *
>(
2606 *key_override_old_p = key_override_old;
2622 bool do_clear_parenting_override =
false;
2624 Object *ob_old =
reinterpret_cast<Object *
>(id_override_old);
2625 Object *ob_new =
reinterpret_cast<Object *
>(id_override_new);
2635 do_clear_parenting_override =
true;
2655 else if (do_clear_parenting_override) {
2656 if (strstr(op->rna_path,
"matrix_parent_inverse") ||
2657 strstr(op->rna_path,
"parent_type") || strstr(op->rna_path,
"parent_bone") ||
2658 strstr(op->rna_path,
"parent_vertices"))
2662 "Deleting liboverride property '%s' from object %s, as its parent pointer "
2663 "matches the reference data hierarchy wise",
2664 id_override_new->
name + 2,
2681 if (key_override_old_p !=
nullptr) {
2682 *key_override_old_p =
nullptr;
2686 id_override_old_vector.
append(id_override_old);
2695 id_override_old_vector,
2699 for (
ID *id_override_old : id_override_old_vector) {
2702 id_override_old_vector.
clear();
2707 int user_edited_overrides_deletion_count = 0;
2716 if (
id->newid !=
nullptr &&
id->lib == id_root_reference->
lib) {
2719 if (id_override_old !=
nullptr) {
2727 id_override_old_vector.
append(id_override_old);
2743 else if (hierarchy_root !=
nullptr &&
2764 "Old override %s is being kept around as it was user-edited",
2773 "Old override %s is being deleted even though it was user-edited",
2775 user_edited_overrides_deletion_count++;
2782 else if (
id->override_library->runtime !=
nullptr) {
2792 for (
ID *id_override_old : id_override_old_vector) {
2795 id_override_old_vector.
clear();
2805 if (id_root_reference->
newid !=
nullptr) {
2806 id_root = id_root_reference->
newid;
2809 if (user_edited_overrides_deletion_count > 0) {
2812 "During resync of data-block %s, %d obsolete overrides were deleted, that had "
2813 "local changes defined by user",
2815 user_edited_overrides_deletion_count);
2818 if (do_post_process) {
2830 override_resync_residual_storage,
2875 nullptr,
id,
nullptr,
nullptr);
2887 "Deleting %d unused linked missing IDs and their unused liboverrides (including %d "
2898 Collection *override_resync_residual_storage,
2899 const bool do_hierarchy_enforce,
2902 ListBase no_main_ids_list = {
nullptr};
2904 id_resync_roots.
link = id_root;
2905 id_resync_roots.
next =
nullptr;
2914 override_resync_residual_storage,
2915 do_hierarchy_enforce,
2933 const int library_indirect_level,
2934 const bool do_strict_equal)
2936 const int id_lib_level = (
ID_IS_LINKED(
id) ?
id->lib->runtime->temp_index : 0);
2937 return do_strict_equal ? id_lib_level == library_indirect_level :
2938 id_lib_level <= library_indirect_level;
2955 const int library_indirect_level,
2956 bool is_in_partial_resync_hierarchy)
2964 "While processing indirect level %d, ID %s from lib %s of indirect level %d detected "
2965 "as needing resync, skipping",
2966 library_indirect_level,
2978 bool is_reprocessing_current_entry =
false;
2989 if (!is_in_partial_resync_hierarchy) {
2998 is_reprocessing_current_entry =
true;
3002 "ID %s (%p) is detected as part of a hierarchy dependency loop requiring resync, it "
3003 "is now being re-processed to ensure proper tagging of the whole loop",
3019 "ID %s (%p) was marked as a potential root for partial resync, but it is used by "
3020 "%s (%p), which is also tagged for resync, so it is not a root after all",
3032 if (!is_in_partial_resync_hierarchy) {
3042 if (is_in_partial_resync_hierarchy) {
3048 "ID %s (%p) now tagged as needing resync because they are used by %s (%p) "
3049 "that needs to be resynced",
3060 is_in_partial_resync_hierarchy =
true;
3064 if (!is_reprocessing_current_entry) {
3078 entry_item = entry_item->
next)
3083 ID *id_to = *(entry_item->id_pointer.to);
3092 "Check above ensured `id_to` is a liboverride, so it should be a real one (not "
3093 "an embedded one)");
3101 bmain, id_to, id_root, library_indirect_level, is_in_partial_resync_hierarchy);
3108 if (!is_reprocessing_current_entry) {
3115 if (is_in_partial_resync_hierarchy &&
3123 "Potential root for partial resync: %s (%p)",
3133 const int library_indirect_level)
3157 if (hierarchy_root ==
nullptr ||
3179 Main *bmain,
ID *
id,
const int library_indirect_level)
3183 if (
id->override_library->hierarchy_root ==
id ||
3187 id->override_library->hierarchy_root !=
id ||
id->override_library->runtime ==
nullptr ||
3206 to_id_entry = to_id_entry->
next)
3211 ID *to_id = *(to_id_entry->id_pointer.to);
3217 bmain, to_id, library_indirect_level))
3231 const int library_indirect_level)
3262 bmain, id_iter,
nullptr, library_indirect_level,
false);
3314 bmain, id_iter, library_indirect_level))
3320 "ID %s (%p) detected as only related to its hierarchy root by 'reversed' "
3321 "relationship(s) (e.g. object parenting), tagging it as needing "
3330 "ID %s (%p) detected as 'isolated' from its hierarchy root, tagging it as needing "
3364 if (id_iter != hierarchy_root) {
3367 "Found root ID '%s' for partial resync root ID '%s'",
3368 hierarchy_root->
name,
3379 id_roots, hierarchy_root,
reinterpret_cast<void ***
>(&id_resync_roots_p)))
3405 Collection *override_resync_residual_storage,
3406 const int library_indirect_level,
3409 const bool do_reports_recursive_resync_timing = (library_indirect_level != 0);
3426 data.is_override =
false;
3427 data.is_resync =
true;
3440 data.root_set(
id->override_library->reference);
3460 &
LOG_RESYNC, 4,
"ID %s (%p) was already tagged as needing resync",
id->name,
id->lib);
3473 entry_item = entry_item->
next)
3478 ID *id_to = *entry_item->id_pointer.to;
3484 "ID %s (%p) now tagged as needing resync because they use linked %s (%p) that "
3485 "now needs to be overridden",
3514 "Checking validity of computed TODO data for root '%s'... \n",
3519 ID *id_resync_root =
static_cast<ID *
>(id_resync_root_iter->
link);
3521 if (id_resync_roots->
list != id_resync_roots->
last_node || id_resync_root != id_root) {
3523 "Hierarchy root ID is tagged for resync, yet it is not the only partial "
3524 "resync roots, this should not happen."
3526 "\n\tFirst Resync root ID: %s"
3527 "\n\tLast Resync root ID: %s",
3533 for (
LinkNode *id_resync_root_iter = id_resync_roots->
list; id_resync_root_iter !=
nullptr;
3534 id_resync_root_iter = id_resync_root_iter->
next)
3536 ID *id_resync_root =
static_cast<ID *
>(id_resync_root_iter->link);
3538 if (id_resync_root == id_root) {
3539 if (id_resync_root_iter != id_resync_roots->
list ||
3540 id_resync_root_iter != id_resync_roots->
last_node)
3543 "Resync root ID is same as root ID of the override hierarchy, yet other "
3544 "resync root IDs are also defined, this should not happen at this point."
3546 "\n\tFirst Resync root ID: %s"
3547 "\n\tLast Resync root ID: %s",
3563 ListBase no_main_ids_list = {
nullptr};
3578 "Resyncing all dependencies under root %s (%p), first one being '%s'...",
3580 reinterpret_cast<void *
>(
library),
3583 new_to_old_libraries_map,
3587 id_resync_roots->
list,
3589 override_resync_residual_storage,
3595 reports->count.resynced_lib_overrides++;
3596 if (library_indirect_level > 0 &&
reports->do_resynced_lib_overrides_libraries_list &&
3600 reports->resynced_lib_overrides_libraries_count++;
3620 bool process_lib_level_again =
false;
3628 const bool need_reseync_original = (
id->override_library->runtime !=
nullptr &&
3629 (
id->override_library->runtime->tag &
3631 const bool is_isolated_from_root = (
id->override_library->runtime !=
nullptr &&
3632 (
id->override_library->runtime->tag &
3635 if (need_resync && is_isolated_from_root) {
3639 "Deleting unused ID override %s from library level %d, still found as needing "
3640 "resync, and being isolated from its hierarchy root. This can happen when its "
3641 "otherwise unchanged linked reference was moved around in the library file (e.g. if "
3642 "an object was moved into another sub-collection of the same hierarchy).",
3650 "Keeping user-edited ID override %s from library level %d still found as "
3651 "needing resync, and being isolated from its hierarchy root. This can happen when its "
3652 "otherwise unchanged linked reference was moved around in the library file (e.g. if "
3653 "an object was moved into another sub-collection of the same hierarchy).",
3660 else if (need_resync) {
3661 if (need_reseync_original) {
3664 "ID override %s from library level %d still found as needing resync after "
3665 "tackling library level %d. Since it was originally tagged as such by "
3666 "RNA/liboverride apply code, this whole level of library needs to be processed "
3670 library_indirect_level);
3671 process_lib_level_again =
true;
3681 "ID override %s from library level %d still found as needing resync after "
3682 "tackling library level %d. However, it was not tagged as such by "
3683 "RNA/liboverride apply code, so ignoring it",
3686 library_indirect_level);
3690 else if (need_reseync_original) {
3694 else if (is_isolated_from_root) {
3697 "ID override %s from library level %d still tagged as isolated from its hierarchy root, "
3698 "it should have been either properly resynced or removed at that point.",
3716 if (do_reports_recursive_resync_timing) {
3720 return process_lib_level_again;
3731 const int owner_library_indirect_level =
ID_IS_LINKED(id_owner) ?
3734 if (owner_library_indirect_level > 100) {
3736 "Levels of indirect usages of libraries is way too high, there are most likely "
3737 "dependency loops, skipping further building loops (involves at least '%s' from "
3738 "'%s' and '%s' from '%s')",
3745 if (owner_library_indirect_level > 90) {
3748 "Levels of indirect usages of libraries is suspiciously too high, there are most likely "
3749 "dependency loops (involves at least '%s' from '%s' and '%s' from '%s')",
3756 if (owner_library_indirect_level >=
id->lib->runtime->temp_index) {
3757 id->lib->runtime->temp_index = owner_library_indirect_level + 1;
3758 *
reinterpret_cast<bool *
>(cb_data->
user_data) =
true;
3774 library->runtime->temp_index = 1;
3776 bool do_continue =
true;
3777 while (do_continue) {
3778 do_continue =
false;
3790 int library_indirect_level_max = 0;
3792 library_indirect_level_max = std::max(
library->runtime->temp_index,
3793 library_indirect_level_max);
3795 return library_indirect_level_max;
3807#define OVERRIDE_RESYNC_RESIDUAL_STORAGE_NAME "OVERRIDE_RESYNC_LEFTOVERS"
3810 if (override_resync_residual_storage !=
nullptr &&
3813 override_resync_residual_storage =
nullptr;
3815 if (override_resync_residual_storage ==
nullptr) {
3831 while (library_indirect_level >= 0) {
3832 int level_reprocess_count = 0;
3846 new_to_old_libraries_map,
3849 override_resync_residual_storage,
3850 library_indirect_level,
3853 level_reprocess_count++;
3854 if (level_reprocess_count > 100) {
3857 "Need to reprocess resync for library level %d more than %d times, aborting. This is "
3858 "either caused by extremely complex liboverride hierarchies, or a bug",
3859 library_indirect_level,
3860 level_reprocess_count);
3865 "Applying reprocess %d for resyncing at library level %d",
3866 level_reprocess_count,
3867 library_indirect_level);
3869 library_indirect_level--;
3881 override_resync_residual_storage,
3893 "library '%s' contains some linked overrides that required recursive resync, "
3894 "consider updating it",
3916 data.scene =
nullptr;
3919 data.is_override =
true;
3920 data.is_resync =
false;
3922 data.root_set(id_root);
3962 if (!
id->override_library) {
3969 if (shape_key !=
nullptr) {
3974 Collection *master_collection =
reinterpret_cast<Scene *
>(
id)->master_collection;
3975 if (master_collection !=
nullptr) {
3981 if (node_tree !=
nullptr) {
4013 const char *rna_path)
4020 const char *rna_path,
4025 if (op ==
nullptr) {
4037 else if (r_created) {
4052 idpoin, library_prop->
rna_path, r_override_poin, r_override_prop, r_index);
4065 opop_dst = opop_dst->
next, opop_src = opop_src->
next)
4084 const char *old_rna_path,
4085 const char *new_rna_path)
4092 if (liboverride_property ==
nullptr) {
4108 const bool do_runtime_updates)
4110 if (do_runtime_updates &&
4123 const char *rna_path)
4130 if (liboverride_property ==
nullptr) {
4147 const char *subitem_main_name,
4148 const char *subitem_other_name,
4149 const std::optional<const ID *> &subitem_main_id,
4150 const std::optional<const ID *> &subitem_other_id,
4151 const size_t offesetof_opop_main_name,
4152 const size_t offesetof_opop_other_name,
4153 const size_t offesetof_opop_main_id,
4154 const size_t offesetof_opop_other_id)
4156 const bool do_ids(subitem_main_id);
4159 liboverride_operations, subitem_main_name,
int(offesetof_opop_main_name)));
4162 reinterpret_cast<Link *
>(opop), subitem_main_name,
int(offesetof_opop_main_name))))
4164 const char *opop_other_name = *
reinterpret_cast<const char **
>(
reinterpret_cast<char *
>(opop) +
4165 offesetof_opop_other_name);
4168 if (do_ids && opop_use_id) {
4170 const ID *opop_main_id = *
reinterpret_cast<const ID **
>(
reinterpret_cast<char *
>(opop) +
4171 offesetof_opop_main_id);
4172 if (*subitem_main_id != opop_main_id) {
4175 const ID *opop_other_id = *
reinterpret_cast<const ID **
>(
reinterpret_cast<char *
>(opop) +
4176 offesetof_opop_other_id);
4177 if (*subitem_other_id != opop_other_id) {
4184 if ((do_ids && opop_use_id) || (!do_ids && !opop_use_id)) {
4185 if (!subitem_other_name && !opop_other_name) {
4188 if (subitem_other_name && opop_other_name &&
STREQ(subitem_other_name, opop_other_name)) {
4201 const char *subitem_refname,
4202 const char *subitem_locname,
4203 const std::optional<const ID *> &subitem_refid,
4204 const std::optional<const ID *> &subitem_locid,
4205 const int subitem_refindex,
4206 const int subitem_locindex,
4210 BLI_assert(!subitem_refid == !subitem_locid);
4213 const int subitem_defindex = -1;
4219 if (subitem_locname !=
nullptr) {
4231 if (opop !=
nullptr) {
4236 if (subitem_refname !=
nullptr) {
4248 if (opop !=
nullptr) {
4256 sizeof(subitem_locindex),
4265 sizeof(subitem_refindex),
4273 if (!strict && (subitem_locindex != subitem_defindex)) {
4277 sizeof(subitem_defindex),
4292 const short operation,
4293 const char *subitem_refname,
4294 const char *subitem_locname,
4295 const std::optional<ID *> &subitem_refid,
4296 const std::optional<ID *> &subitem_locid,
4297 const int subitem_refindex,
4298 const int subitem_locindex,
4303 BLI_assert(!subitem_refid == !subitem_locid);
4306 liboverride_property,
4316 if (opop ==
nullptr) {
4319 if (subitem_locname) {
4322 if (subitem_refname) {
4328 if (subitem_refid) {
4340 else if (r_created) {
4385 switch (liboverride_property_operation->
operation) {
4393 if (ptr_storage ==
nullptr || ptr_storage->
data ==
nullptr || prop_storage ==
nullptr) {
4394 BLI_assert_msg(0,
"Missing data to apply differential override operation.");
4403 if ((ptr_dst ==
nullptr || ptr_dst->
data ==
nullptr || prop_dst ==
nullptr) ||
4404 (ptr_src ==
nullptr || ptr_src->
data ==
nullptr || prop_src ==
nullptr))
4422 "Library override templates have been removed: removing all override data from "
4423 "the data-block '%s'",
4432 "Data corruption: data-block '%s' is using itself as library override reference, "
4433 "removing all override data",
4442 "Data corruption: data-block '%s' is using another local data-block ('%s') as "
4443 "library override reference, removing all override data",
4457 if (!op->rna_path) {
4461 "Data corruption: data-block `%s` has a Library Override property with no RNA path",
4479 ID *liboverride_id =
id;
4651 liboverride_match_flags,
4652 &local_report_flags);
4655 CLOG_INFO(&
LOG, 2,
"We did restore some properties of %s from its reference", local->
name);
4660 "We did tag some properties of %s for restoration from its reference",
4664 CLOG_INFO(&
LOG, 2,
"We did generate library override rules for %s", local->
name);
4670 if (r_report_flags !=
nullptr) {
4671 *r_report_flags = (*r_report_flags | local_report_flags);
4720 if (r_report_flags !=
nullptr) {
4734 ID *
id =
static_cast<ID *
>(taskdata);
4747 const bool force_auto,
4748 int *r_report_flags)
4752#ifdef DEBUG_OVERRIDE_TIMEIT
4774 create_pool_data.
bmain = bmain;
4797 if (
Collection *scene_collection =
reinterpret_cast<Scene *
>(
id)->master_collection) {
4842 bmain,
reinterpret_cast<int *
>(&create_pool_data.
report_flags));
4847 if (r_report_flags !=
nullptr) {
4855#ifdef DEBUG_OVERRIDE_TIMEIT
4884 const bool do_reset_system_override)
4886 bool was_op_deleted =
false;
4888 if (do_reset_system_override) {
4895 bool do_op_delete =
true;
4897 if (is_collection || op->rna_prop_type ==
PROP_POINTER) {
4912 if (is_collection) {
4920 if (
ptr.owner_id !=
nullptr && ptr_lib.
owner_id !=
nullptr) {
4923 ptr.owner_id->override_library !=
nullptr &&
4924 ptr.owner_id->override_library->reference == ptr_lib.
owner_id);
4932 was_op_deleted =
true;
4936 if (was_op_deleted) {
4943 return was_op_deleted;
4948 const bool do_reset_system_override)
4966 const bool do_reset_system_override)
4973 if (entry_vp ==
nullptr) {
4992 to_id_entry = to_id_entry->
next)
4998 if (*to_id_entry->id_pointer.to !=
nullptr) {
4999 ID *to_id = *to_id_entry->id_pointer.to;
5009 const bool do_reset_system_override)
5034 if (liboverride_property !=
nullptr) {
5036 liboverride_property->
tag |= tag;
5039 liboverride_property->
tag &= ~tag;
5171 if (tmp_id ==
nullptr) {
5178 tmp_id->
lib = local->
lib;
5190 if (local_key !=
nullptr && tmp_key !=
nullptr) {
5213 if (local_key !=
nullptr && tmp_key !=
nullptr) {
5221 local_key->
from = local;
5222 tmp_key->
from = tmp_id;
5235 if (ob->pose !=
nullptr && ob->data == local) {
5275 if (
id->override_library !=
nullptr) {
5310 const char *line_prefix =
"";
5311 if (intro_txt !=
nullptr) {
5312 std::cout << intro_txt <<
"\n";
5317 std::cout << line_prefix << op->rna_path <<
" [";
5319 std::cout <<
" UNUSED ";
5324 std::cout << line_prefix << line_prefix << opop->operation <<
" [";
5326 std::cout <<
" UNUSED ";
5329 std::cout <<
" MATCH_REF ";
5332 if (opop->subitem_reference_name || opop->subitem_local_name) {
5333 std::cout <<
"(" << opop->subitem_reference_name <<
" <" << opop->subitem_reference_id
5334 <<
"> -> " << opop->subitem_local_name <<
" <" << opop->subitem_local_id <<
">)";
5336 else if (opop->subitem_reference_index >= 0 || opop->subitem_local_index >= 0) {
5337 std::cout <<
"(" << opop->subitem_reference_index <<
" -> " << opop->subitem_local_index
AnimData * BKE_animdata_from_id(const ID *id)
void BKE_animdata_liboverride_post_process(ID *id)
void BKE_pose_clear_pointers(bPose *pose)
void BKE_pose_ensure(Main *bmain, Object *ob, bArmature *arm, bool do_id_user)
Main * BKE_blender_globals_main_swap(Main *new_gmain)
void BKE_collection_add_from_collection(Main *bmain, Scene *scene, Collection *collection_src, Collection *collection_dst)
Collection * BKE_collection_add(Main *bmain, Collection *collection_parent, const char *name_custom)
bool BKE_collection_has_object(Collection *collection, const Object *ob)
bool BKE_collection_is_empty(const Collection *collection)
bool BKE_collection_is_in_scene(Collection *collection)
void BKE_collection_add_from_object(Main *bmain, Scene *scene, const Object *ob_src, Collection *collection_dst)
GSet * BKE_scene_objects_as_gset(Scene *scene, GSet *objects_gset)
void BKE_collection_object_add_from(Main *bmain, Scene *scene, Object *ob_src, Object *ob_dst)
bool BKE_collection_delete(Main *bmain, Collection *collection, bool hierarchy)
bool BKE_collection_has_collection(const Collection *parent, const Collection *collection)
bool BKE_collection_object_add(Main *bmain, Collection *collection, Object *ob)
FCurve * BKE_animadata_fcurve_find_by_rna_path(AnimData *animdata, const char *rna_path, const int rna_index, bAction **r_action, bool *r_driven)
@ G_LIBOVERRIDE_NO_AUTO_RESYNC
bool BKE_idtype_idcode_is_linkable(short idcode)
Key ** BKE_key_from_id_p(ID *id)
Key * BKE_key_from_id(ID *id)
bool BKE_view_layer_has_collection(const ViewLayer *view_layer, const Collection *collection)
void BKE_view_layer_synced_ensure(const Scene *scene, ViewLayer *view_layer)
void BKE_layer_collection_resync_forbid()
void BKE_scene_view_layers_synced_ensure(const Scene *scene)
void BKE_main_collection_sync_remap(const Main *bmain)
void BKE_layer_collection_resync_allow()
Object * BKE_view_layer_active_object_get(const ViewLayer *view_layer)
void BKE_main_collection_sync(const Main *bmain)
Base * BKE_view_layer_base_find(ViewLayer *view_layer, Object *ob)
void BKE_main_view_layers_synced_ensure(const Main *bmain)
@ LIB_ID_FREE_NO_NAMEMAP_REMOVE
@ LIB_ID_COPY_NO_LIB_OVERRIDE
@ LIB_ID_COPY_NO_LIB_OVERRIDE_LOCAL_DATA_FLAG
void BKE_id_delete(Main *bmain, void *idv) ATTR_NONNULL()
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)
void size_t BKE_id_multi_tagged_delete(Main *bmain) ATTR_NONNULL()
void BKE_id_free(Main *bmain, void *idv)
void id_sort_by_name(ListBase *lb, ID *id, ID *id_sorting_hint)
void id_fake_user_set(ID *id)
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_main_id_newptr_and_tag_clear(Main *bmain)
ID * BKE_id_owner_get(ID *id, const bool debug_relationship_assert=true)
ID * BKE_id_copy_ex(Main *bmain, const ID *id, ID **new_id_p, int flag)
void * BKE_id_new(Main *bmain, short type, const char *name)
void BKE_id_free_ex(Main *bmain, void *idv, int flag_orig, bool use_flag_from_idtag)
void BKE_libblock_management_main_add(Main *bmain, void *idv)
void BKE_main_id_tag_all(Main *mainvar, int tag, bool value)
void BKE_lib_override_library_main_operations_create(Main *bmain, bool force_auto, int *r_report_flags)
@ IDWALK_CB_OVERRIDE_LIBRARY_NOT_OVERRIDABLE
@ IDWALK_CB_OVERRIDE_LIBRARY_HIERARCHY_DEFAULT
void BKE_library_foreach_ID_link(Main *bmain, ID *id, blender::FunctionRef< LibraryIDLinkCallback > callback, void *user_data, LibraryForeachIDFlag flag)
void BKE_libblock_relink_multiple(Main *bmain, const blender::Span< ID * > ids, eIDRemapType remap_type, blender::bke::id::IDRemapper &id_remapper, int remap_flags)
void BKE_libblock_remap_multiple(Main *bmain, blender::bke::id::IDRemapper &mappings, const int remap_flags)
void BKE_libblock_relink_ex(Main *bmain, void *idv, void *old_idv, void *new_idv, int remap_flags) ATTR_NONNULL(2)
void void BKE_libblock_remap(Main *bmain, void *old_idv, void *new_idv, int remap_flags) ATTR_NONNULL(1
@ ID_REMAP_SKIP_OVERRIDE_LIBRARY
@ ID_REMAP_FORCE_USER_REFCOUNT
@ ID_REMAP_SKIP_INDIRECT_USAGE
@ ID_REMAP_FORCE_NEVER_NULL_USAGE
@ LIBRARY_TAG_RESYNC_REQUIRED
#define FOREACH_MAIN_ID_END
ListBase * which_libbase(Main *bmain, short type)
#define FOREACH_MAIN_LISTBASE_ID_END
#define FOREACH_MAIN_LISTBASE_ID_BEGIN(_lb, _id)
#define FOREACH_MAIN_LISTBASE_END
eMainIDRelationsEntryTags
@ MAINIDRELATIONS_ENTRY_TAGS_PROCESSED_TO
@ MAINIDRELATIONS_ENTRY_TAGS_PROCESSED
@ MAINIDRELATIONS_ENTRY_TAGS_INPROGRESS
@ MAINIDRELATIONS_ENTRY_TAGS_DOIT
@ MAINIDRELATIONS_ENTRY_TAGS_PROCESSED_FROM
void BKE_main_relations_tag_set(Main *bmain, eMainIDRelationsEntryTags tag, bool value)
#define FOREACH_MAIN_LISTBASE_BEGIN(_bmain, _lb)
void BKE_main_relations_create(Main *bmain, short flag)
#define FOREACH_MAIN_ID_BEGIN(_bmain, _id)
void BKE_main_relations_free(Main *bmain)
void BKE_main_namemap_remove_id(Main &bmain, ID &id)
void BKE_main_namemap_destroy(UniqueName_Map **r_name_map) ATTR_NONNULL()
bool BKE_main_global_namemap_get_unique_name(Main &bmain, ID &id, char *r_name)
bool BKE_main_namemap_validate(Main &bmain)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
#define BLI_assert_unreachable()
#define BLI_assert_msg(a, msg)
bool BLI_ghashutil_strcmp(const void *a, const void *b)
BLI_INLINE void * BLI_ghashIterator_getKey(GHashIterator *ghi) ATTR_WARN_UNUSED_RESULT
bool BLI_ghash_haskey(const GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT
void BLI_ghashIterator_step(GHashIterator *ghi)
void BLI_ghash_clear(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
unsigned int BLI_ghashutil_ptrhash(const void *key)
void BLI_ghashIterator_free(GHashIterator *ghi)
BLI_INLINE void * BLI_ghashIterator_getValue(GHashIterator *ghi) ATTR_WARN_UNUSED_RESULT
#define GHASH_ITER(gh_iter_, ghash_)
void * BLI_gset_lookup(const GSet *gs, const void *key) ATTR_WARN_UNUSED_RESULT
GHash * BLI_ghash_new(GHashHashFP hashfp, GHashCmpFP cmpfp, const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
GHash * BLI_ghash_ptr_new(const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
GHashIterator * BLI_ghashIterator_new(GHash *gh) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
void ** BLI_ghash_lookup_p(GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT
void * BLI_ghash_popkey(GHash *gh, const void *key, GHashKeyFreeFP keyfreefp) ATTR_WARN_UNUSED_RESULT
bool BLI_ghashutil_ptrcmp(const void *a, const void *b)
unsigned int BLI_ghashutil_strhash_p_murmur(const void *ptr)
bool BLI_ghash_remove(GHash *gh, const void *key, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
void * BLI_ghash_lookup(const GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT
void BLI_ghash_insert(GHash *gh, void *key, void *val)
void BLI_ghash_free(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
void BLI_gset_free(GSet *gs, GSetKeyFreeFP keyfreefp)
bool BLI_ghash_ensure_p(GHash *gh, void *key, void ***r_val) ATTR_WARN_UNUSED_RESULT
BLI_INLINE bool BLI_ghashIterator_done(const GHashIterator *ghi) ATTR_WARN_UNUSED_RESULT
void BLI_linklist_append_arena(LinkNodePair *list_pair, void *ptr, struct MemArena *ma) ATTR_NONNULL(1
void BLI_linklist_free(LinkNode *list, LinkNodeFreeFP freefunc)
void void void void BLI_linklist_append(LinkNodePair *list_pair, void *ptr) ATTR_NONNULL(1)
int BLI_linklist_index(const LinkNode *list, const void *ptr) ATTR_WARN_UNUSED_RESULT
void void BLI_linklist_prepend(LinkNode **listp, void *ptr) ATTR_NONNULL(1)
int BLI_findindex(const ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define LISTBASE_FOREACH(type, var, list)
BLI_INLINE void BLI_listbase_clear(ListBase *lb)
void * BLI_findstring(const ListBase *listbase, const char *id, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
BLI_INLINE bool BLI_listbase_is_empty(const ListBase *lb)
void BLI_insertlinkreplace(ListBase *listbase, void *vreplacelink, void *vnewlink) ATTR_NONNULL(1
void BLI_freelinkN(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
void void BLI_freelistN(ListBase *listbase) ATTR_NONNULL(1)
void * BLI_listbase_findafter_string_ptr(Link *link, const char *id, int offset)
void BLI_addtail(ListBase *listbase, void *vlink) 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
void * BLI_findstring_ptr(const ListBase *listbase, const char *id, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void void void void void void BLI_duplicatelist(ListBase *dst, const ListBase *src) ATTR_NONNULL(1
#define BLI_MEMARENA_STD_BUFSIZE
MemArena * BLI_memarena_new(size_t bufsize, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL ATTR_NONNULL(2) ATTR_MALLOC
void * BLI_memarena_calloc(MemArena *ma, size_t size) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC ATTR_ALLOC_SIZE(2)
void BLI_memarena_free(MemArena *ma) ATTR_NONNULL(1)
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC
char * STRNCPY(char(&dst)[N], const char *src)
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
void * BLI_task_pool_user_data(TaskPool *pool)
void BLI_task_pool_work_and_wait(TaskPool *pool)
TaskPool * BLI_task_pool_create(void *userdata, eTaskPriority priority)
void BLI_task_pool_free(TaskPool *pool)
void BLI_task_pool_push(TaskPool *pool, TaskRunFunction run, void *taskdata, bool free_taskdata, TaskFreeFunction freedata)
Platform independent time functions.
double BLI_time_now_seconds(void)
Utility defines for timing/benchmarks.
#define TIMEIT_START_AVERAGED(var)
#define TIMEIT_END_AVERAGED(var)
#define UNUSED_VARS_NDEBUG(...)
external readfile function prototypes.
#define CLOG_ERROR(clg_ref,...)
#define CLOG_WARN(clg_ref,...)
#define CLOG_INFO(clg_ref, level,...)
void DEG_id_tag_update(ID *id, unsigned int flags)
void DEG_relations_tag_update(Main *bmain)
ID and Library types, which are fundamental for SDNA.
@ LIBOVERRIDE_PROP_TAG_NEEDS_RETORE
@ LIBOVERRIDE_PROP_OP_TAG_UNUSED
@ LIBOVERRIDE_OP_FLAG_IDPOINTER_ITEM_USE_ID
@ LIBOVERRIDE_OP_FLAG_IDPOINTER_MATCH_REFERENCE
@ ID_TAG_NO_USER_REFCOUNT
@ ID_TAG_LIBOVERRIDE_AUTOREFRESH
@ ID_TAG_LIBOVERRIDE_NEED_RESYNC
@ ID_TAG_LIBOVERRIDE_REFOK
@ ID_FLAG_EMBEDDED_DATA_LIB_OVERRIDE
@ ID_FLAG_LIB_OVERRIDE_RESYNC_LEFTOVER
@ LIBOVERRIDE_OP_SUBTRACT
@ LIBOVERRIDE_OP_MULTIPLY
@ LIBOVERRIDE_OP_INSERT_BEFORE
@ LIBOVERRIDE_OP_INSERT_AFTER
@ LIBOVERRIDE_FLAG_NO_HIERARCHY
@ LIBOVERRIDE_FLAG_SYSTEM_DEFINED
@ LIBOVERRIDE_TAG_NEEDS_RESTORE
@ LIBOVERRIDE_TAG_RESYNC_ISOLATED_FROM_ROOT
@ LIBOVERRIDE_TAG_NEEDS_RELOAD
@ LIBOVERRIDE_TAG_NEED_RESYNC_ORIGINAL
Object groups, one object can be in many groups at once.
@ COLLECTION_HIDE_VIEWPORT
Object is a sort of wrapper for general info.
#define OB_DATA_SUPPORT_ID(_id_type)
#define USER_EXPERIMENTAL_TEST(userdef, member)
Read Guarded memory(de)allocation.
@ RNA_OVERRIDE_APPLY_FLAG_IGNORE_ID_POINTERS
@ RNA_OVERRIDE_APPLY_FLAG_SKIP_RESYNC_CHECK
@ RNA_OVERRIDE_APPLY_FLAG_NOP
@ RNA_OVERRIDE_APPLY_FLAG_RESTORE_ONLY
@ RNA_OVERRIDE_COMPARE_IGNORE_OVERRIDDEN
@ RNA_OVERRIDE_COMPARE_CREATE
@ RNA_OVERRIDE_COMPARE_IGNORE_NON_OVERRIDABLE
@ RNA_OVERRIDE_COMPARE_RESTORE
@ RNA_OVERRIDE_COMPARE_TAG_FOR_RESTORE
@ RNA_OVERRIDE_MATCH_RESULT_RESTORED
@ RNA_OVERRIDE_MATCH_RESULT_RESTORE_TAGGED
@ RNA_OVERRIDE_MATCH_RESULT_CREATED
@ RNA_OVERRIDE_MATCH_RESULT_INIT
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)
BMesh const char void * data
Value lookup_default(const Key &key, const Value &default_value) const
bool contains(const Key &key) const
void append(const T &value)
void add(ID *old_id, ID *new_id)
#define ID_IS_OVERRIDE_LIBRARY_VIRTUAL(_id)
#define ID_IS_OVERRIDE_LIBRARY_REAL(_id)
#define ID_IS_LINKED(_id)
#define ID_REAL_USERS(id)
#define ID_IS_OVERRIDE_LIBRARY(_id)
DEG_id_tag_update_ex(cb_data->bmain, cb_data->owner_id, ID_RECALC_TAG_FOR_UNDO|ID_RECALC_SYNC_TO_EVAL)
void lib_id_copy_ensure_local(Main *bmain, const ID *old_id, ID *new_id, const int flags)
void BKE_lib_override_library_main_hierarchy_root_ensure(Main *bmain)
void BKE_lib_override_library_main_tag(Main *bmain, const short tag, const bool do_set)
static bool lib_override_hierarchy_dependencies_recursive_tag(LibOverrideGroupTagData *data)
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)
static LibOverrideMissingIDsData_Key lib_override_library_resync_missing_id_key(ID *id)
static LibOverrideMissingIDsData lib_override_library_resync_build_missing_ids_data(Main *bmain, const bool is_relocate)
static bool lib_override_resync_id_lib_level_is_valid(ID *id, const int library_indirect_level, const bool do_strict_equal)
static void lib_override_library_property_clear(IDOverrideLibraryProperty *op)
static void lib_override_resync_tagging_finalize(Main *bmain, GHash *id_roots, const int library_indirect_level)
static bool lib_override_library_resync(Main *bmain, const blender::Map< Library *, Library * > *new_to_old_libraries_map, Scene *scene, ViewLayer *view_layer, ID *id_root, LinkNode *id_resync_roots, ListBase *no_main_ids_list, Collection *override_resync_residual_storage, const bool do_hierarchy_enforce, const bool do_post_process, BlendFileReadReport *reports)
static bool override_library_is_valid(const ID &id, const IDOverrideLibrary &liboverride, ReportList *reports)
BLI_INLINE GHash * override_library_rna_path_mapping_ensure(IDOverrideLibrary *liboverride)
std::map< LibOverrideMissingIDsData_Key, LibOverrideMissingIDsData_Value > LibOverrideMissingIDsData
static void lib_override_group_tag_data_object_to_collection_init_collection_process(LibOverrideGroupTagData *data, Collection *collection)
static void lib_override_group_tag_data_object_to_collection_init(LibOverrideGroupTagData *data)
static void lib_override_hierarchy_dependencies_recursive_tag_from(LibOverrideGroupTagData *data)
static IDOverrideLibraryPropertyOperation * liboverride_opop_find_name_lib_iterative(ListBase *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_lib_override_library_property_rna_path_change(IDOverrideLibrary *liboverride, const char *old_rna_path, const char *new_rna_path)
void BKE_lib_override_library_property_operation_delete(IDOverrideLibraryProperty *liboverride_property, IDOverrideLibraryPropertyOperation *liboverride_property_operation)
void BKE_lib_override_library_main_validate(Main *bmain, ReportList *reports)
IDOverrideLibraryProperty * BKE_lib_override_library_property_find(IDOverrideLibrary *liboverride, const char *rna_path)
static void lib_override_overrides_group_tag_recursive(LibOverrideGroupTagData *data)
static ID * lib_override_root_find(Main *bmain, ID *id, const int curr_level, int *r_best_level)
IDOverrideLibraryPropertyOperation * BKE_lib_override_library_property_operation_get(IDOverrideLibraryProperty *liboverride_property, const short operation, const char *subitem_refname, const char *subitem_locname, const std::optional< ID * > &subitem_refid, const std::optional< ID * > &subitem_locid, const int subitem_refindex, const int subitem_locindex, const bool strict, bool *r_strict, bool *r_created)
void BKE_lib_override_library_main_operations_create(Main *bmain, const bool force_auto, int *r_report_flags)
void BKE_lib_override_library_main_operations_restore(Main *bmain, int *r_report_flags)
void BKE_lib_override_library_properties_tag(IDOverrideLibrary *liboverride, const short tag, const bool do_set)
void BKE_lib_override_debug_print(IDOverrideLibrary *liboverride, const char *intro_txt)
bool BKE_lib_override_library_id_is_user_deletable(Main *bmain, ID *id)
IDOverrideLibraryProperty * BKE_lib_override_library_property_get(IDOverrideLibrary *liboverride, const char *rna_path, bool *r_created)
static void lib_override_linked_group_tag(LibOverrideGroupTagData *data)
bool BKE_lib_override_library_is_system_defined(const Main *bmain, const ID *id)
bool BKE_lib_override_library_property_is_animated(const ID *id, const IDOverrideLibraryProperty *liboverride_prop, const PropertyRNA *override_rna_prop, const int rnaprop_index)
#define OVERRIDE_RESYNC_RESIDUAL_STORAGE_NAME
void BKE_lib_override_id_tag_on_deg_tag_from_user(ID *id)
static bool lib_override_root_is_valid(Main *bmain, ID *id)
bool BKE_lib_override_library_property_search_and_delete(IDOverrideLibrary *liboverride, const char *rna_path)
static void lib_override_root_hierarchy_set(Main *bmain, ID *id_root, ID *id, ID *id_from, blender::Set< ID * > &processed_ids)
static void lib_override_library_operations_create(Main *bmain, ID *local, const eRNAOverrideMatch liboverride_match_flags, eRNAOverrideMatchResult *r_report_flags)
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)
static void lib_override_library_property_operation_copy(IDOverrideLibraryPropertyOperation *opop_dst, IDOverrideLibraryPropertyOperation *opop_src)
bool BKE_lib_override_library_status_check_reference(Main *bmain, ID *local)
void BKE_lib_override_library_update(Main *bmain, ID *local)
void BKE_lib_override_library_operations_restore(Main *bmain, ID *local, int *r_report_flags)
std::deque< ID * > LibOverrideMissingIDsData_Value
static void lib_override_id_swap(Main *bmain, ID *id_local, ID *id_temp)
static void lib_override_cleanup_after_resync(Main *bmain)
BLI_INLINE IDOverrideLibraryRuntime * override_library_runtime_ensure(IDOverrideLibrary *liboverride)
void BKE_lib_override_library_clear(IDOverrideLibrary *liboverride, const bool do_id_user)
void BKE_lib_override_library_id_unused_cleanup(ID *local)
static void lib_override_library_operations_create_cb(TaskPool *__restrict pool, void *taskdata)
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)
static void override_library_properties_validate(const ID &id, IDOverrideLibrary &liboverride, ReportList *reports)
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)
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)
static bool lib_override_library_id_reset_do(Main *bmain, ID *id_root, const bool do_reset_system_override)
bool BKE_lib_override_library_is_user_edited(const ID *id)
static CLG_LogRef LOG_RESYNC
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, const int subitem_refindex, const int subitem_locindex, const bool strict, bool *r_strict)
static void lib_override_remapper_overrides_add(id::IDRemapper &id_remapper, ID *reference_id, ID *local_id)
static bool lib_override_library_main_resync_on_library_indirect_level(Main *bmain, const blender::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)
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, const bool do_no_main, const bool do_fully_editable)
void BKE_lib_override_library_id_reset(Main *bmain, ID *id_root, const bool do_reset_system_override)
bool BKE_lib_override_rna_property_find(PointerRNA *idpoin, const IDOverrideLibraryProperty *library_prop, PointerRNA *r_override_poin, PropertyRNA **r_override_prop, int *r_index)
bool BKE_lib_override_library_status_check_local(Main *bmain, ID *local)
static void lib_override_linked_group_tag_clear_boneshapes_objects(LibOverrideGroupTagData *data)
void BKE_lib_override_library_operations_create(Main *bmain, ID *local, int *r_report_flags)
static void lib_override_library_id_hierarchy_recursive_reset(Main *bmain, ID *id_root, const bool do_reset_system_override)
bool BKE_lib_override_library_resync(Main *bmain, Scene *scene, ViewLayer *view_layer, ID *id_root, Collection *override_resync_residual_storage, const bool do_hierarchy_enforce, BlendFileReadReport *reports)
static void lib_override_library_property_delete(IDOverrideLibrary *liboverride, IDOverrideLibraryProperty *liboverride_property, const bool do_runtime_updates)
void BKE_lib_override_library_main_resync(Main *bmain, const blender::Map< Library *, Library * > *new_to_old_libraries_map, Scene *scene, ViewLayer *view_layer, BlendFileReadReport *reports)
static int lib_override_sort_libraries_func(LibraryIDLinkCallbackData *cb_data)
static bool lib_override_hierarchy_dependencies_skip_check(ID *owner_id, ID *other_id, const bool check_override)
void BKE_lib_override_library_make_local(Main *bmain, ID *id)
static bool lib_override_linked_group_tag_collections_keep_tagged_check_recursive(LibOverrideGroupTagData *data, Collection *collection)
IDOverrideLibrary * BKE_lib_override_library_init(ID *local_id, ID *reference_id)
void BKE_lib_override_library_validate(Main *bmain, ID *id, ReportList *reports)
BLI_INLINE void lib_override_object_posemode_transfer(ID *id_dst, ID *id_src)
const std::pair< std::string, Library * > LibOverrideMissingIDsData_Key
static bool lib_override_hierarchy_dependencies_relationship_skip_check(MainIDRelationsEntryItem *relation_id_entry)
static void lib_override_library_remap(Main *bmain, const ID *id_root_reference, blender::Vector< std::pair< ID *, ID * > > &references_and_new_overrides, GHash *linkedref_to_old_override)
void BKE_lib_override_library_delete(Main *bmain, ID *id_root)
static bool lib_override_library_main_resync_id_skip_check(ID *id, const int library_indirect_level)
bool BKE_lib_override_library_is_hierarchy_leaf(Main *bmain, ID *id)
static void lib_override_linked_group_tag_recursive(LibOverrideGroupTagData *data)
static int foreachid_is_hierarchy_leaf_fn(LibraryIDLinkCallbackData *cb_data)
static ID * lib_override_library_resync_search_missing_ids_data(LibOverrideMissingIDsData &missing_ids, ID *id_override)
void BKE_lib_override_library_id_hierarchy_reset(Main *bmain, ID *id_root, const bool do_reset_system_override)
void BKE_lib_override_library_property_delete(IDOverrideLibrary *liboverride, IDOverrideLibraryProperty *liboverride_property)
static void lib_override_library_property_operation_clear(IDOverrideLibraryPropertyOperation *opop)
void BKE_lib_override_library_main_update(Main *bmain)
void BKE_lib_override_library_main_unused_cleanup(Main *bmain)
static void lib_override_overrides_group_tag(LibOverrideGroupTagData *data)
ID * BKE_lib_override_library_create_from_id(Main *bmain, ID *reference_id, const bool do_tagged_remap)
#define HIERARCHY_BREAKING_ID_TYPES
static ID * lib_override_library_create_from(Main *bmain, Library *owner_library, ID *reference_id, const int lib_id_copy_flags)
void BKE_lib_override_library_operations_tag(IDOverrideLibraryProperty *liboverride_property, const short tag, const bool do_set)
void BKE_lib_override_library_free(IDOverrideLibrary **liboverride, const bool do_id_user)
BLI_INLINE const IDOverrideLibrary * BKE_lib_override_library_get(const Main *, const ID *id, const ID *, const ID **r_owner_id)
static void lib_override_prefill_newid_from_existing_overrides(Main *bmain, ID *id_hierarchy_root)
void BKE_lib_override_library_copy(ID *dst_id, const ID *src_id, const bool do_full_copy)
static int lib_override_libraries_index_define(Main *bmain)
static bool lib_override_resync_tagging_finalize_recursive_check_from(Main *bmain, ID *id, const int library_indirect_level)
static void lib_override_library_property_copy(IDOverrideLibraryProperty *op_dst, IDOverrideLibraryProperty *op_src)
void BKE_lib_query_unused_ids_tag(Main *bmain, const int tag, LibQueryUnusedIDsData ¶meters)
void * MEM_callocN(size_t len, const char *str)
void MEM_freeN(void *vmemh)
bool is_auto_resync_enabled()
bNodeTree * node_tree_from_id(ID *id)
bool RNA_struct_is_ID(const StructRNA *type)
StructRNA * RNA_property_pointer_type(PointerRNA *ptr, PropertyRNA *prop)
PropertyType RNA_property_type(PropertyRNA *prop)
PointerRNA RNA_property_pointer_get(PointerRNA *ptr, PropertyRNA *prop)
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
PointerRNA RNA_id_pointer_create(ID *id)
void RNA_struct_override_apply(Main *bmain, PointerRNA *id_ptr_dst, PointerRNA *id_ptr_src, PointerRNA *id_ptr_storage, IDOverrideLibrary *liboverride, const eRNAOverrideApplyFlag flag)
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)
const char * RNA_path_array_index_token_find(const char *rna_path, const PropertyRNA *array_prop)
bool RNA_path_resolve_property(const PointerRNA *ptr, const char *path, PointerRNA *r_ptr, PropertyRNA **r_prop)
bool RNA_path_resolve_property_full(const PointerRNA *ptr, const char *path, PointerRNA *r_ptr, PropertyRNA **r_prop, int *r_index)
struct CollectionChild * next
struct CollectionObject * next
struct IDOverrideLibraryPropertyOperation * next
int subitem_reference_index
char * subitem_local_name
struct ID * subitem_reference_id
struct ID * subitem_local_id
char * subitem_reference_name
struct IDOverrideLibraryProperty * next
struct GHash * rna_path_to_override_properties
struct ID * hierarchy_root
IDOverrideLibraryRuntime * runtime
IDOverrideLibrary * override_library
bool id_tag_clear(ID *id, const bool is_missing)
blender::Set< ID * > linked_ids_hierarchy_default_override
ID * hierarchy_root_id_override
void root_set(ID *id_root)
void hierarchy_root_set(ID *hierarchy_root_id)
bool do_create_linked_overrides_set
GHash * linked_object_to_instantiating_collections
ID * hierarchy_root_id_reference
ID * hierarchy_root_get()
bool id_tag_set(ID *id, const bool is_missing)
eRNAOverrideMatchResult report_flags
std::array< int, INDEX_ID_MAX > num_total
std::array< int, INDEX_ID_MAX > num_local
blender::FunctionRef< bool(ID *id)> filter_fn
LibraryForeachIDCallbackFlag cb_flag
LibraryRuntimeHandle * runtime
MainIDRelationsEntryItem * next
LibraryForeachIDCallbackFlag usage_flag
MainIDRelationsEntryItem * from_ids
MainIDRelationsEntryItem * to_ids
GHash * relations_from_pointers
UniqueName_Map * name_map_global
MainIDRelations * relations
struct Collection * master_collection
struct bPoseChannel * next
ccl_device_inline bool is_leaf(const ccl_global KernelLightTreeNode *knode)