Blender  V2.93
Typedefs | Functions
BKE_lib_override.h File Reference

Go to the source code of this file.

Typedefs

typedef struct Main OverrideLibraryStorage
 

Functions

struct IDOverrideLibraryBKE_lib_override_library_init (struct ID *local_id, struct ID *reference_id)
 
void BKE_lib_override_library_copy (struct ID *dst_id, const struct ID *src_id, const bool do_full_copy)
 
void BKE_lib_override_library_clear (struct IDOverrideLibrary *override, const bool do_id_user)
 
void BKE_lib_override_library_free (struct IDOverrideLibrary **override, const bool do_id_user)
 
bool BKE_lib_override_library_is_user_edited (struct ID *id)
 
struct IDBKE_lib_override_library_create_from_id (struct Main *bmain, struct ID *reference_id, const bool do_tagged_remap)
 
bool BKE_lib_override_library_create_from_tag (struct Main *bmain)
 
bool BKE_lib_override_library_create (struct Main *bmain, struct Scene *scene, struct ViewLayer *view_layer, struct ID *id_root, struct ID *id_reference)
 
bool BKE_lib_override_library_template_create (struct ID *id)
 
bool BKE_lib_override_library_proxy_convert (struct Main *bmain, struct Scene *scene, struct ViewLayer *view_layer, struct Object *ob_proxy)
 
bool BKE_lib_override_library_resync (struct Main *bmain, struct Scene *scene, struct ViewLayer *view_layer, struct ID *id_root, struct Collection *override_resync_residual_storage, const bool do_hierarchy_enforce, const bool do_post_process)
 
void BKE_lib_override_library_main_resync (struct Main *bmain, struct Scene *scene, struct ViewLayer *view_layer)
 
void BKE_lib_override_library_delete (struct Main *bmain, struct ID *id_root)
 
void BKE_lib_override_library_make_local (struct ID *id)
 
struct IDOverrideLibraryPropertyBKE_lib_override_library_property_find (struct IDOverrideLibrary *override, const char *rna_path)
 
struct IDOverrideLibraryPropertyBKE_lib_override_library_property_get (struct IDOverrideLibrary *override, const char *rna_path, bool *r_created)
 
void BKE_lib_override_library_property_delete (struct IDOverrideLibrary *override, struct IDOverrideLibraryProperty *override_property)
 
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)
 
struct IDOverrideLibraryPropertyOperationBKE_lib_override_library_property_operation_find (struct 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)
 
struct IDOverrideLibraryPropertyOperationBKE_lib_override_library_property_operation_get (struct 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)
 
void BKE_lib_override_library_property_operation_delete (struct IDOverrideLibraryProperty *override_property, struct IDOverrideLibraryPropertyOperation *override_property_operation)
 
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)
 
void BKE_lib_override_library_validate (struct Main *bmain, struct ID *id, struct ReportList *reports)
 
void BKE_lib_override_library_main_validate (struct Main *bmain, struct ReportList *reports)
 
bool BKE_lib_override_library_status_check_local (struct Main *bmain, struct ID *local)
 
bool BKE_lib_override_library_status_check_reference (struct Main *bmain, struct ID *local)
 
bool BKE_lib_override_library_operations_create (struct Main *bmain, struct ID *local)
 
bool BKE_lib_override_library_main_operations_create (struct Main *bmain, const bool force_auto)
 
void BKE_lib_override_library_id_reset (struct Main *bmain, struct ID *id_root)
 
void BKE_lib_override_library_id_hierarchy_reset (struct Main *bmain, struct ID *id_root)
 
void BKE_lib_override_library_operations_tag (struct IDOverrideLibraryProperty *override_property, const short tag, const bool do_set)
 
void BKE_lib_override_library_properties_tag (struct IDOverrideLibrary *override, const short tag, const bool do_set)
 
void BKE_lib_override_library_main_tag (struct Main *bmain, const short tag, const bool do_set)
 
