62#include "RNA_prototypes.hh"
71#ifdef DEBUG_OVERRIDE_TIMEIT
92 if (liboverride->
runtime ==
nullptr) {
93 liboverride->
runtime = MEM_cnew<IDOverrideLibraryRuntime>(__func__);
119 const ID **r_owner_id)
123 BLI_assert_msg(owner_id !=
nullptr,
"Liboverride-embedded ID with no owner");
124 if (r_owner_id !=
nullptr) {
125 *r_owner_id = owner_id;
130 if (r_owner_id !=
nullptr) {
145 const_cast<const ID *
>(
id),
146 const_cast<const ID *
>(owner_id_hint),
147 const_cast<const ID **
>(r_owner_id)));
162 local_id->
tag &= ~ID_TAG_LIBOVERRIDE_REFOK;
205 op_dst = op_dst->next, op_src = op_src->next)
211 dst_id->
tag &= ~ID_TAG_LIBOVERRIDE_REFOK;
238 if ((*liboverride)->runtime !=
nullptr) {
239 if ((*liboverride)->runtime->rna_path_to_override_properties !=
nullptr) {
240 BLI_ghash_free((*liboverride)->runtime->rna_path_to_override_properties,
nullptr,
nullptr);
247 *liboverride =
nullptr;
253 const int lib_id_copy_flags)
263 if (local_id ==
nullptr) {
342 const ID *override_owner_id;
353 const int rnaprop_index)
356 if (anim_data !=
nullptr) {
358 char *index_token_start =
const_cast<char *
>(
360 if (index_token_start !=
nullptr) {
361 const char index_token_start_backup = *index_token_start;
362 *index_token_start =
'\0';
364 anim_data, liboverride_prop->
rna_path, rnaprop_index,
nullptr,
nullptr);
365 *index_token_start = index_token_start_backup;
369 anim_data, liboverride_prop->
rna_path, 0,
nullptr,
nullptr);
371 if (fcurve !=
nullptr) {
424 const bool do_tagged_remap)
437 if (do_tagged_remap) {
438 Key *reference_key, *local_key =
nullptr;
454 if (reference_key !=
nullptr) {
479 id =
reinterpret_cast<Key *
>(id_iter)->from;
483 id->override_library->hierarchy_root == id_hierarchy_root)
485 id->override_library->reference->newid = id;
488 if (reference_key !=
nullptr) {
489 reference_key->
id.
newid = id_iter;
501 id_remapper.
add(reference_id, local_id);
503 Key *reference_key, *local_key =
nullptr;
505 if (reference_id->
newid !=
nullptr) {
510 id_remapper.
add(&reference_key->
id, &local_key->
id);
516 const ID *id_root_reference,
517 ID *id_hierarchy_root,
518 const ID *id_hierarchy_root_reference,
519 const bool do_no_main,
520 const bool do_fully_editable)
528 BLI_assert(id_hierarchy_root !=
nullptr || id_hierarchy_root_reference !=
nullptr ||
532 BLI_assert(
ELEM(
nullptr, id_hierarchy_root, id_hierarchy_root_reference));
534 if (id_hierarchy_root !=
nullptr) {
547 if (!
ELEM(id_hierarchy_root_reference,
nullptr, id_root_reference)) {
554 const Library *reference_library = id_root_reference->
lib;
564 if ((reference_id->
tag &
ID_TAG_DOIT) != 0 && reference_id->
lib == reference_library &&
567 todo_id_iter = MEM_cnew<LinkData>(__func__);
568 todo_id_iter->
data = reference_id;
575 for (todo_id_iter =
static_cast<LinkData *
>(todo_ids.
first); todo_id_iter !=
nullptr;
576 todo_id_iter = todo_id_iter->
next)
578 reference_id =
static_cast<ID *
>(todo_id_iter->
data);
582 if (reference_id->
newid ==
nullptr) {
588 if (reference_id->
newid ==
nullptr) {
592 if (do_fully_editable) {
605 reference_key->
id.
newid = &local_key->
id;
617 const bool do_remap_liboverride_hierarchy_only = (id_hierarchy_root !=
nullptr && !do_no_main);
619 if (id_hierarchy_root_reference !=
nullptr) {
620 id_hierarchy_root = id_hierarchy_root_reference->
newid;
622 else if (id_root_reference->
newid !=
nullptr &&
623 (id_hierarchy_root ==
nullptr ||
626 id_hierarchy_root = id_root_reference->
newid;
639 if (do_no_main && id->lib == id_root_reference->
lib && id->newid !=
nullptr) {
640 other_id =
id->
newid;
646 other_id->
lib =
nullptr;
660 if (!do_remap_liboverride_hierarchy_only ||
664 relinked_ids.
append(other_id);
671 ID *local_id = reference_id->
newid;
672 if (other_id == local_id) {
677 if (other_id !=
id) {
678 other_id->
lib = id_root_reference->
lib;
683 for (todo_id_iter =
static_cast<LinkData *
>(todo_ids.
first); todo_id_iter !=
nullptr;
684 todo_id_iter = todo_id_iter->
next)
686 reference_id =
static_cast<ID *
>(todo_id_iter->
data);
687 ID *local_id = reference_id->
newid;
689 if (local_id ==
nullptr) {
704 relinked_ids.
clear();
708 for (todo_id_iter =
static_cast<LinkData *
>(todo_ids.
first); todo_id_iter !=
nullptr;
709 todo_id_iter = todo_id_iter->
next)
711 reference_id =
static_cast<ID *
>(todo_id_iter->
data);
713 reference_id->
newid =
nullptr;
793 else if (is_missing) {
806 else if (is_missing) {
807 id->tag &= ~missing_tag;
843 Object *ob = collection_object->ob;
851 reinterpret_cast<void ***
>(&collections_linkedlist_p)))
853 *collections_linkedlist_p =
static_cast<LinkNodePair *
>(
869 data->linked_object_to_instantiating_collections =
BLI_ghash_new(
871 if (data->scene !=
nullptr) {
873 data, data->scene->master_collection);
896 const bool check_override)
899 if (
ELEM(other_id,
nullptr, owner_id)) {
903 if (other_id->
lib != owner_id->
lib) {
907 if (check_override) {
910 "When processing liboverrides, the owner ID should always be a liboverride too here.");
922#define HIERARCHY_BREAKING_ID_TYPES ID_SCE, ID_LI, ID_SCR, ID_WM, ID_WS
928#undef HIERARCHY_BREAKING_ID_TYPES
935 Main *bmain = data->bmain;
936 ID *
id = data->root_get();
937 const bool is_override = data->is_override;
939 if ((*
reinterpret_cast<uint *
>(&id->tag) & data->tag) == 0) {
957 from_id_entry = from_id_entry->next)
962 ID *from_id = from_id_entry->id_pointer.from;
967 from_id->
tag |= data->tag;
968 data->root_set(from_id);
982 Main *bmain = data->bmain;
983 ID *
id = data->root_get();
984 const bool is_override = data->is_override;
985 const bool is_resync = data->is_resync;
993 return (*
reinterpret_cast<uint *
>(&id->tag) & data->tag) != 0;
1000 to_id_entry = to_id_entry->next)
1005 ID *to_id = *to_id_entry->id_pointer.to;
1010 data->root_set(to_id);
1012 id->
tag |= data->tag;
1022 if ((*
reinterpret_cast<uint *
>(&id->tag) & data->tag) != 0 && !is_resync) {
1026 return (*
reinterpret_cast<uint *
>(&id->tag) & data->tag) != 0;
1031 Main *bmain = data->bmain;
1032 ID *id_owner = data->root_get();
1049 to_id_entry = to_id_entry->next)
1054 ID *to_id = *to_id_entry->id_pointer.to;
1067 data->linked_ids_hierarchy_default_override.contains(to_id))
1071 data->root_set(to_id);
1076 data->root_set(id_owner);
1088 collection_object !=
nullptr;
1089 collection_object = collection_object->next)
1091 Object *
object = collection_object->ob;
1092 if (
object ==
nullptr) {
1095 if ((object->id.tag & data->tag) != 0 ||
1096 data->linked_ids_hierarchy_default_override.contains(&object->id))
1104 collection_child !=
nullptr;
1105 collection_child = collection_child->
next)
1108 data, collection_child->collection))
1119 Main *bmain = data->bmain;
1120 ID *id_root = data->root_get();
1125 if (ob->id.lib != id_root->
lib) {
1128 if (ob->type ==
OB_ARMATURE && ob->pose !=
nullptr &&
1129 ((ob->id.tag & data->tag) ||
1130 data->linked_ids_hierarchy_default_override.contains(&ob->id)))
1134 pchan = pchan->next)
1136 if (pchan->custom !=
nullptr && &pchan->custom->id != id_root) {
1137 data->id_tag_clear(&pchan->custom->id,
bool(pchan->custom->id.tag &
ID_TAG_MISSING));
1146 if (!((collection->id.tag & data->tag) != 0 ||
1147 data->linked_ids_hierarchy_default_override.contains(&collection->id)) ||
1148 &collection->id == id_root || collection->id.
lib != id_root->
lib)
1154 data->id_tag_clear(&collection->id,
bool(collection->id.tag &
ID_TAG_MISSING));
1172 Main *bmain = data->bmain;
1173 ID *id_root = data->root_get();
1174 ID *hierarchy_root_id = data->hierarchy_root_get();
1175 const bool is_resync = data->is_resync;
1179 id_root->
tag |= data->missing_tag;
1192 const bool use_linked_overrides_set = hierarchy_root_id &&
1193 hierarchy_root_id->
lib == id_root->
lib &&
1194 hierarchy_root_id != id_root;
1196 BLI_assert(data->do_create_linked_overrides_set ==
false);
1197 if (use_linked_overrides_set) {
1198 BLI_assert(data->linked_ids_hierarchy_default_override.is_empty());
1199 data->linked_ids_hierarchy_default_override.add(id_root);
1200 data->linked_ids_hierarchy_default_override.add(hierarchy_root_id);
1201 data->do_create_linked_overrides_set =
true;
1204 data->root_set(hierarchy_root_id);
1211 data->root_set(id_root);
1212 data->do_create_linked_overrides_set =
false;
1216 id_root->
tag |= data->tag;
1222 if (use_linked_overrides_set) {
1223 data->linked_ids_hierarchy_default_override.clear();
1247 if (
ID_IS_LINKED(ob) && (ob->id.tag & data->tag) != 0) {
1248 Collection *instantiating_collection =
nullptr;
1249 Collection *instantiating_collection_override_candidate =
nullptr;
1254 if (instantiating_collection_linklist !=
nullptr) {
1255 for (
LinkNode *instantiating_collection_linknode = instantiating_collection_linklist->
list;
1256 instantiating_collection_linknode !=
nullptr;
1257 instantiating_collection_linknode = instantiating_collection_linknode->next)
1259 instantiating_collection =
static_cast<Collection *
>(
1260 instantiating_collection_linknode->link);
1266 if (instantiating_collection->
id.
tag & data->tag ||
1267 data->linked_ids_hierarchy_default_override.contains(&instantiating_collection->
id))
1273 instantiating_collection_override_candidate = instantiating_collection;
1274 instantiating_collection =
nullptr;
1278 if (instantiating_collection ==
nullptr &&
1279 instantiating_collection_override_candidate !=
nullptr)
1282 &instantiating_collection_override_candidate->
id,
1291 Main *bmain = data->bmain;
1292 ID *id_owner = data->root_get();
1295 BLI_assert(data->do_create_linked_overrides_set ==
false);
1297 ID *id_hierarchy_root = data->hierarchy_root_get();
1318 to_id_entry = to_id_entry->next)
1323 ID *to_id = *to_id_entry->id_pointer.to;
1335 const Library *reference_lib =
1337 const ID *to_id_reference =
1339 if (to_id_reference->
lib != reference_lib) {
1347 data->root_set(to_id);
1350 data->root_set(id_owner);
1356 ID *id_root = data->root_get();
1359 BLI_assert(data->do_create_linked_overrides_set ==
false);
1361 ID *id_hierarchy_root = data->hierarchy_root_get();
1375 ID *id_root_reference,
1376 ID *id_hierarchy_root_reference,
1377 const bool do_fully_editable)
1385 data.is_override =
false;
1386 data.is_resync =
false;
1388 data.root_set(id_root_reference);
1389 data.hierarchy_root_set(id_hierarchy_root_reference);
1400 if (id_hierarchy_root_reference->
lib != id_root_reference->
lib) {
1403 id_root_reference->
lib);
1406 data.is_override =
true;
1407 data.root_set(id_hierarchy_root_reference);
1408 data.hierarchy_root_set(id_hierarchy_root_reference);
1415 bool success =
false;
1416 if (id_hierarchy_root_reference->
lib != id_root_reference->
lib) {
1420 id_hierarchy_root_reference,
1430 id_hierarchy_root_reference,
1447 ID *id_instance_hint,
1449 const Object *old_active_object,
1450 const bool is_resync)
1453 BLI_assert(old_active_object ==
nullptr || view_layer !=
nullptr);
1469 if (is_resync || id_root ==
nullptr || id_root->
newid ==
nullptr) {
1488 switch (
GS(id_root->
name)) {
1490 Object *ob_reference = id_instance_hint !=
nullptr &&
GS(id_instance_hint->
name) ==
ID_OB ?
1491 reinterpret_cast<Object *
>(id_instance_hint) :
1497 if (ob_reference !=
nullptr) {
1500 else if (id_instance_hint !=
nullptr) {
1503 bmain, scene, (
reinterpret_cast<Collection *
>(id_instance_hint)), collection_new);
1507 bmain, scene, (
reinterpret_cast<Collection *
>(id_root)), collection_new);
1519 bmain, scene,
reinterpret_cast<Object *
>(id_root), ob_new);
1529 if (view_layer !=
nullptr) {
1537 Collection *default_instantiating_collection = residual_storage;
1539 Object *ob_new =
reinterpret_cast<Object *
>(ob->id.newid);
1540 if (ob_new ==
nullptr || (
ID_IS_LINKED(ob_new) && ob_new->
id.
lib != owner_library)) {
1547 if (old_active_object == ob) {
1553 if (basact !=
nullptr) {
1554 view_layer->
basact = basact;
1560 if (id_root !=
nullptr && default_instantiating_collection ==
nullptr) {
1561 ID *id_ref = id_root->
newid !=
nullptr ? id_root->
newid : id_root;
1562 switch (
GS(id_ref->
name)) {
1574 default_instantiating_collection =
static_cast<Collection *
>(
1588 (view_layer !=
nullptr ?
1593 default_instantiating_collection = collection;
1602 if (default_instantiating_collection ==
nullptr) {
1603 default_instantiating_collection = scene->master_collection;
1611 if (id_root !=
nullptr &&
1612 !
ELEM(default_instantiating_collection,
nullptr, scene->master_collection))
1614 ID *id_ref = id_root->
newid !=
nullptr ? id_root->
newid : id_root;
1615 switch (
GS(id_ref->
name)) {
1620 default_instantiating_collection);
1625 bmain, scene,
nullptr, default_instantiating_collection);
1637 ID *id_root_reference,
1638 ID *id_hierarchy_root_reference,
1639 ID *id_instance_hint,
1640 ID **r_id_root_override,
1641 const bool do_fully_editable)
1643 if (r_id_root_override !=
nullptr) {
1644 *r_id_root_override =
nullptr;
1647 if (id_hierarchy_root_reference ==
nullptr) {
1648 id_hierarchy_root_reference = id_root_reference;
1655 const Object *old_active_object = (view_layer !=
nullptr) ?
1663 id_hierarchy_root_reference,
1670 if (r_id_root_override !=
nullptr) {
1671 *r_id_root_override = id_root_reference->
newid;
1696 if (curr_level > 1000) {
1698 "Levels of dependency relationships between library overrides IDs is way too high, "
1699 "skipping further processing loops (involves at least '%s')",
1716 *r_best_level = curr_level;
1717 return id->override_library->hierarchy_root;
1722 int best_level_placeholder = 0;
1736 int best_level_candidate = curr_level;
1737 ID *best_root_id_candidate = id;
1740 from_id_entry = from_id_entry->next)
1745 ID *from_id = from_id_entry->id_pointer.from;
1750 int level_candidate = curr_level + 1;
1753 bmain, from_id, curr_level + 1, &level_candidate);
1754 if (level_candidate > best_level_candidate && root_id_candidate !=
nullptr) {
1755 best_root_id_candidate = root_id_candidate;
1756 best_level_candidate = level_candidate;
1763 int best_level_placeholder = 0;
1766 bmain, id_owner, curr_level + 1, &best_level_placeholder);
1769 BLI_assert(best_root_id_candidate !=
nullptr);
1774 entry->
tags &= ~MAINIDRELATIONS_ENTRY_TAGS_INPROGRESS;
1777 *r_best_level = best_level_candidate;
1778 return best_root_id_candidate;
1790 if (id->override_library->hierarchy_root == id_root) {
1798 if (id->override_library->hierarchy_root !=
nullptr) {
1808 "Inconsistency in library override hierarchy of ID '%s'.\n"
1809 "\tNot enough data to verify validity of current proposed root '%s', assuming "
1810 "already set one '%s' is valid.",
1813 id->override_library->hierarchy_root->name);
1823 bool do_replace_root = (!
id->override_library->hierarchy_root ||
1825 id->override_library->hierarchy_root->lib !=
id->lib);
1827 from_id_entry = from_id_entry->next)
1834 if (id_from_ref == from_id_entry->id_pointer.from) {
1837 do_replace_root =
true;
1840 "Inconsistency in library override hierarchy of ID '%s'.\n"
1841 "\tCurrent proposed root '%s' detected as valid, will replace already set one '%s'.",
1844 id->override_library->hierarchy_root->name);
1849 if (!do_replace_root) {
1852 "Inconsistency in library override hierarchy of ID '%s'.\n"
1853 "\tCurrent proposed root '%s' not detected as valid, keeping already set one '%s'.",
1856 id->override_library->hierarchy_root->name);
1863 "Modifying library override hierarchy of ID '%s'.\n"
1864 "\tFrom old root '%s' to new root '%s'.",
1866 id->override_library->hierarchy_root ? id->override_library->hierarchy_root->name :
1870 id->override_library->hierarchy_root = id_root;
1878 to_id_entry = to_id_entry->next)
1883 ID *to_id = *to_id_entry->id_pointer.to;
1902 processed_ids.
add(
id);
1905 if (id->override_library->hierarchy_root !=
nullptr) {
1907 id->override_library->hierarchy_root->lib != id->lib)
1911 "Existing override hierarchy root ('%s') for ID '%s' is invalid, will try to find a "
1913 id->override_library->hierarchy_root !=
nullptr ?
1914 id->override_library->hierarchy_root->name :
1917 id->override_library->hierarchy_root =
nullptr;
1921 processed_ids.
add(
id);
1932 if (!
ELEM(id->override_library->hierarchy_root, id_root,
nullptr)) {
1936 "Potential inconsistency in library override hierarchy of ID '%s' (current root "
1937 "%s), detected as part of the hierarchy of '%s' (current root '%s')",
1939 id->override_library->hierarchy_root !=
nullptr ?
1940 id->override_library->hierarchy_root->name :
1946 processed_ids.
add(
id);
1952 BLI_assert(id->override_library->hierarchy_root !=
nullptr);
1961 const ID *id_root_reference,
1963 GHash *linkedref_to_old_override)
1977 for (
auto [id_reference, id_override_new] : references_and_new_overrides) {
1978 new_overrides.
append(id_override_new);
1979 ID *id_override_old =
static_cast<ID *
>(
1981 if (id_override_old ==
nullptr) {
1984 remapper_overrides_old_to_new.
add(id_override_old, id_override_new);
1988 GHASH_ITER (linkedref_to_old_override_iter, linkedref_to_old_override) {
1990 ID *id_override_old_iter =
static_cast<ID *
>(
1993 nomain_ids.
append(id_override_old_iter);
1997 ID *id_reference_iter =
static_cast<ID *
>(
2001 if (!id_reference_iter->
newid) {
2002 remapper_overrides_reference_to_old.
add(id_reference_iter, id_override_old_iter);
2011 remapper_overrides_old_to_new,
2017 remapper_overrides_reference_to_old,
2044 std::map<LibOverrideMissingIDsData_Key, LibOverrideMissingIDsData_Value>;
2055 std::string id_name_key(id->name);
2056 const size_t last_key_index = id_name_key.find_last_not_of(
"0123456789");
2058 BLI_assert(last_key_index != std::string::npos);
2060 if (id_name_key[last_key_index] ==
'.') {
2061 id_name_key.resize(last_key_index);
2076 if ((id_iter->
tag & required_tags) != required_tags) {
2081 std::pair<LibOverrideMissingIDsData::iterator, bool> value = missing_ids.try_emplace(
2083 value.first->second.push_back(id_iter);
2094 const LibOverrideMissingIDsData::iterator value = missing_ids.find(key);
2095 if (value == missing_ids.end()) {
2098 if (value->second.empty()) {
2101 ID *match_id = value->second.front();
2102 value->second.pop_front();
2112 Collection *override_resync_residual_storage,
2113 const bool do_hierarchy_enforce,
2114 const bool do_post_process,
2122 const Object *old_active_object =
nullptr;
2134 "Impossible to resync data-block %s and its dependencies, as its linked reference "
2146 data.is_override =
true;
2147 data.is_resync =
true;
2149 data.root_set(id_root);
2161 for (
LinkNode *resync_root_link = id_resync_roots; resync_root_link !=
nullptr;
2162 resync_root_link = resync_root_link->
next)
2164 ID *id_resync_root =
static_cast<ID *
>(resync_root_link->link);
2169 "While dealing with root '%s', resync root ID '%s' (%p) found to be alreaady "
2172 id_resync_root->
name,
2186 reports !=
nullptr ? reports->
reports :
nullptr,
2188 "Impossible to resync data-block %s and its dependencies, as its linked reference "
2199 data.is_override =
true;
2200 data.root_set(id_resync_root);
2205 data.is_override =
false;
2207 data.hierarchy_root_set(
2237 bmain,
id,
nullptr,
nullptr);
2243 ID *reference_id = id_override_library->
reference;
2244 if (
GS(reference_id->
name) !=
GS(id->name)) {
2245 switch (
GS(id->name)) {
2251 reference_id =
reinterpret_cast<ID *
>(
2252 reinterpret_cast<Scene *
>(reference_id)->master_collection);
2261 if (reference_id ==
nullptr) {
2273 if ((id->override_library->reference->tag &
ID_TAG_DOIT) == 0) {
2278 id->override_library->reference->tag |=
ID_TAG_DOIT;
2292 data.is_override =
true;
2293 data.root_set(id_root);
2327 ID *id_reference_iter;
2330 id_reference_iter->
lib != id_root_reference->
lib)
2334 ID *id_override_new = id_reference_iter->
newid;
2335 references_and_new_overrides.
append(std::make_pair(id_reference_iter, id_override_new));
2337 ID *id_override_old =
static_cast<ID *
>(
2346 id_reference_iter->
lib);
2347 BLI_assert(id_override_old ==
nullptr || id_override_old->
lib == id_root->
lib);
2348 id_override_new->
lib = id_root->
lib;
2355 if (id_override_old ==
nullptr &&
ID_IS_LINKED(id_override_new)) {
2358 BLI_assert(id_override_old ==
nullptr || id_override_old->
lib == id_override_new->
lib);
2359 if (id_override_old !=
nullptr) {
2360 BLI_ghash_insert(linkedref_to_old_override, id_reference_iter, id_override_old);
2363 "Found missing linked old override best-match %s for new linked override %s",
2364 id_override_old->
name,
2365 id_override_new->
name);
2374 if (id_override_old !=
nullptr) {
2377 memcpy(id_name_buf, id_override_old->
name,
sizeof(id_name_buf));
2378 memcpy(id_override_old->
name, id_override_new->
name,
sizeof(id_override_old->
name));
2379 memcpy(id_override_new->
name, id_name_buf,
sizeof(id_override_new->
name));
2383 id_override_new->
tag &= ~ID_TAG_NO_MAIN;
2409 for (; op_new; op_new = op_new->
next, op_old = op_old->
next) {
2435 bmain, id_root_reference, references_and_new_overrides, linkedref_to_old_override);
2445 if ((id->tag &
ID_TAG_DOIT) == 0 || id->newid ==
nullptr || id->lib != id_root_reference->
lib)
2450 ID *id_override_new =
id->
newid;
2456 if (id_override_old ==
nullptr) {
2469 if (key_override_old_p !=
nullptr && *key_override_old_p !=
nullptr) {
2474 Key *key_override_old =
static_cast<Key *
>(
2477 *key_override_old_p = key_override_old;
2493 bool do_clear_parenting_override =
false;
2495 Object *ob_old =
reinterpret_cast<Object *
>(id_override_old);
2496 Object *ob_new =
reinterpret_cast<Object *
>(id_override_new);
2506 do_clear_parenting_override =
true;
2526 else if (do_clear_parenting_override) {
2527 if (strstr(op->rna_path,
"matrix_parent_inverse") ||
2528 strstr(op->rna_path,
"parent_type") || strstr(op->rna_path,
"parent_bone") ||
2529 strstr(op->rna_path,
"parent_vertices"))
2533 "Deleting liboverride property '%s' from object %s, as its parent pointer "
2534 "matches the reference data hierarchy wise",
2535 id_override_new->
name + 2,
2552 if (key_override_old_p !=
nullptr) {
2553 *key_override_old_p =
nullptr;
2557 id_override_old_vector.
append(id_override_old);
2566 id_override_old_vector,
2570 for (
ID *id_override_old : id_override_old_vector) {
2573 id_override_old_vector.
clear();
2578 int user_edited_overrides_deletion_count = 0;
2587 if (id->newid !=
nullptr && id->lib == id_root_reference->
lib) {
2590 if (id_override_old !=
nullptr) {
2598 id_override_old_vector.
append(id_override_old);
2602 id->tag &= ~ID_TAG_DOIT;
2609 if (id->override_library->reference->lib->id.tag &
ID_TAG_MISSING) {
2614 else if (hierarchy_root !=
nullptr &&
2635 "Old override %s is being kept around as it was user-edited",
2644 "Old override %s is being deleted even though it was user-edited",
2646 user_edited_overrides_deletion_count++;
2651 id->tag &= ~ID_TAG_MISSING;
2653 else if (id->override_library->runtime !=
nullptr) {
2656 id->override_library->runtime->tag &= ~LIBOVERRIDE_TAG_RESYNC_ISOLATED_FROM_ROOT;
2663 for (
ID *id_override_old : id_override_old_vector) {
2666 id_override_old_vector.
clear();
2676 if (id_root_reference->
newid !=
nullptr) {
2677 id_root = id_root_reference->
newid;
2680 if (user_edited_overrides_deletion_count > 0) {
2683 "During resync of data-block %s, %d obsolete overrides were deleted, that had "
2684 "local changes defined by user",
2686 user_edited_overrides_deletion_count);
2689 if (do_post_process) {
2701 override_resync_residual_storage,
2746 nullptr,
id,
nullptr,
nullptr);
2758 "Deleting %d unused linked missing IDs and their unused liboverrides (including %d "
2769 Collection *override_resync_residual_storage,
2770 const bool do_hierarchy_enforce,
2773 ListBase no_main_ids_list = {
nullptr};
2775 id_resync_roots.
link = id_root;
2776 id_resync_roots.
next =
nullptr;
2784 override_resync_residual_storage,
2785 do_hierarchy_enforce,
2803 const int library_indirect_level,
2804 const bool do_strict_equal)
2806 const int id_lib_level = (
ID_IS_LINKED(
id) ?
id->lib->runtime.temp_index : 0);
2807 return do_strict_equal ? id_lib_level == library_indirect_level :
2808 id_lib_level <= library_indirect_level;
2825 const int library_indirect_level,
2826 bool is_in_partial_resync_hierarchy)
2834 "While processing indirect level %d, ID %s from lib %s of indirect level %d detected "
2835 "as needing resync, skipping",
2836 library_indirect_level,
2840 id_root->
tag &= ~ID_TAG_LIBOVERRIDE_NEED_RESYNC;
2848 bool is_reprocessing_current_entry =
false;
2859 if (!is_in_partial_resync_hierarchy) {
2868 is_reprocessing_current_entry =
true;
2872 "ID %s (%p) is detected as part of a hierarchy dependency loop requiring resync, it "
2873 "is now being re-processed to ensure proper tagging of the whole loop",
2889 "ID %s (%p) was marked as a potential root for partial resync, but it is used by "
2890 "%s (%p), which is also tagged for resync, so it is not a root after all",
2896 entry->
tags &= ~MAINIDRELATIONS_ENTRY_TAGS_DOIT;
2902 if (!is_in_partial_resync_hierarchy) {
2909 entry->
tags &= ~MAINIDRELATIONS_ENTRY_TAGS_PROCESSED;
2912 if (is_in_partial_resync_hierarchy) {
2918 "ID %s (%p) now tagged as needing resync because they are used by %s (%p) "
2919 "that needs to be resynced",
2930 is_in_partial_resync_hierarchy =
true;
2934 if (!is_reprocessing_current_entry) {
2948 entry_item = entry_item->next)
2953 ID *id_to = *(entry_item->id_pointer.to);
2962 "Check above ensured `id_to` is a liboverride, so it should be a real one (not "
2963 "an embedded one)");
2971 bmain, id_to, id_root, library_indirect_level, is_in_partial_resync_hierarchy);
2978 if (!is_reprocessing_current_entry) {
2982 entry->
tags &= ~MAINIDRELATIONS_ENTRY_TAGS_INPROGRESS;
2985 if (is_in_partial_resync_hierarchy &&
2993 "Potential root for partial resync: %s (%p)",
3003 const int library_indirect_level)
3014 if (((id->tag | id->override_library->reference->tag) &
ID_TAG_MISSING) != 0) {
3027 if (hierarchy_root ==
nullptr ||
3049 Main *bmain,
ID *
id,
const int library_indirect_level)
3053 if (id->override_library->hierarchy_root ==
id ||
3057 id->override_library->hierarchy_root !=
id || id->override_library->runtime ==
nullptr ||
3076 to_id_entry = to_id_entry->next)
3081 ID *to_id = *(to_id_entry->id_pointer.to);
3087 bmain, to_id, library_indirect_level))
3101 const int library_indirect_level)
3132 bmain, id_iter,
nullptr, library_indirect_level,
false);
3184 bmain, id_iter, library_indirect_level))
3190 "ID %s (%p) detected as only related to its hierarchy root by 'reversed' "
3191 "relationship(s) (e.g. object parenting), tagging it as needing "
3200 "ID %s (%p) detected as 'isolated' from its hierarchy root, tagging it as needing "
3234 if (id_iter != hierarchy_root) {
3237 "Found root ID '%s' for partial resync root ID '%s'",
3238 hierarchy_root->
name,
3249 id_roots, hierarchy_root,
reinterpret_cast<void ***
>(&id_resync_roots_p)))
3251 *id_resync_roots_p = MEM_cnew<LinkNodePair>(__func__);
3274 Collection *override_resync_residual_storage,
3275 const int library_indirect_level,
3278 const bool do_reports_recursive_resync_timing = (library_indirect_level != 0);
3295 data.is_override =
false;
3296 data.is_resync =
true;
3309 data.root_set(id->override_library->reference);
3329 &
LOG_RESYNC, 4,
"ID %s (%p) was already tagged as needing resync", id->name, id->lib);
3342 entry_item = entry_item->next)
3347 ID *id_to = *entry_item->id_pointer.to;
3353 "ID %s (%p) now tagged as needing resync because they use linked %s (%p) that "
3354 "now needs to be overridden",
3383 "Checking validity of computed TODO data for root '%s'... \n",
3388 ID *id_resync_root =
static_cast<ID *
>(id_resync_root_iter->
link);
3390 if (id_resync_roots->
list != id_resync_roots->
last_node || id_resync_root != id_root) {
3392 "Hierarchy root ID is tagged for resync, yet it is not the only partial "
3393 "resync roots, this should not happen."
3395 "\n\tFirst Resync root ID: %s"
3396 "\n\tLast Resync root ID: %s",
3402 for (
LinkNode *id_resync_root_iter = id_resync_roots->
list; id_resync_root_iter !=
nullptr;
3403 id_resync_root_iter = id_resync_root_iter->next)
3405 ID *id_resync_root =
static_cast<ID *
>(id_resync_root_iter->link);
3407 if (id_resync_root == id_root) {
3408 if (id_resync_root_iter != id_resync_roots->
list ||
3409 id_resync_root_iter != id_resync_roots->
last_node)
3412 "Resync root ID is same as root ID of the override hierarchy, yet other "
3413 "resync root IDs are also defined, this should not happen at this point."
3415 "\n\tFirst Resync root ID: %s"
3416 "\n\tLast Resync root ID: %s",
3432 ListBase no_main_ids_list = {
nullptr};
3447 "Resyncing all dependencies under root %s (%p), first one being '%s'...",
3449 reinterpret_cast<void *
>(library),
3455 id_resync_roots->
list,
3457 override_resync_residual_storage,
3488 bool process_lib_level_again =
false;
3496 const bool need_reseync_original = (
id->override_library->runtime !=
nullptr &&
3497 (
id->override_library->runtime->tag &
3499 const bool is_isolated_from_root = (
id->override_library->runtime !=
nullptr &&
3500 (
id->override_library->runtime->tag &
3503 if (need_resync && is_isolated_from_root) {
3507 "Deleting unused ID override %s from library level %d, still found as needing "
3508 "resync, and being isolated from its hierarchy root. This can happen when its "
3509 "otherwise unchanged linked reference was moved around in the library file (e.g. if "
3510 "an object was moved into another sub-collection of the same hierarchy).",
3518 "Keeping user-edited ID override %s from library level %d still found as "
3519 "needing resync, and being isolated from its hierarchy root. This can happen when its "
3520 "otherwise unchanged linked reference was moved around in the library file (e.g. if "
3521 "an object was moved into another sub-collection of the same hierarchy).",
3524 id->tag &= ~ID_TAG_LIBOVERRIDE_NEED_RESYNC;
3525 id->override_library->runtime->tag &= ~LIBOVERRIDE_TAG_RESYNC_ISOLATED_FROM_ROOT;
3528 else if (need_resync) {
3529 if (need_reseync_original) {
3532 "ID override %s from library level %d still found as needing resync after "
3533 "tackling library level %d. Since it was originally tagged as such by "
3534 "RNA/liboverride apply code, this whole level of library needs to be processed "
3538 library_indirect_level);
3539 process_lib_level_again =
true;
3541 id->override_library->runtime->tag &= ~LIBOVERRIDE_TAG_NEED_RESYNC_ORIGINAL;
3549 "ID override %s from library level %d still found as needing resync after "
3550 "tackling library level %d. However, it was not tagged as such by "
3551 "RNA/liboverride apply code, so ignoring it",
3554 library_indirect_level);
3555 id->tag &= ~ID_TAG_LIBOVERRIDE_NEED_RESYNC;
3558 else if (need_reseync_original) {
3560 id->override_library->runtime->tag &= ~LIBOVERRIDE_TAG_NEED_RESYNC_ORIGINAL;
3562 else if (is_isolated_from_root) {
3565 "ID override %s from library level %d still tagged as isolated from its hierarchy root, "
3566 "it should have been either properly resynced or removed at that point.",
3569 id->override_library->runtime->tag &= ~LIBOVERRIDE_TAG_RESYNC_ISOLATED_FROM_ROOT;
3584 if (do_reports_recursive_resync_timing) {
3588 return process_lib_level_again;
3599 const int owner_library_indirect_level =
ID_IS_LINKED(id_owner) ?
3602 if (owner_library_indirect_level > 100) {
3604 "Levels of indirect usages of libraries is way too high, there are most likely "
3605 "dependency loops, skipping further building loops (involves at least '%s' from "
3606 "'%s' and '%s' from '%s')",
3613 if (owner_library_indirect_level > 90) {
3616 "Levels of indirect usages of libraries is suspiciously too high, there are most likely "
3617 "dependency loops (involves at least '%s' from '%s' and '%s' from '%s')",
3624 if (owner_library_indirect_level >= id->lib->runtime.temp_index) {
3625 id->lib->runtime.temp_index = owner_library_indirect_level + 1;
3626 *
reinterpret_cast<bool *
>(cb_data->
user_data) =
true;
3642 library->runtime.temp_index = 1;
3644 bool do_continue =
true;
3645 while (do_continue) {
3646 do_continue =
false;
3658 int library_indirect_level_max = 0;
3660 if (library->runtime.temp_index > library_indirect_level_max) {
3661 library_indirect_level_max = library->runtime.temp_index;
3664 return library_indirect_level_max;
3674#define OVERRIDE_RESYNC_RESIDUAL_STORAGE_NAME "OVERRIDE_RESYNC_LEFTOVERS"
3677 if (override_resync_residual_storage !=
nullptr &&
3680 override_resync_residual_storage =
nullptr;
3682 if (override_resync_residual_storage ==
nullptr) {
3698 while (library_indirect_level >= 0) {
3699 int level_reprocess_count = 0;
3715 override_resync_residual_storage,
3716 library_indirect_level,
3719 level_reprocess_count++;
3720 if (level_reprocess_count > 100) {
3723 "Need to reprocess resync for library level %d more than %d times, aborting. This is "
3724 "either caused by extremely complex liboverride hierarchies, or a bug",
3725 library_indirect_level,
3726 level_reprocess_count);
3731 "Applying reprocess %d for resyncing at library level %d",
3732 level_reprocess_count,
3733 library_indirect_level);
3735 library_indirect_level--;
3747 override_resync_residual_storage,
3759 "library '%s' contains some linked overrides that required recursive resync, "
3760 "consider updating it",
3782 data.scene =
nullptr;
3785 data.is_override =
true;
3786 data.is_resync =
false;
3788 data.root_set(id_root);
3825 id->flag &= ~ID_FLAG_EMBEDDED_DATA_LIB_OVERRIDE;
3832 if (shape_key !=
nullptr) {
3833 shape_key->
id.
flag &= ~ID_FLAG_EMBEDDED_DATA_LIB_OVERRIDE;
3837 Collection *master_collection =
reinterpret_cast<Scene *
>(id)->master_collection;
3838 if (master_collection !=
nullptr) {
3839 master_collection->
id.
flag &= ~ID_FLAG_EMBEDDED_DATA_LIB_OVERRIDE;
3845 node_tree->id.flag &= ~ID_FLAG_EMBEDDED_DATA_LIB_OVERRIDE;
3876 const char *rna_path)
3883 const char *rna_path,
3888 if (op ==
nullptr) {
3889 op = MEM_cnew<IDOverrideLibraryProperty>(__func__);
3900 else if (r_created) {
3915 idpoin, library_prop->
rna_path, r_override_poin, r_override_prop, r_index);
3928 opop_dst = opop_dst->next, opop_src = opop_src->next)
3947 const char *old_rna_path,
3948 const char *new_rna_path)
3955 if (liboverride_property ==
nullptr) {
3971 const bool do_runtime_updates)
3973 if (do_runtime_updates &&
3986 const char *rna_path)
3993 if (liboverride_property ==
nullptr) {
4010 const char *subitem_main_name,
4011 const char *subitem_other_name,
4012 const std::optional<const ID *> &subitem_main_id,
4013 const std::optional<const ID *> &subitem_other_id,
4014 const size_t offesetof_opop_main_name,
4015 const size_t offesetof_opop_other_name,
4016 const size_t offesetof_opop_main_id,
4017 const size_t offesetof_opop_other_id)
4019 const bool do_ids(subitem_main_id);
4022 liboverride_operations, subitem_main_name,
int(offesetof_opop_main_name)));
4025 reinterpret_cast<Link *
>(opop), subitem_main_name,
int(offesetof_opop_main_name))))
4027 const char *opop_other_name = *
reinterpret_cast<const char **
>(
reinterpret_cast<char *
>(opop) +
4028 offesetof_opop_other_name);
4031 if (do_ids && opop_use_id) {
4033 const ID *opop_main_id = *
reinterpret_cast<const ID **
>(
reinterpret_cast<char *
>(opop) +
4034 offesetof_opop_main_id);
4035 if (*subitem_main_id != opop_main_id) {
4038 const ID *opop_other_id = *
reinterpret_cast<const ID **
>(
reinterpret_cast<char *
>(opop) +
4039 offesetof_opop_other_id);
4040 if (*subitem_other_id != opop_other_id) {
4047 if ((do_ids && opop_use_id) || (!do_ids && !opop_use_id)) {
4048 if (!subitem_other_name && !opop_other_name) {
4051 if (subitem_other_name && opop_other_name &&
STREQ(subitem_other_name, opop_other_name)) {
4064 const char *subitem_refname,
4065 const char *subitem_locname,
4066 const std::optional<const ID *> &subitem_refid,
4067 const std::optional<const ID *> &subitem_locid,
4068 const int subitem_refindex,
4069 const int subitem_locindex,
4073 BLI_assert(!subitem_refid == !subitem_locid);
4076 const int subitem_defindex = -1;
4082 if (subitem_locname !=
nullptr) {
4094 if (opop !=
nullptr) {
4099 if (subitem_refname !=
nullptr) {
4111 if (opop !=
nullptr) {
4119 sizeof(subitem_locindex),
4128 sizeof(subitem_refindex),
4136 if (!strict && (subitem_locindex != subitem_defindex) &&
4140 sizeof(subitem_defindex),
4154 const short operation,
4155 const char *subitem_refname,
4156 const char *subitem_locname,
4157 const std::optional<ID *> &subitem_refid,
4158 const std::optional<ID *> &subitem_locid,
4159 const int subitem_refindex,
4160 const int subitem_locindex,
4165 BLI_assert(!subitem_refid == !subitem_locid);
4168 liboverride_property,
4178 if (opop ==
nullptr) {
4179 opop = MEM_cnew<IDOverrideLibraryPropertyOperation>(__func__);
4181 if (subitem_locname) {
4184 if (subitem_refname) {
4190 if (subitem_refid) {
4202 else if (r_created) {
4247 switch (liboverride_property_operation->
operation) {
4255 if (ptr_storage ==
nullptr || ptr_storage->
data ==
nullptr || prop_storage ==
nullptr) {
4256 BLI_assert_msg(0,
"Missing data to apply differential override operation.");
4265 if ((ptr_dst ==
nullptr || ptr_dst->
data ==
nullptr || prop_dst ==
nullptr) ||
4266 (ptr_src ==
nullptr || ptr_src->
data ==
nullptr || prop_src ==
nullptr))
4284 "Library override templates have been removed: removing all override data from "
4285 "the data-block '%s'",
4294 "Data corruption: data-block '%s' is using itself as library override reference, "
4295 "removing all override data",
4304 "Data corruption: data-block '%s' is using another local data-block ('%s') as "
4305 "library override reference, removing all override data",
4321 ID *liboverride_id = id;
4330 id->flag &= ~ID_FLAG_EMBEDDED_DATA_LIB_OVERRIDE;
4363 if (
GS(local->name) ==
ID_OB) {
4369 Object *ob_reference =
reinterpret_cast<Object *
>(local->override_library->reference);
4388 local->override_library,
4393 local->tag &= ~ID_TAG_LIBOVERRIDE_REFOK;
4414 local->tag &= ~ID_TAG_LIBOVERRIDE_REFOK;
4419 if (
GS(local->name) ==
ID_OB) {
4425 Object *ob_reference =
reinterpret_cast<Object *
>(local->override_library->reference);
4441 local->override_library,
4445 local->tag &= ~ID_TAG_LIBOVERRIDE_REFOK;
4463 if (
ID_MISSING(local->override_library->reference)) {
4467 if (
GS(local->name) ==
ID_OB) {
4473 Object *ob_reference =
reinterpret_cast<Object *
>(local->override_library->reference);
4490 local->override_library,
4491 liboverride_match_flags,
4492 &local_report_flags);
4495 CLOG_INFO(&
LOG, 2,
"We did restore some properties of %s from its reference", local->name);
4500 "We did tag some properties of %s for restoration from its reference",
4504 CLOG_INFO(&
LOG, 2,
"We did generate library override rules for %s", local->name);
4507 CLOG_INFO(&
LOG, 2,
"No new library override rules for %s", local->name);
4510 if (r_report_flags !=
nullptr) {
4538 local->override_library,
4558 local->override_library->runtime->tag &= ~LIBOVERRIDE_TAG_NEEDS_RESTORE;
4560 if (r_report_flags !=
nullptr) {
4574 ID *
id =
static_cast<ID *
>(taskdata);
4588 const bool force_auto,
4589 int *r_report_flags)
4593#ifdef DEBUG_OVERRIDE_TIMEIT
4615 create_pool_data.
bmain = bmain;
4627 key->id.tag &= ~ID_TAG_LIBOVERRIDE_AUTOREFRESH;
4633 ntree->id.tag &= ~ID_TAG_LIBOVERRIDE_AUTOREFRESH;
4638 if (
Collection *scene_collection =
reinterpret_cast<Scene *
>(
id)->master_collection) {
4640 scene_collection->id.tag &= ~ID_TAG_LIBOVERRIDE_AUTOREFRESH;
4658 if ((id->override_library->reference->tag &
ID_TAG_MISSING) == 0) {
4673 id->tag &= ~ID_TAG_LIBOVERRIDE_AUTOREFRESH;
4683 bmain,
reinterpret_cast<int *
>(&create_pool_data.report_flags));
4685 (create_pool_data.report_flags & ~RNA_OVERRIDE_MATCH_RESULT_RESTORE_TAGGED));
4688 if (r_report_flags !=
nullptr) {
4689 *r_report_flags |= create_pool_data.report_flags;
4696#ifdef DEBUG_OVERRIDE_TIMEIT
4725 const bool do_reset_system_override)
4727 bool was_op_deleted =
false;
4729 if (do_reset_system_override) {
4736 bool do_op_delete =
true;
4738 if (is_collection || op->rna_prop_type ==
PROP_POINTER) {
4753 if (is_collection) {
4773 was_op_deleted =
true;
4777 if (was_op_deleted) {
4784 return was_op_deleted;
4789 const bool do_reset_system_override)
4807 const bool do_reset_system_override)
4814 if (entry_vp ==
nullptr) {
4833 to_id_entry = to_id_entry->next)
4839 if (*to_id_entry->id_pointer.to !=
nullptr) {
4840 ID *to_id = *to_id_entry->id_pointer.to;
4850 const bool do_reset_system_override)
4866 id->override_library->runtime->tag &= ~LIBOVERRIDE_TAG_NEEDS_RELOAD;
4875 if (liboverride_property !=
nullptr) {
4877 liboverride_property->
tag |= tag;
4880 liboverride_property->
tag &= ~tag;
4900 if (liboverride !=
nullptr) {
4981 if (
ID_MISSING(local->override_library->reference)) {
4986 if (local->override_library->reference->override_library &&
5008 local->override_library->reference,
5012 if (tmp_id ==
nullptr) {
5019 tmp_id->
lib = local->lib;
5031 if (local_key !=
nullptr && tmp_key !=
nullptr) {
5040 PointerRNA rnaptr_storage_stack, *rnaptr_storage =
nullptr;
5041 if (local->override_library->storage) {
5043 rnaptr_storage = &rnaptr_storage_stack;
5050 local->override_library,
5059 if (local_key !=
nullptr && tmp_key !=
nullptr) {
5067 local_key->
from = local;
5068 tmp_key->
from = tmp_id;
5077 if (
GS(local->name) ==
ID_AR) {
5081 if (ob->pose !=
nullptr && ob->data == local) {
5099 if (local->override_library->storage) {
5104 local->override_library->storage =
nullptr;
5129 if (id->override_library !=
nullptr) {
5164 const char *line_prefix =
"";
5165 if (intro_txt !=
nullptr) {
5166 std::cout << intro_txt <<
"\n";
5171 std::cout << line_prefix << op->rna_path <<
" [";
5173 std::cout <<
" UNUSED ";
5178 std::cout << line_prefix << line_prefix << opop->operation <<
" [";
5180 std::cout <<
" UNUSED ";
5183 std::cout <<
" MATCH_REF ";
5186 if (opop->subitem_reference_name || opop->subitem_local_name) {
5187 std::cout <<
"(" << opop->subitem_reference_name <<
" <" << opop->subitem_reference_id
5188 <<
"> -> " << opop->subitem_local_name <<
" <" << opop->subitem_local_id <<
">)";
5190 else if (opop->subitem_reference_index >= 0 || opop->subitem_local_index >= 0) {
5191 std::cout <<
"(" << opop->subitem_reference_index <<
" -> " << opop->subitem_local_index
5238#ifdef DEBUG_OVERRIDE_TIMEIT
5257 storage_id =
BKE_id_copy(
reinterpret_cast<Main *
>(liboverride_storage), local);
5259 if (storage_id !=
nullptr) {
5265 bmain, &rnaptr_final, &rnaptr_reference, &rnaptr_storage, local->override_library))
5268 storage_id =
nullptr;
5272 storage_id =
nullptr;
5277#ifdef DEBUG_OVERRIDE_TIMEIT
5290 local->override_library->storage =
nullptr;
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)
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)
void BKE_id_delete(Main *bmain, void *idv) ATTR_NONNULL()
void size_t BKE_id_multi_tagged_delete(Main *bmain) ATTR_NONNULL()
@ LIB_ID_COPY_NO_LIB_OVERRIDE
@ LIB_ID_COPY_NO_LIB_OVERRIDE_LOCAL_DATA_FLAG
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)
struct ID * BKE_id_copy_in_lib(Main *bmain, std::optional< Library * > owner_library, const ID *id, const ID *new_owner_id, ID **new_id_p, int flag)
ID * BKE_id_copy_ex(Main *bmain, const ID *id, ID **new_id_p, int flag)
ID * BKE_id_copy(Main *bmain, const ID *id)
@ LIB_ID_FREE_NO_NAMEMAP_REMOVE
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_query_unused_ids_tag(Main *bmain, int tag, LibQueryUnusedIDsData ¶meters)
@ 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, int flag)
@ ID_REMAP_SKIP_OVERRIDE_LIBRARY
@ ID_REMAP_FORCE_USER_REFCOUNT
@ ID_REMAP_SKIP_INDIRECT_USAGE
@ ID_REMAP_FORCE_NEVER_NULL_USAGE
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
#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)
Main * BKE_main_new(void)
#define FOREACH_MAIN_LISTBASE_BEGIN(_bmain, _lb)
void BKE_main_free(Main *bmain)
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_destroy(UniqueName_Map **r_name_map) ATTR_NONNULL()
bool BKE_main_namemap_get_name(Main *bmain, ID *id, char *name, const bool do_unique_in_bmain) ATTR_NONNULL()
void BKE_main_namemap_remove_name(Main *bmain, ID *id, const char *name) ATTR_NONNULL()
bool BKE_main_namemap_validate(Main *bmain) ATTR_NONNULL()
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)
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
void * BLI_findstring(const struct ListBase *listbase, const char *id, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define LISTBASE_FOREACH(type, var, list)
void BLI_freelinkN(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_insertlinkreplace(ListBase *listbase, void *vreplacelink, void *vnewlink) ATTR_NONNULL(1
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
void void void void void void BLI_duplicatelist(struct ListBase *dst, const struct ListBase *src) ATTR_NONNULL(1
BLI_INLINE void BLI_listbase_clear(struct ListBase *lb)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void * BLI_listbase_findafter_string_ptr(struct Link *link, const char *id, const int offset)
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 struct ListBase *listbase, const char *id, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void * BLI_memarena_calloc(struct MemArena *ma, size_t size) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC ATTR_ALLOC_SIZE(2)
void BLI_memarena_free(struct MemArena *ma) ATTR_NONNULL(1)
struct MemArena * BLI_memarena_new(size_t bufsize, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL ATTR_NONNULL(2) ATTR_MALLOC
#define BLI_MEMARENA_STD_BUFSIZE
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC
#define STRNCPY(dst, 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_id_tag_update_ex(Main *bmain, ID *id, unsigned int flags)
void DEG_relations_tag_update(Main *bmain)
ID and Library types, which are fundamental for SDNA.
#define ID_IS_OVERRIDE_LIBRARY_VIRTUAL(_id)
#define ID_IS_OVERRIDE_LIBRARY_REAL(_id)
@ LIBOVERRIDE_PROP_TAG_NEEDS_RETORE
@ LIBOVERRIDE_PROP_OP_TAG_UNUSED
@ LIBOVERRIDE_TAG_NEEDS_RESTORE
@ LIBOVERRIDE_TAG_RESYNC_ISOLATED_FROM_ROOT
@ LIBOVERRIDE_TAG_NEEDS_RELOAD
@ LIBOVERRIDE_TAG_NEED_RESYNC_ORIGINAL
@ LIBOVERRIDE_OP_FLAG_IDPOINTER_ITEM_USE_ID
@ LIBOVERRIDE_OP_FLAG_IDPOINTER_MATCH_REFERENCE
#define ID_IS_LINKED(_id)
@ 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
@ ID_TAG_NO_USER_REFCOUNT
@ ID_TAG_LIBOVERRIDE_AUTOREFRESH
@ ID_TAG_LIBOVERRIDE_NEED_RESYNC
@ ID_TAG_LIBOVERRIDE_REFOK
@ LIBOVERRIDE_FLAG_NO_HIERARCHY
@ LIBOVERRIDE_FLAG_SYSTEM_DEFINED
#define ID_REAL_USERS(id)
#define ID_IS_OVERRIDE_LIBRARY(_id)
@ LIBRARY_TAG_RESYNC_REQUIRED
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)
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)
bool contains(const Key &key) const
bool remove(const Key &key)
void append(const T &value)
void add(ID *old_id, ID *new_id)
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_library_main_resync_on_library_indirect_level(Main *bmain, Scene *scene, ViewLayer *view_layer, Collection *override_resync_residual_storage, const int library_indirect_level, BlendFileReadReport *reports)
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 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 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)
OverrideLibraryStorage * BKE_lib_override_library_operations_store_init()
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 LibOverrideMissingIDsData lib_override_library_resync_build_missing_ids_data(Main *bmain)
#define OVERRIDE_RESYNC_RESIDUAL_STORAGE_NAME
void BKE_lib_override_id_tag_on_deg_tag_from_user(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)
void BKE_lib_override_library_main_resync(Main *bmain, Scene *scene, ViewLayer *view_layer, BlendFileReadReport *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)
ID * BKE_lib_override_library_operations_store_start(Main *bmain, OverrideLibraryStorage *liboverride_storage, ID *local)
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)
void BKE_lib_override_library_operations_store_finalize(OverrideLibraryStorage *liboverride_storage)
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)
void BKE_lib_override_library_operations_store_end(OverrideLibraryStorage *, ID *local)
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)
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 bool lib_override_library_resync(Main *bmain, 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 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)
double parameters[NUM_PARAMETERS]
void MEM_freeN(void *vmemh)
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(ID *id, StructRNA *type, void *data)
PointerRNA RNA_id_pointer_create(ID *id)
bool RNA_struct_override_store(Main *bmain, PointerRNA *ptr_local, PointerRNA *ptr_reference, PointerRNA *ptr_storage, IDOverrideLibrary *liboverride)
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)
LinkNode * resynced_lib_overrides_libraries
double lib_overrides_recursive_resync
bool do_resynced_lib_overrides_libraries_list
int resynced_lib_overrides
int resynced_lib_overrides_libraries_count
struct BlendFileReadReport::@127 duration
struct BlendFileReadReport::@128 count
struct CollectionChild * 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
struct Library_Runtime runtime
MainIDRelationsEntryItem * from_ids
MainIDRelationsEntryItem * to_ids
GHash * relations_from_pointers
UniqueName_Map * name_map_global
MainIDRelations * relations
ccl_device_inline bool is_leaf(const ccl_global KernelLightTreeNode *knode)