|
Blender
V2.93
|
Go to the source code of this file.
Typedefs | |
| typedef struct Main | OverrideLibraryStorage |
API to manage data-blocks inside of Blender's Main data-base, or as independent runtime-only data.
BKE_lib_ files are for operations over data-blocks themselves, although they might alter Main as well (when creating/renaming/deleting an ID e.g.).BKE_lib_override_library_ should be used for function affecting a single ID.BKE_lib_override_library_main_ should be used for function affecting the whole collection of IDs in a given Main data-base. Definition in file BKE_lib_override.h.
| typedef struct Main OverrideLibraryStorage |
Definition at line 165 of file BKE_lib_override.h.
| void BKE_lib_override_library_clear | ( | IDOverrideLibrary * | override, |
| const bool | do_id_user | ||
| ) |
Clear any overriding data from given override.
Definition at line 162 of file lib_override.c.
References BLI_assert, BLI_freelistN(), BLI_ghash_clear(), ELEM, id_us_min(), lib_override_library_property_clear(), LISTBASE_FOREACH, NULL, and override.
Referenced by BKE_lib_override_library_copy(), and BKE_lib_override_library_free().
| void BKE_lib_override_library_copy | ( | struct ID * | dst_id, |
| const struct ID * | src_id, | ||
| const bool | do_full_copy | ||
| ) |
Referenced by BKE_libblock_copy_ex().
| bool BKE_lib_override_library_create | ( | Main * | bmain, |
| Scene * | scene, | ||
| ViewLayer * | view_layer, | ||
| ID * | id_root, | ||
| ID * | id_reference | ||
| ) |
Advanced 'smart' function to create fully functional overrides.
| id_root | The root ID to create an override from. |
| id_reference | Some reference ID used to do some post-processing after overrides have been created, may be NULL. Typically, the Empty object instantiating the linked collection we override, currently. |
Definition at line 788 of file lib_override.c.
References BKE_lib_override_library_main_operations_create(), BKE_main_id_clear_newpoins(), BKE_main_id_tag_all(), lib_override_library_create_do(), lib_override_library_create_post_process(), LIB_TAG_DOIT, NULL, and scene.
Referenced by BKE_lib_override_library_proxy_convert(), id_override_library_create_fn(), and make_override_library_exec().
| struct ID* BKE_lib_override_library_create_from_id | ( | Main * | bmain, |
| ID * | reference_id, | ||
| const bool | do_tagged_remap | ||
| ) |
Create an overridden local copy of linked reference.
Definition at line 254 of file lib_override.c.
References BKE_key_from_id(), BKE_libblock_relink_ex(), BLI_assert, FOREACH_MAIN_ID_BEGIN, FOREACH_MAIN_ID_END, Key::id, ID_REMAP_SKIP_INDIRECT_USAGE, ID_REMAP_SKIP_OVERRIDE_LIBRARY, ID::lib, lib_override_library_create_from(), LIB_TAG_DOIT, NULL, and ID::tag.
Referenced by id_override_library_create_fn(), and template_id_cb().
| bool BKE_lib_override_library_create_from_tag | ( | Main * | bmain | ) |
Create overridden local copies of all tagged data-blocks in given Main.
id->newid of overridden libs with newly created overrides, caller is responsible to clean those pointers before/after usage as needed.Definition at line 308 of file lib_override.c.
References BKE_id_delete(), BKE_idtype_idcode_is_linkable(), BKE_key_from_id(), BKE_libblock_relink_ex(), BLI_addtail(), BLI_assert, BLI_freelistN(), LinkData::data, ListBase::first, FOREACH_MAIN_ID_BEGIN, FOREACH_MAIN_ID_END, GS, Key::id, ID_REMAP_SKIP_INDIRECT_USAGE, ID_REMAP_SKIP_OVERRIDE_LIBRARY, ID::lib, lib_override_library_create_from(), LIB_TAG_DOIT, MEM_callocN, ID::name, ID::newid, LinkData::next, NULL, and ID::tag.
Referenced by BKE_lib_override_library_resync(), and lib_override_library_create_do().
Advanced 'smart' function to delete library overrides (including their existing override hierarchy) and remap their usages to their linked reference IDs.
LIB_TAG_DOIT will be deleted.| id_root | The root liboverride ID to delete. |
Definition at line 1285 of file lib_override.c.
References BKE_id_multi_tagged_delete(), BKE_libblock_remap(), BKE_main_id_tag_all(), BKE_main_relations_create(), BKE_main_relations_free(), BLI_assert, data, FOREACH_MAIN_ID_BEGIN, FOREACH_MAIN_ID_END, id, ID_IS_OVERRIDE_LIBRARY_REAL, ID_REMAP_SKIP_INDIRECT_USAGE, lib_override_local_group_tag(), LIB_TAG_DOIT, LIB_TAG_MISSING, ID::override_library, IDOverrideLibrary::reference, and ID::tag.
Referenced by id_override_library_delete_fn().
| void BKE_lib_override_library_free | ( | struct IDOverrideLibrary ** | override, |
| const bool | do_id_user | ||
| ) |
Free given override.
Definition at line 182 of file lib_override.c.
References BKE_lib_override_library_clear(), BLI_assert, BLI_ghash_free(), MEM_freeN, MEM_SAFE_FREE, and NULL.
Referenced by BKE_lib_override_library_copy(), BKE_lib_override_library_make_local(), and BKE_libblock_free_data().
Reset all overrides in given id_root and its dependencies, while preserving ID relations.
Definition at line 2135 of file lib_override.c.
References BKE_lib_override_library_update(), BKE_main_relations_create(), BKE_main_relations_free(), LibOverrideOpCreateData::bmain, FOREACH_MAIN_ID_BEGIN, FOREACH_MAIN_ID_END, id, ID_IS_OVERRIDE_LIBRARY_REAL, IDOVERRIDE_LIBRARY_RUNTIME_TAG_NEEDS_RELOAD, lib_override_library_id_hierarchy_recursive_reset(), NULL, ID::override_library, IDOverrideLibrary::runtime, and IDOverrideLibraryRuntime::tag.
Referenced by id_override_library_reset_fn().
Reset all overrides in given id_root, while preserving ID relations.
Definition at line 2076 of file lib_override.c.
References BKE_lib_override_library_update(), LibOverrideOpCreateData::bmain, ID_IS_OVERRIDE_LIBRARY_REAL, IDOVERRIDE_LIBRARY_RUNTIME_TAG_NEEDS_RELOAD, lib_override_library_id_reset_do(), NULL, ID::override_library, IDOverrideLibrary::runtime, and IDOverrideLibraryRuntime::tag.
Referenced by id_override_library_reset_fn().
| void BKE_lib_override_library_id_unused_cleanup | ( | struct ID * | local | ) |
Remove all tagged-as-unused properties and operations from that ID override data.
Definition at line 2205 of file lib_override.c.
References BKE_lib_override_library_property_delete(), BKE_lib_override_library_property_operation_delete(), ID_IS_OVERRIDE_LIBRARY_REAL, IDOVERRIDE_LIBRARY_TAG_UNUSED, LISTBASE_FOREACH_MUTABLE, ID::override_library, and IDOverrideLibrary::properties.
Referenced by BKE_lib_override_library_main_unused_cleanup().
| struct IDOverrideLibrary* BKE_lib_override_library_init | ( | ID * | local_id, |
| ID * | reference_id | ||
| ) |
Initialize empty overriding of reference_id by local_id.
Definition at line 85 of file lib_override.c.
References BKE_lib_override_library_copy(), BLI_assert, id_us_min(), id_us_plus(), ID::lib, LIB_TAG_OVERRIDE_LIBRARY_REFOK, MEM_callocN, NULL, ID::override_library, IDOverrideLibrary::reference, and ID::tag.
Referenced by BKE_lib_override_library_copy(), BKE_lib_override_library_proxy_convert(), BKE_lib_override_library_template_create(), and lib_override_library_create_from().
| bool BKE_lib_override_library_is_user_edited | ( | struct ID * | id | ) |
Check if given ID has some override rules that actually indicate the user edited it.
TODO: This could be simplified by storing a flag in IDOverrideLibrary during the diffing process?
Definition at line 231 of file lib_override.c.
References id, ID_IS_OVERRIDE_LIBRARY, IDOVERRIDE_LIBRARY_FLAG_IDPOINTER_MATCH_REFERENCE, IDOVERRIDE_LIBRARY_OP_NOOP, LISTBASE_FOREACH, ID::override_library, and IDOverrideLibrary::properties.
Referenced by BKE_lib_override_library_resync().
| bool BKE_lib_override_library_main_operations_create | ( | Main * | bmain, |
| const bool | force_auto | ||
| ) |
Check all overrides from given bmain and create/update overriding operations as needed.
Definition at line 1947 of file lib_override.c.
References BKE_lib_override_library_main_operations_create(), BKE_lib_override_library_main_tag(), BKE_lib_override_library_main_unused_cleanup(), BKE_lib_override_library_properties_tag(), BKE_pose_ensure(), BLI_assert, BLI_task_pool_create(), BLI_task_pool_free(), BLI_task_pool_push(), BLI_task_pool_work_and_wait(), LibOverrideOpCreateData::bmain, LibOverrideOpCreateData::changed, Object::data, FOREACH_MAIN_ID_BEGIN, FOREACH_MAIN_ID_END, GS, id, ID_IS_OVERRIDE_LIBRARY_REAL, ID_OB, IDOVERRIDE_LIBRARY_TAG_UNUSED, lib_override_library_operations_create_cb(), LIB_TAG_MISSING, LIB_TAG_OVERRIDE_LIBRARY_AUTOREFRESH, LISTBASE_FOREACH, ID::name, NULL, OB_ARMATURE, Main::objects, ID::override_library, IDOverrideLibrary::reference, ID::tag, task_pool, TASK_PRIORITY_HIGH, TIMEIT_END_AVERAGED, TIMEIT_START_AVERAGED, and Object::type.
Referenced by BKE_lib_override_library_create(), BKE_lib_override_library_main_operations_create(), BKE_undosys_step_push_with_type(), setup_app_data(), and wm_file_write().
Detect and handle required resync of overrides data, when relations between reference linked IDs have changed.
This is a fairly complex and costly operation, typically it should be called after BKE_lib_override_library_main_update, which would already detect and tag a lot of cases.
This function will first detect the remaining cases requiring a resync (namely, either when an existing linked ID that did not require to be overridden before now would be, or when new IDs are added to the hierarchy).
Then it will handle the resync of necessary IDs (through calls to BKE_lib_override_library_resync).
Definition at line 1140 of file lib_override.c.
References BKE_collection_add(), BKE_collection_delete(), BKE_collection_is_empty(), BKE_lib_override_library_resync(), BKE_main_id_tag_all(), BKE_main_relations_create(), BKE_main_relations_free(), BKE_main_relations_tag_set(), BLI_assert, BLI_findstring(), BLI_ghash_lookup(), CLOG_INFO, COLLECTION_RESTRICT_RENDER, COLLECTION_RESTRICT_VIEWPORT, Main::collections, data, Collection::flag, FOREACH_MAIN_ID_BEGIN, FOREACH_MAIN_ID_END, FOREACH_MAIN_LISTBASE_BEGIN, FOREACH_MAIN_LISTBASE_END, FOREACH_MAIN_LISTBASE_ID_BEGIN, FOREACH_MAIN_LISTBASE_ID_END, id, Collection::id, ID_IS_LINKED, ID_IS_OVERRIDE_LIBRARY_REAL, IDWALK_CB_OVERRIDE_LIBRARY_NOT_OVERRIDABLE, ID::lib, lib_override_hierarchy_dependencies_recursive_tag(), lib_override_library_create_post_process(), lib_override_linked_group_tag(), LIB_TAG_DOIT, LIB_TAG_LIB_OVERRIDE_NEED_RESYNC, LIB_TAG_MISSING, LOG, MAINIDRELATIONS_ENTRY_TAGS_PROCESSED, Scene::master_collection, ID::name, NULL, OVERRIDE_RESYNC_RESIDUAL_STORAGE_NAME, Main::relations, MainIDRelations::relations_from_pointers, scene, ID::tag, and MainIDRelationsEntry::to_ids.
Referenced by setup_app_data().
| void BKE_lib_override_library_main_tag | ( | struct Main * | bmain, |
| const short | tag, | ||
| const bool | do_set | ||
| ) |
Set or clear given tag in all properties and operations in that Main's ID override data.
Definition at line 2192 of file lib_override.c.
References BKE_lib_override_library_properties_tag(), LibOverrideOpCreateData::bmain, FOREACH_MAIN_ID_BEGIN, FOREACH_MAIN_ID_END, id, ID_IS_OVERRIDE_LIBRARY, and ID::override_library.
Referenced by BKE_lib_override_library_main_operations_create().
| void BKE_lib_override_library_main_unused_cleanup | ( | struct Main * | bmain | ) |
Remove all tagged-as-unused properties and operations from that Main's ID override data.
Definition at line 2225 of file lib_override.c.
References BKE_lib_override_library_id_unused_cleanup(), LibOverrideOpCreateData::bmain, FOREACH_MAIN_ID_BEGIN, FOREACH_MAIN_ID_END, id, and ID_IS_OVERRIDE_LIBRARY.
Referenced by BKE_lib_override_library_main_operations_create().
| void BKE_lib_override_library_main_update | ( | Main * | bmain | ) |
Update all overrides from given bmain.
Definition at line 2368 of file lib_override.c.
References BKE_lib_override_library_update(), LibOverrideOpCreateData::bmain, FOREACH_MAIN_ID_BEGIN, FOREACH_MAIN_ID_END, G_MAIN, id, NULL, and ID::override_library.
Referenced by blo_read_file_internal().
| void BKE_lib_override_library_main_validate | ( | Main * | bmain, |
| ReportList * | reports | ||
| ) |
Check against potential bmain.
Definition at line 1719 of file lib_override.c.
References BKE_lib_override_library_validate(), FOREACH_MAIN_ID_BEGIN, FOREACH_MAIN_ID_END, id, NULL, and ID::override_library.
Referenced by blo_read_file_internal().
| void BKE_lib_override_library_make_local | ( | ID * | id | ) |
Make given ID fully local.
Definition at line 1322 of file lib_override.c.
References BKE_key_from_id(), BKE_lib_override_library_free(), BLI_assert_unreachable, ID::flag, GS, id, Collection::id, Key::id, ID_IS_OVERRIDE_LIBRARY, ID_IS_OVERRIDE_LIBRARY_VIRTUAL, ID_SCE, LIB_EMBEDDED_DATA_LIB_OVERRIDE, ID::name, ntreeFromID(), NULL, and ID::override_library.
Referenced by BKE_library_make_local(), id_local_fn(), and template_id_cb().
Compare local and reference data-blocks and create new override operations as needed, or reset to reference values if overriding is not allowed.
.blend file on disk (not for undo!). Knowing that info at runtime is only useful for UI/UX feedback.Definition at line 1870 of file lib_override.c.
References BKE_pose_ensure(), BLI_assert, CLOG_INFO, Object::data, GS, ID_MISSING, ID_OB, LOG, ID::name, NULL, OB_ARMATURE, ID::override_library, IDOverrideLibrary::reference, RNA_id_pointer_create(), RNA_OVERRIDE_COMPARE_CREATE, RNA_OVERRIDE_COMPARE_RESTORE, RNA_OVERRIDE_MATCH_RESULT_CREATED, RNA_OVERRIDE_MATCH_RESULT_RESTORED, RNA_struct_override_matches(), and Object::type.
Referenced by BKE_lib_override_library_operations_store_start(), and lib_override_library_operations_create_cb().
| void BKE_lib_override_library_operations_store_end | ( | OverrideLibraryStorage * | override_storage, |
| struct ID * | local | ||
| ) |
Referenced by write_file_handle().
| void BKE_lib_override_library_operations_store_finalize | ( | OverrideLibraryStorage * | override_storage | ) |
Definition at line 2493 of file lib_override.c.
References BKE_id_free_ex(), BKE_main_free(), FOREACH_MAIN_ID_BEGIN, FOREACH_MAIN_ID_END, id, and LIB_ID_FREE_NO_UI_USER.
Referenced by write_file_handle().
| OverrideLibraryStorage* BKE_lib_override_library_operations_store_init | ( | void | ) |
Storage (how to store overriding data into .blend files).
Basically: 1) Only 'differential' overrides needs special handling here. All others (replacing values or inserting/removing items from a collection) can be handled with simply storing current content of local data-block. 2) We store the differential value into a second 'ghost' data-block, which is an empty ID of same type as the local one, where we only define values that need differential data.
This avoids us having to modify 'real' data-block at write time (and restoring it afterwards), which is inefficient, and potentially dangerous (in case of concurrent access...), while not using much extra memory in typical cases. It also ensures stored data-block always contains exact same data as "desired" ones (kind of "baked" data-blocks). Initialize an override storage.
Definition at line 2405 of file lib_override.c.
References BKE_main_new().
Referenced by write_file_handle().
| struct ID* BKE_lib_override_library_operations_store_start | ( | Main * | bmain, |
| OverrideLibraryStorage * | override_storage, | ||
| ID * | local | ||
| ) |
Generate suitable 'write' data (this only affects differential override operations).
Note that local ID is no more modified by this call, all extra data are stored in its temp storage_id copy.
Definition at line 2415 of file lib_override.c.
References BKE_id_copy(), BKE_id_free_ex(), BKE_lib_override_library_operations_create(), BKE_lib_override_library_operations_store_start(), BLI_assert, LibOverrideOpCreateData::bmain, ID_IS_OVERRIDE_LIBRARY_REAL, ID_IS_OVERRIDE_LIBRARY_TEMPLATE, ID_IS_OVERRIDE_LIBRARY_VIRTUAL, LIB_ID_FREE_NO_UI_USER, NULL, ID::override_library, IDOverrideLibrary::reference, RNA_id_pointer_create(), RNA_struct_override_store(), IDOverrideLibrary::storage, TIMEIT_END_AVERAGED, TIMEIT_START_AVERAGED, and UNUSED_VARS_NDEBUG.
Referenced by BKE_lib_override_library_operations_store_start(), and write_file_handle().
| void BKE_lib_override_library_operations_tag | ( | struct IDOverrideLibraryProperty * | override_property, |
| const short | tag, | ||
| const bool | do_set | ||
| ) |
Set or clear given tag in all operations in that override property data.
Definition at line 2156 of file lib_override.c.
References LISTBASE_FOREACH, NULL, IDOverrideLibraryProperty::operations, and IDOverrideLibraryProperty::tag.
Referenced by BKE_lib_override_library_properties_tag(), and RNA_struct_override_matches().
| void BKE_lib_override_library_properties_tag | ( | struct IDOverrideLibrary * | override, |
| const short | tag, | ||
| const bool | do_set | ||
| ) |
Set or clear given tag in all properties and operations in that override data.
Definition at line 2180 of file lib_override.c.
References BKE_lib_override_library_operations_tag(), LISTBASE_FOREACH, NULL, and override.
Referenced by BKE_lib_override_library_main_operations_create(), and BKE_lib_override_library_main_tag().
| void BKE_lib_override_library_property_delete | ( | IDOverrideLibrary * | override, |
| IDOverrideLibraryProperty * | override_property | ||
| ) |
Remove and free given override_property from given ID override.
Definition at line 1462 of file lib_override.c.
References BLI_freelinkN(), BLI_ghash_remove(), ELEM, lib_override_library_property_clear(), NULL, override, and IDOverrideLibraryProperty::rna_path.
Referenced by BKE_lib_override_library_id_unused_cleanup(), BKE_lib_override_library_resync(), lib_override_library_id_reset_do(), and override_remove_button_exec().
| struct IDOverrideLibraryProperty* BKE_lib_override_library_property_find | ( | IDOverrideLibrary * | override, |
| const char * | rna_path | ||
| ) |
Find override property from given RNA path, if it exists.
Definition at line 1381 of file lib_override.c.
References BLI_ghash_lookup(), and override_library_rna_path_mapping_ensure().
Referenced by BKE_lib_override_library_property_get(), RNA_property_overridden(), RNA_property_override_property_find(), and RNA_struct_override_matches().
| struct IDOverrideLibraryProperty* BKE_lib_override_library_property_get | ( | IDOverrideLibrary * | override, |
| const char * | rna_path, | ||
| bool * | r_created | ||
| ) |
Find override property from given RNA path, or create it if it does not exist.
Definition at line 1391 of file lib_override.c.
References BKE_lib_override_library_property_find(), BLI_addtail(), BLI_ghash_insert(), BLI_strdup(), MEM_callocN, NULL, override, override_library_rna_path_mapping_ensure(), and IDOverrideLibraryProperty::rna_path.
Referenced by RNA_property_override_property_get().
| void BKE_lib_override_library_property_operation_delete | ( | IDOverrideLibraryProperty * | override_property, |
| IDOverrideLibraryPropertyOperation * | override_property_operation | ||
| ) |
Remove and free given override_property_operation from given ID override_property.
Definition at line 1636 of file lib_override.c.
References BLI_freelinkN(), lib_override_library_property_operation_clear(), and IDOverrideLibraryProperty::operations.
Referenced by BKE_lib_override_library_id_unused_cleanup(), and override_remove_button_exec().
| struct IDOverrideLibraryPropertyOperation* BKE_lib_override_library_property_operation_find | ( | IDOverrideLibraryProperty * | override_property, |
| const char * | subitem_refname, | ||
| const char * | subitem_locname, | ||
| const int | subitem_refindex, | ||
| const int | subitem_locindex, | ||
| const bool | strict, | ||
| bool * | r_strict | ||
| ) |
Find override property operation from given sub-item(s), if it exists.
Definition at line 1478 of file lib_override.c.
References BLI_findstring_ptr(), BLI_listbase_bytes_find(), ELEM, NULL, IDOverrideLibraryProperty::operations, STREQ, IDOverrideLibraryPropertyOperation::subitem_local_index, IDOverrideLibraryPropertyOperation::subitem_local_name, IDOverrideLibraryPropertyOperation::subitem_reference_index, and IDOverrideLibraryPropertyOperation::subitem_reference_name.
Referenced by BKE_lib_override_library_property_operation_get(), override_remove_button_exec(), and RNA_property_override_property_operation_find().
| struct IDOverrideLibraryPropertyOperation* BKE_lib_override_library_property_operation_get | ( | IDOverrideLibraryProperty * | override_property, |
| const short | operation, | ||
| const char * | subitem_refname, | ||
| const char * | subitem_locname, | ||
| const int | subitem_refindex, | ||
| const int | subitem_locindex, | ||
| const bool | strict, | ||
| bool * | r_strict, | ||
| bool * | r_created | ||
| ) |
Find override property operation from given sub-item(s), or create it if it does not exist.
Definition at line 1567 of file lib_override.c.
References BKE_lib_override_library_property_operation_find(), BLI_addtail(), BLI_strdup(), MEM_callocN, NULL, IDOverrideLibraryPropertyOperation::operation, IDOverrideLibraryProperty::operations, IDOverrideLibraryPropertyOperation::subitem_local_index, IDOverrideLibraryPropertyOperation::subitem_local_name, IDOverrideLibraryPropertyOperation::subitem_reference_index, and IDOverrideLibraryPropertyOperation::subitem_reference_name.
Referenced by override_remove_button_exec(), and RNA_property_override_property_operation_get().
| bool BKE_lib_override_library_property_operation_operands_validate | ( | struct IDOverrideLibraryPropertyOperation * | override_property_operation, |
| struct PointerRNA * | ptr_dst, | ||
| struct PointerRNA * | ptr_src, | ||
| struct PointerRNA * | ptr_storage, | ||
| struct PropertyRNA * | prop_dst, | ||
| struct PropertyRNA * | prop_src, | ||
| struct PropertyRNA * | prop_storage | ||
| ) |
Validate that required data for a given operation are available.
Definition at line 1647 of file lib_override.c.
References ATTR_FALLTHROUGH, BLI_assert, PointerRNA::data, IDOVERRIDE_LIBRARY_OP_ADD, IDOVERRIDE_LIBRARY_OP_INSERT_AFTER, IDOVERRIDE_LIBRARY_OP_INSERT_BEFORE, IDOVERRIDE_LIBRARY_OP_MULTIPLY, IDOVERRIDE_LIBRARY_OP_NOOP, IDOVERRIDE_LIBRARY_OP_REPLACE, IDOVERRIDE_LIBRARY_OP_SUBTRACT, NULL, and IDOverrideLibraryPropertyOperation::operation.
Referenced by rna_property_override_operation_apply().
| bool BKE_lib_override_library_proxy_convert | ( | Main * | bmain, |
| Scene * | scene, | ||
| ViewLayer * | view_layer, | ||
| Object * | ob_proxy | ||
| ) |
Convert a given proxy object into a library override.
Definition at line 834 of file lib_override.c.
References BKE_lib_override_library_create(), BKE_lib_override_library_init(), DEG_id_tag_update(), Collection::id, Object::id, ID_IS_OVERRIDABLE_LIBRARY, ID_RECALC_COPY_ON_WRITE, Object::instance_collection, LIB_TAG_DOIT, ID::newid, NULL, Object::proxy, Object::proxy_from, Object::proxy_group, scene, and ID::tag.
Referenced by convert_proxy_to_override_exec(), and object_proxy_to_override_convert_fn().
| 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, | ||
| const bool | do_post_process | ||
| ) |
Advanced 'smart' function to resync, re-create fully functional overrides up-to-date with linked data, from an existing override hierarchy.
| id_root | The root liboverride ID to resync from. |
Definition at line 876 of file lib_override.c.
References BKE_id_multi_tagged_delete(), BKE_lib_override_library_create_from_tag(), BKE_lib_override_library_is_user_edited(), BKE_lib_override_library_property_delete(), BKE_libblock_remap(), BKE_main_id_clear_newpoins(), BKE_main_id_tag_all(), BKE_main_relations_create(), BKE_main_relations_free(), BKE_main_relations_tag_set(), BLI_assert, BLI_duplicatelist(), BLI_freelinkN(), BLI_ghash_free(), BLI_ghash_haskey(), BLI_ghash_insert(), BLI_ghash_lookup(), BLI_ghash_new(), BLI_ghashutil_ptrcmp(), BLI_ghashutil_ptrhash(), BLI_listbase_is_empty(), BLI_listbase_swaplinks(), CLOG_INFO, data, ELEM, ListBase::first, FOREACH_MAIN_ID_BEGIN, FOREACH_MAIN_ID_END, FOREACH_MAIN_LISTBASE_BEGIN, FOREACH_MAIN_LISTBASE_END, FOREACH_MAIN_LISTBASE_ID_BEGIN, FOREACH_MAIN_LISTBASE_ID_END, GS, id, id_fake_user_set(), ID_IS_LINKED, ID_IS_OVERRIDE_LIBRARY, ID_IS_OVERRIDE_LIBRARY_REAL, ID_REMAP_SKIP_INDIRECT_USAGE, IDOVERRIDE_LIBRARY_FLAG_IDPOINTER_MATCH_REFERENCE, LIB_LIB_OVERRIDE_RESYNC_LEFTOVER, lib_override_hierarchy_dependencies_recursive_tag(), lib_override_library_create_post_process(), lib_override_library_property_copy(), lib_override_library_property_operation_clear(), lib_override_linked_group_tag(), lib_override_local_group_tag(), LIB_TAG_DOIT, LIB_TAG_LIB_OVERRIDE_NEED_RESYNC, LIB_TAG_MISSING, LISTBASE_FOREACH, LISTBASE_FOREACH_MUTABLE, LOG, MAINIDRELATIONS_ENTRY_TAGS_PROCESSED, MAX_ID_NAME, ID::name, ID::newid, NULL, OB_DATA_SUPPORT_ID, ID::override_library, PROP_COLLECTION, PROP_POINTER, IDOverrideLibrary::properties, IDOverrideLibrary::reference, RNA_id_pointer_create(), RNA_OVERRIDE_APPLY_FLAG_IGNORE_ID_POINTERS, RNA_OVERRIDE_APPLY_FLAG_NOP, RNA_struct_override_apply(), scene, and ID::tag.
Referenced by BKE_lib_override_library_main_resync(), and id_override_library_resync_fn().
Check that status of local data-block is still valid against current reference one.
It means that all overridable, but not overridden, properties' local values must be equal to reference ones. Clears #LIB_TAG_OVERRIDE_OK if they do not.
This is typically used to detect whether some property has been changed in local and a new #IDOverrideProperty (of #IDOverridePropertyOperation) has to be added.
Definition at line 1741 of file lib_override.c.
References BKE_pose_ensure(), BLI_assert, Object::data, GS, ID_IS_OVERRIDE_LIBRARY_REAL, ID_OB, LIB_TAG_OVERRIDE_LIBRARY_REFOK, ID::name, NULL, OB_ARMATURE, ID::override_library, IDOverrideLibrary::reference, RNA_id_pointer_create(), RNA_OVERRIDE_COMPARE_IGNORE_NON_OVERRIDABLE, RNA_OVERRIDE_COMPARE_IGNORE_OVERRIDDEN, RNA_struct_override_matches(), ID::tag, and Object::type.
Check that status of reference data-block is still valid against current local one.
It means that all non-overridden properties' local values must be equal to reference ones. Clears LIB_TAG_OVERRIDE_OK if they do not.
This is typically used to detect whether some reference has changed and local needs to be updated against it.
Definition at line 1800 of file lib_override.c.
References BKE_lib_override_library_status_check_reference(), BKE_pose_ensure(), BLI_assert, Object::data, GS, ID_IS_OVERRIDE_LIBRARY_REAL, ID_OB, LIB_TAG_OVERRIDE_LIBRARY_REFOK, ID::name, NULL, OB_ARMATURE, ID::override_library, IDOverrideLibrary::reference, RNA_id_pointer_create(), RNA_OVERRIDE_COMPARE_IGNORE_OVERRIDDEN, RNA_struct_override_matches(), ID::tag, and Object::type.
Referenced by BKE_lib_override_library_status_check_reference().
| bool BKE_lib_override_library_template_create | ( | struct ID * | id | ) |
Create a library override template.
Definition at line 813 of file lib_override.c.
References BKE_lib_override_library_init(), ID_IS_LINKED, ID_IS_OVERRIDE_LIBRARY, and NULL.
Update given override from its reference (re-applying overridden properties).
Definition at line 2246 of file lib_override.c.
References BKE_id_copy(), BKE_id_free_ex(), BKE_key_from_id(), BKE_key_from_id_p(), BKE_lib_override_library_update(), BKE_pose_clear_pointers(), BLI_assert, BLI_strncpy(), LibOverrideOpCreateData::bmain, DEG_id_tag_update_ex(), DEG_relations_tag_update(), ID::flag, Key::from, GS, Key::id, ID_AR, ID_IS_OVERRIDE_LIBRARY_REAL, ID_MISSING, ID_RECALC_ALL, LIB_EMBEDDED_DATA_LIB_OVERRIDE, LIB_ID_FREE_NO_UI_USER, lib_override_id_swap(), LIB_TAG_OVERRIDE_LIBRARY_REFOK, LISTBASE_FOREACH, ID::name, NULL, OB_ARMATURE, Main::objects, ID::override_library, POSE_RECALC, IDOverrideLibrary::reference, RNA_id_pointer_create(), RNA_OVERRIDE_APPLY_FLAG_NOP, RNA_struct_override_apply(), IDOverrideLibrary::storage, and ID::tag.
Referenced by BKE_lib_override_library_id_hierarchy_reset(), BKE_lib_override_library_id_reset(), BKE_lib_override_library_main_update(), BKE_lib_override_library_update(), and lib_relocate_do().
| void BKE_lib_override_library_validate | ( | struct Main * | bmain, |
| struct ID * | id, | ||
| struct ReportList * | reports | ||
| ) |
| bool BKE_lib_override_rna_property_find | ( | struct PointerRNA * | idpoin, |
| const struct IDOverrideLibraryProperty * | library_prop, | ||
| struct PointerRNA * | r_override_poin, | ||
| struct PropertyRNA ** | r_override_prop | ||
| ) |
Referenced by blender::ed::outliner::TreeElementOverridesBase::expand().