void BKE_lib_override_library_id_unused_cleanup (struct ID *local)
 
void BKE_lib_override_library_main_unused_cleanup (struct Main *bmain)
 
void BKE_lib_override_library_update (struct Main *bmain, struct ID *local)
 
void BKE_lib_override_library_main_update (struct Main *bmain)
 
OverrideLibraryStorageBKE_lib_override_library_operations_store_init (void)
 
struct IDBKE_lib_override_library_operations_store_start (struct Main *bmain, OverrideLibraryStorage *override_storage, struct ID *local)
 
void BKE_lib_override_library_operations_store_end (OverrideLibraryStorage *override_storage, struct ID *local)
 
void BKE_lib_override_library_operations_store_finalize (OverrideLibraryStorage *override_storage)
 

Detailed Description

API to manage data-blocks inside of Blender's Main data-base, or as independent runtime-only data.

Note
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.).

Names

Warning
Descriptions below is ideal goal, current status of naming does not yet fully follow it (this is WIP).

Definition in file BKE_lib_override.h.

Typedef Documentation

◆ OverrideLibraryStorage

typedef struct Main OverrideLibraryStorage

Definition at line 165 of file BKE_lib_override.h.

Function Documentation

◆ BKE_lib_override_library_clear()

void BKE_lib_override_library_clear ( IDOverrideLibrary override,
const bool  do_id_user 
)

◆ BKE_lib_override_library_copy()

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().

◆ BKE_lib_override_library_create()

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.

Note
Currently it only does special things if given id_root is an object of collection, more specific behaviors may be added in the future for other ID types.
It will override all IDs tagged with LIB_TAG_DOIT, and it does not clear that tag at its beginning, so caller code can add extra data-blocks to be overridden as well.
Parameters
id_rootThe root ID to create an override from.
id_referenceSome 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.
Returns
true if override was successfully created.

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().

◆ BKE_lib_override_library_create_from_id()

struct ID* BKE_lib_override_library_create_from_id ( Main bmain,
ID reference_id,
const bool  do_tagged_remap 
)

◆ BKE_lib_override_library_create_from_tag()

bool BKE_lib_override_library_create_from_tag ( Main bmain)

Create overridden local copies of all tagged data-blocks in given Main.

Note
Set id->newid of overridden libs with newly created overrides, caller is responsible to clean those pointers before/after usage as needed.
By default, it will only remap newly created local overriding data-blocks between themselves, to avoid 'enforcing' those overrides into all other usages of the linked data in main. You can add more local IDs to be remapped to use new overriding ones by setting their LIB_TAG_DOIT tag.
Returns
true on success, false otherwise.

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().

◆ BKE_lib_override_library_delete()

void BKE_lib_override_library_delete ( Main bmain,
ID id_root 
)

Advanced 'smart' function to delete library overrides (including their existing override hierarchy) and remap their usages to their linked reference IDs.

Note
All IDs tagged with LIB_TAG_DOIT will be deleted.
Parameters
id_rootThe 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().

◆ BKE_lib_override_library_free()

void BKE_lib_override_library_free ( struct IDOverrideLibrary **  override,
const bool  do_id_user 
)

◆ BKE_lib_override_library_id_hierarchy_reset()

void BKE_lib_override_library_id_hierarchy_reset ( Main bmain,
ID id_root 
)

◆ BKE_lib_override_library_id_reset()

void BKE_lib_override_library_id_reset ( Main bmain,
ID id_root 
)

◆ BKE_lib_override_library_id_unused_cleanup()

void BKE_lib_override_library_id_unused_cleanup ( struct ID local)

◆ BKE_lib_override_library_init()

struct IDOverrideLibrary* BKE_lib_override_library_init ( ID local_id,
ID reference_id 
)

◆ BKE_lib_override_library_is_user_edited()

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().

◆ BKE_lib_override_library_main_operations_create()

bool BKE_lib_override_library_main_operations_create ( Main bmain,
const bool  force_auto 
)

