diff options
Diffstat (limited to 'source/blender/blenkernel/BKE_lib_override.h')
-rw-r--r-- | source/blender/blenkernel/BKE_lib_override.h | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/source/blender/blenkernel/BKE_lib_override.h b/source/blender/blenkernel/BKE_lib_override.h index 30e75259967..c81616110cc 100644 --- a/source/blender/blenkernel/BKE_lib_override.h +++ b/source/blender/blenkernel/BKE_lib_override.h @@ -100,8 +100,15 @@ struct ID *BKE_lib_override_library_create_from_id(struct Main *bmain, * main. You can add more local IDs to be remapped to use new overriding ones by setting their * LIB_TAG_DOIT tag. * - * \param reference_library: the library from which the linked data being overridden come from - * (i.e. the library of the linked reference ID). + * \param owner_library: the library in which the overrides should be created. Besides versioning + * and resync code path, this should always be NULL (i.e. the local .blend file). + * + * \param id_root_reference: the linked ID that is considered as the root of the overridden + * hierarchy. + * + * \param id_hierarchy_root: the override ID that is the root of the hierarchy. May be NULL, in + * which case it is assumed that the given `id_root_reference` is tagged for override, and its + * newly created override will be used as hierarchy root. * * \param do_no_main: Create the new override data outside of Main database. * Used for resyncing of linked overrides. @@ -109,7 +116,9 @@ struct ID *BKE_lib_override_library_create_from_id(struct Main *bmain, * \return \a true on success, \a false otherwise. */ bool BKE_lib_override_library_create_from_tag(struct Main *bmain, - const struct Library *reference_library, + struct Library *owner_library, + const struct ID *id_root_reference, + struct ID *id_hierarchy_root, bool do_no_main); /** * Advanced 'smart' function to create fully functional overrides. @@ -122,16 +131,24 @@ bool BKE_lib_override_library_create_from_tag(struct Main *bmain, * * \param view_layer: the active view layer to search instantiated collections in, can be NULL (in * which case \a scene's master collection children hierarchy is used instead). + * + * \param owner_library: the library in which the overrides should be created. Besides versioning + * and resync code path, this should always be NULL (i.e. the local .blend file). + * * \param id_root: The root ID to create an override from. + * * \param 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. + * * \param r_id_root_override: if not NULL, the override generated for the given \a id_root. + * * \return true if override was successfully created. */ bool BKE_lib_override_library_create(struct Main *bmain, struct Scene *scene, struct ViewLayer *view_layer, + struct Library *owner_library, struct ID *id_root, struct ID *id_reference, struct ID **r_id_root_override); @@ -160,6 +177,15 @@ bool BKE_lib_override_library_proxy_convert(struct Main *bmain, */ void BKE_lib_override_library_main_proxy_convert(struct Main *bmain, struct BlendFileReadReport *reports); + +/** + * Find and set the 'hierarchy root' ID pointer of all library overrides in given `bmain`. + * + * NOTE: Cannot be called from `do_versions_after_linking` as this code needs a single complete + * Main database, not a split-by-libraries one. + */ +void BKE_lib_override_library_main_hierarchy_root_ensure(struct Main *bmain); + /** * Advanced 'smart' function to resync, re-create fully functional overrides up-to-date with linked * data, from an existing override hierarchy. |