Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/BKE_lib_remap.h
| Show All 20 Lines | |||||
| #include "BLI_compiler_attrs.h" | #include "BLI_compiler_attrs.h" | ||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||
| extern "C" { | extern "C" { | ||||
| #endif | #endif | ||||
| struct ID; | struct ID; | ||||
| struct IDRemapper; | struct IDRemapper; | ||||
| struct LinkNode; | |||||
| /* BKE_libblock_free, delete are declared in BKE_lib_id.h for convenience. */ | /* BKE_libblock_free, delete are declared in BKE_lib_id.h for convenience. */ | ||||
| /* Also IDRemap->flag. */ | /* Also IDRemap->flag. */ | ||||
| enum { | enum { | ||||
| /** Do not remap indirect usages of IDs (that is, when user is some linked data). */ | /** Do not remap indirect usages of IDs (that is, when user is some linked data). */ | ||||
| ID_REMAP_SKIP_INDIRECT_USAGE = 1 << 0, | ID_REMAP_SKIP_INDIRECT_USAGE = 1 << 0, | ||||
| /** | /** | ||||
| ▲ Show 20 Lines • Show All 91 Lines • ▼ Show 20 Lines | |||||
| * \param old_idv: Unlike BKE_libblock_remap, can be NULL, | * \param old_idv: Unlike BKE_libblock_remap, can be NULL, | ||||
| * in which case all ID usages by given \a idv will be cleared. | * in which case all ID usages by given \a idv will be cleared. | ||||
| */ | */ | ||||
| void BKE_libblock_relink_ex(struct Main *bmain, | void BKE_libblock_relink_ex(struct Main *bmain, | ||||
| void *idv, | void *idv, | ||||
| void *old_idv, | void *old_idv, | ||||
| void *new_idv, | void *new_idv, | ||||
| short remap_flags) ATTR_NONNULL(1, 2); | short remap_flags) ATTR_NONNULL(1, 2); | ||||
| /** | |||||
| * Same as #BKE_libblock_relink_ex, but applies all rules defined in \a id_remapper to \a ids (or | |||||
| * does cleanup if `ID_REMAP_TYPE_CLEANUP` is specified as \a remap_type). | |||||
| */ | |||||
| void BKE_libblock_relink_multiple(struct Main *bmain, | |||||
| struct LinkNode *ids, | |||||
| const eIDRemapType remap_type, | |||||
| struct IDRemapper *id_remapper, | |||||
| const short remap_flags); | |||||
| /** | /** | ||||
| * Remaps ID usages of given ID to their `id->newid` pointer if not None, and proceeds recursively | * Remaps ID usages of given ID to their `id->newid` pointer if not None, and proceeds recursively | ||||
| * in the dependency tree of IDs for all data-blocks tagged with `LIB_TAG_NEW`. | * in the dependency tree of IDs for all data-blocks tagged with `LIB_TAG_NEW`. | ||||
| * | * | ||||
| * \note `LIB_TAG_NEW` is cleared. | * \note `LIB_TAG_NEW` is cleared. | ||||
| * | * | ||||
| * Very specific usage, not sure we'll keep it on the long run, | * Very specific usage, not sure we'll keep it on the long run, | ||||
| ▲ Show 20 Lines • Show All 107 Lines • Show Last 20 Lines | |||||