◆ BKE_lib_override_library_main_resync()

void BKE_lib_override_library_main_resync ( Main bmain,
Scene scene,
ViewLayer view_layer 
)

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().

◆ BKE_lib_override_library_main_tag()

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().

◆ BKE_lib_override_library_main_unused_cleanup()

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().

◆ BKE_lib_override_library_main_update()

void BKE_lib_override_library_main_update ( Main bmain)

◆ BKE_lib_override_library_main_validate()

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().

◆ BKE_lib_override_library_make_local()

void BKE_lib_override_library_make_local ( ID id)

Make given ID fully local.

Note
Only differs from lower-level `BKE_lib_override_library_free in infamous embedded ID cases.

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().

◆ BKE_lib_override_library_operations_create()

bool BKE_lib_override_library_operations_create ( Main bmain,
ID local 
)

Compare local and reference data-blocks and create new override operations as needed, or reset to reference values if overriding is not allowed.

Note
Defining override operations is only mandatory before saving a .blend file on disk (not for undo!). Knowing that info at runtime is only useful for UI/UX feedback.
This is by far the biggest operation (the more time-consuming) of the three so far, since it has to go over all properties in depth (all overridable ones at least). Generating differential values and applying overrides are much cheaper.
Returns
true if any library operation was created.

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().

◆ BKE_lib_override_library_operations_store_end()

void BKE_lib_override_library_operations_store_end ( OverrideLibraryStorage override_storage,
struct ID local 
)

Referenced by write_file_handle().

◆ BKE_lib_override_library_operations_store_finalize()

void BKE_lib_override_library_operations_store_finalize ( OverrideLibraryStorage override_storage)

◆ BKE_lib_override_library_operations_store_init()

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().

◆ BKE_lib_override_library_operations_store_start()

struct ID* BKE_lib_override_library_operations_store_start ( Main bmain,
OverrideLibraryStorage override_storage,
ID local 
)

◆ BKE_lib_override_library_operations_tag()

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().

◆ BKE_lib_override_library_properties_tag()

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().

◆ BKE_lib_override_library_property_delete()

void BKE_lib_override_library_property_delete ( IDOverrideLibrary override,
IDOverrideLibraryProperty override_property 
)

◆ BKE_lib_override_library_property_find()

struct IDOverrideLibraryProperty* BKE_lib_override_library_property_find ( IDOverrideLibrary override,
const char *  rna_path 
)

◆ BKE_lib_override_library_property_get()

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().

◆ BKE_lib_override_library_property_operation_delete()

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().

◆ BKE_lib_override_library_property_operation_find()

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 
)

◆ BKE_lib_override_library_property_operation_get()

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 
)

◆ BKE_lib_override_library_property_operation_operands_validate()

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 
)

◆ BKE_lib_override_library_proxy_convert()

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.

Note
This is a thin wrapper around BKE_lib_override_library_create, only extra work is to actually convert the proxy itself into an override first.
Returns
true if override was successfully created.

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().

◆ BKE_lib_override_library_resync()

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.

Parameters
id_rootThe root liboverride ID to resync from.
Returns
true if override was successfully resynced.

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().

◆ BKE_lib_override_library_status_check_local()

bool BKE_lib_override_library_status_check_local ( Main bmain,
ID local 
)

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.

Returns
true if status is OK, false otherwise.

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.

◆ BKE_lib_override_library_status_check_reference()

bool BKE_lib_override_library_status_check_reference ( Main bmain,
ID local 
)

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.

Returns
true if status is OK, false otherwise.

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().

◆ BKE_lib_override_library_template_create()

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.

◆ BKE_lib_override_library_update()

void BKE_lib_override_library_update ( Main bmain,
ID local 
)

◆ BKE_lib_override_library_validate()

void BKE_lib_override_library_validate ( struct Main bmain,
struct ID id,
struct ReportList reports 
)

◆ BKE_lib_override_rna_property_find()

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 
)