95 N_(
"link_placeholders"),
131 size_t path_dst_maxncpy,
132 const char *path_src)
134 const char **
data =
static_cast<const char **
>(bpath_data->
user_data);
137 const char *base_new =
data[0];
138 const char *base_old =
data[1];
141 CLOG_ERROR(&
LOG,
"old base path '%s' is not absolute.", base_old);
182 const char *bpath_user_data[2] = {
187 path_data.
bmain = bmain;
190 path_data.
user_data = (
void *)bpath_user_data;
213 if (id_in_mainlist) {
217 lib_id_library_local_paths(bmain,
nullptr,
id->lib,
id);
224 if (id_in_mainlist) {
273 bmain, id_iter, lib_id_clear_library_data_users_update_cb,
id,
IDWALK_READONLY);
281 if (key !=
nullptr) {
298 id->lib->runtime->parent =
nullptr;
318 if (
id->us <= limit) {
321 "ID user count error: %s (from '%s')",
323 id->lib ?
id->lib->runtime->filepath_abs :
"[Main]");
371 if (
id->us <= limit) {
376 "ID user decrement error: %s (from '%s'): %d <= %d",
378 id->lib ?
id->lib->runtime->filepath_abs :
"[Main]",
415 if (
id->newid ==
nullptr) {
427 if (key !=
nullptr) {
431 if (ntree !=
nullptr) {
436 if (master_collection !=
nullptr) {
447 int const cb_flag = cb_data->
cb_flag;
460 if (*id_pointer !=
nullptr &&
ID_IS_LINKED(*id_pointer)) {
472 if (*id_pointer && *id_pointer != self_id &&
498 lib_id_library_local_paths(bmain,
nullptr, old_id->
lib, new_id);
503 Main *bmain,
ID *
id,
int flags,
bool *r_force_local,
bool *r_force_copy)
507 BLI_assert(force_copy ==
false || force_copy != force_local);
509 if (force_local || force_copy) {
511 *r_force_local = force_local;
512 *r_force_copy = force_copy;
517 bool is_local =
false, is_lib =
false;
528 if (!lib_local && !is_local && !is_lib) {
531 else if (lib_local || is_local) {
540 *r_force_local = force_local;
541 *r_force_copy = force_copy;
550 bool force_local, force_copy;
560 else if (force_copy) {
561 const int copy_flags =
568 if (id_new !=
nullptr) {
574 if (key && key_new) {
579 if (ntree && ntree_new) {
584 *master_collection_new = ((
Scene *)id_new)->master_collection;
585 if (master_collection && master_collection_new) {
586 ID_NEW_SET(master_collection, master_collection_new);
610 if (idtype_info ==
nullptr) {
637 ID *
id = *id_pointer;
642 if (
id ==
data->id_src) {
644 id = *id_pointer =
data->id_dst;
668#define LIB_ID_TYPES_NOCOPY ID_LI, ID_SCR, ID_WM, ID_WS
672#undef LIB_ID_TYPES_NOCOPY
676 std::optional<Library *> owner_library,
678 std::optional<const ID *> new_owner_id,
682 ID *newid = (new_id_p !=
nullptr) ? *new_id_p :
nullptr;
684 "Copying with 'no allocate' behavior should always get a non-null new ID buffer");
704 if (idtype_info !=
nullptr) {
712 idtype_info->
copy_data(bmain, owner_library, newid,
id,
flag);
719 BLI_assert_msg(newid,
"Could not get an allocated new ID to copy into");
745 if (newid->
lib !=
id->lib) {
746 lib_id_library_local_paths(bmain, newid->
lib,
id->lib, newid);
767 newid->
lib = owner_library ? *owner_library :
id->lib;
770 if (new_id_p !=
nullptr) {
790 const int copy_flags)
795 if (
id->newid ==
nullptr) {
809 if (key !=
nullptr) {
817 if (key_new !=
nullptr) {
855 if (newid ==
nullptr) {
881 if (owner_id.
lib ==
id.lib) {
886 BLI_assert_msg(
false,
"Only local IDs can be moved into a library");
894 id.lib = owner_id.
lib;
905 const bool do_full_id,
916 const bool do_full_id,
917 const bool do_self_remap,
920 const int self_remap_flags)
924 IDRemapper *remapper_id_a = input_remapper_id_a;
925 IDRemapper *remapper_id_b = input_remapper_id_b;
927 if (remapper_id_a ==
nullptr) {
928 remapper_id_a = MEM_new<IDRemapper>(__func__);
930 if (remapper_id_b ==
nullptr) {
931 remapper_id_b = MEM_new<IDRemapper>(__func__);
937 const size_t id_struct_size = id_type->
struct_size;
939 const ID id_a_back = *id_a;
940 const ID id_b_back = *id_b;
942 char *id_swap_buff =
static_cast<char *
>(alloca(id_struct_size));
944 memcpy(id_swap_buff, id_a, id_struct_size);
945 memcpy(id_a, id_b, id_struct_size);
946 memcpy(id_b, id_swap_buff, id_struct_size);
980 if (remapper_id_a !=
nullptr) {
981 remapper_id_a->
add(id_b, id_a);
983 if (remapper_id_b !=
nullptr) {
984 remapper_id_b->
add(id_a, id_b);
1011 if (input_remapper_id_a ==
nullptr && remapper_id_a !=
nullptr) {
1012 MEM_delete(remapper_id_a);
1014 if (input_remapper_id_b ==
nullptr && remapper_id_b !=
nullptr) {
1015 MEM_delete(remapper_id_b);
1026 const bool do_full_id,
1030 if (embedded_id_a !=
nullptr && *embedded_id_a !=
nullptr) {
1033 if (*embedded_id_b ==
nullptr) {
1041 bmain, *embedded_id_a, *embedded_id_b, do_full_id,
false, remapper_id_a, remapper_id_b, 0);
1043 std::swap(*embedded_id_a, *embedded_id_b);
1047 if (remapper_id_a !=
nullptr) {
1048 remapper_id_a->
add(*embedded_id_b, *embedded_id_a);
1050 if (remapper_id_b !=
nullptr) {
1051 remapper_id_b->
add(*embedded_id_a, *embedded_id_b);
1057 Main *bmain,
ID *id_a,
ID *id_b,
const bool do_self_remap,
const int self_remap_flags)
1059 id_swap(bmain, id_a, id_b,
false, do_self_remap,
nullptr,
nullptr, self_remap_flags);
1063 Main *bmain,
ID *id_a,
ID *id_b,
const bool do_self_remap,
const int self_remap_flags)
1065 id_swap(bmain, id_a, id_b,
true, do_self_remap,
nullptr,
nullptr, self_remap_flags);
1070 ID *newid =
nullptr;
1079 if (newid !=
nullptr) {
1125 ID *
id =
static_cast<ID *
>(idv);
1158 ID *
id =
static_cast<ID *
>(idv);
1178 ID *
id =
static_cast<ID *
>(idv);
1190 ID *
id =
static_cast<ID *
>(idv);
1205 for (
id =
static_cast<ID *
>(lb->
first);
id;
id =
static_cast<ID *
>(
id->next)) {
1210 const int ntag = ~tag;
1211 for (
id =
static_cast<ID *
>(lb->
first);
id;
id =
static_cast<ID *
>(
id->next)) {
1227 int a = lbarray.size();
1237 for (
id =
static_cast<ID *
>(lb->
first);
id;
id =
static_cast<ID *
>(
id->next)) {
1242 const int nflag =
~flag;
1243 for (
id =
static_cast<ID *
>(lb->
first);
id;
id =
static_cast<ID *
>(
id->next)) {
1252 int a = lbarray.size();
1280 for (
i = 0;
i < lb_len;
i++) {
1319 id.runtime = MEM_new<blender::bke::id::ID_Runtime>(__func__);
1327 if (id_type ==
nullptr) {
1328 if (r_name !=
nullptr) {
1334 if (r_name !=
nullptr) {
1335 *r_name = id_type->
name;
1353 std::optional<Library *> owner_library,
1377 *((
short *)
id->name) = type;
1406 id->lib = owner_library ? *owner_library :
nullptr;
1433 id->lib = owner_library ? *owner_library :
nullptr;
1456 if (idtype_info !=
nullptr) {
1457 if (idtype_info->
init_data !=
nullptr) {
1468 id->runtime->remap.status = 0;
1469 id->runtime->remap.skipped_refcounted = 0;
1470 id->runtime->remap.skipped_direct = 0;
1471 id->runtime->remap.skipped_indirect = 0;
1497 std::optional<Library *> owner_library,
1504 if (
name ==
nullptr) {
1521 if (
name ==
nullptr) {
1536 std::optional<Library *> owner_library,
1538 std::optional<const ID *> new_owner_id,
1540 const int orig_flag)
1542 ID *new_id = *new_id_p;
1543 int flag = orig_flag;
1556 if ((bmain !=
nullptr) && is_embedded_id) {
1563 const int copy_idtag_mask =
1574 memset(new_id, 0,
size);
1579 new_id->
lib = owner_library ? *owner_library :
id->lib;
1584 new_id =
static_cast<ID *
>(
1597 const size_t id_offset =
sizeof(
ID);
1598 if (
int(id_len) -
int(id_offset) > 0) {
1599 const char *cp = (
const char *)
id;
1600 char *cpn = (
char *)new_id;
1602 memcpy(cpn + id_offset, cp + id_offset, id_len - id_offset);
1605 new_id->
flag = (new_id->
flag & ~copy_idflag_mask) | (
id->flag & copy_idflag_mask);
1606 new_id->
tag = (new_id->
tag & ~copy_idtag_mask) | (
id->tag & copy_idtag_mask);
1617 if (new_owner_id.has_value()) {
1621 if (owner_id_pointer) {
1622 *owner_id_pointer =
const_cast<ID *
>(*new_owner_id);
1623 if (*new_owner_id ==
nullptr) {
1634 if (
id->properties) {
1637 if (
id->system_properties) {
1674 if (
id->asset_data) {
1713 const std::optional<Library *>
lib)
1720 while (
id &&
id->lib != *
lib) {
1733 if (
id->session_uid == session_uid) {
1755 const char *lib_name)
1757 const bool is_linked = (lib_name && lib_name[0] !=
'\0');
1770 const char *lib_filepath_abs)
1772 const bool is_linked = (lib_filepath_abs && lib_filepath_abs[0] !=
'\0');
1778 if (
STREQ(lib_iter->
runtime->filepath_abs, lib_filepath_abs)) {
1792#define ID_SORT_STEP_SIZE 512
1804 if (!
ELEM(id_sorting_hint,
nullptr,
id) && id_sorting_hint->
lib ==
id->lib) {
1807 ID *id_sorting_hint_next =
static_cast<ID *
>(id_sorting_hint->
next);
1809 (id_sorting_hint_next ==
nullptr || id_sorting_hint_next->
lib !=
id->lib ||
1816 ID *id_sorting_hint_prev =
static_cast<ID *
>(id_sorting_hint->
prev);
1818 (id_sorting_hint_prev ==
nullptr || id_sorting_hint_prev->
lib !=
id->lib ||
1827 int item_array_index;
1834 bool is_in_library =
false;
1836 for (idtest =
static_cast<ID *
>(lb->
last); idtest !=
nullptr;
1837 idtest =
static_cast<ID *
>(idtest->
prev))
1839 if (is_in_library) {
1840 if (idtest->
lib !=
id->lib) {
1846 else if (idtest->
lib ==
id->lib) {
1848 is_in_library =
true;
1851 if (!is_in_library) {
1855 item_array[item_array_index] = idtest;
1856 if (item_array_index == 0) {
1872 for (item_array_index++; item_array_index <
ID_SORT_STEP_SIZE; item_array_index++) {
1873 idtest =
static_cast<ID *
>(item_array[item_array_index]);
1880 if (idtest ==
nullptr) {
1900#undef ID_SORT_STEP_SIZE
1906 const char *newname,
1908 const bool do_linked_data)
1920 if (newname ==
nullptr) {
1926 if (
name[0] ==
'\0') {
1945 if (had_name_collision &&
1950 int prev_number = 0;
1972 if (is_idname_changed) {
1989 if (is_idname_changed) {
1994 else if (had_name_collision) {
2017 if (*id_pointer ==
nullptr) {
2080 from_id_entry = from_id_entry->
next)
2088 ID *from_id = from_id_entry->id_pointer.from;
2094 from_id = ((
Key *)from_id)->from;
2131 GHash *old_to_new_ids,
2132 const bool untagged_only,
2133 const bool set_fake,
2134 const bool clear_asset_data)
2159 printf(
"Pre-compute current ID relations: Done.\n");
2164 for (
int a = lbarray.size(); a--;) {
2165 ID *
id =
static_cast<ID *
>(lbarray[a]->first);
2171 for (;
id;
id =
static_cast<ID *
>(
id->next)) {
2175 if (ntree !=
nullptr) {
2183 ELEM(
lib,
nullptr,
id->override_library->reference->lib) &&
2213 if (ntree !=
nullptr) {
2225 printf(
"Step 1: Detect data-blocks to make local: Done.\n");
2235 static_cast<ID *
>(it->link), loop_tags, bmain->
relations, done_ids);
2245 printf(
"Step 2: Check which data-blocks we can directly make local: Done.\n");
2254 for (
LinkNode *it = todo_ids, *it_next; it; it = it_next) {
2256 ID *
id =
static_cast<ID *
>(it->link);
2294 printf(
"Step 3: Make IDs local: Done.\n");
2312 ID *
id =
static_cast<ID *
>(it->link);
2318 if (old_to_new_ids) {
2335 printf(
"Step 4: Remap local usages of old (linked) ID to new (local) ID: Done.\n");
2347 ob =
static_cast<Object *
>(ob->id.next))
2349 if (ob->data !=
nullptr && ob->type ==
OB_ARMATURE && ob->pose !=
nullptr &&
2357 printf(
"Hack: Forcefully rebuild armature object poses: Done.\n");
2365 printf(
"Cleanup and finish: Done.\n");
2399 auto deg_tag_id = [](
ID &
id) ->
void {
2424 deg_tag_id(*
result.other_id);
2437 const size_t idname_len = strlen(
BKE_id_name(*
id));
2438 const size_t libname_len = strlen(
BKE_id_name(
id->lib->id));
2440 name[idname_len] = separator_char ? separator_char :
' ';
2441 name[idname_len + 1] =
'[';
2444 name[idname_len + 2 + libname_len] =
']';
2445 name[idname_len + 2 + libname_len + 1] =
'\0';
2451 const bool add_lib_hint,
2452 char separator_char,
2479 const char ascii_len = strlen(
BKE_id_name(
id->lib->id)) + 32;
2516 if (owner_id_pointer !=
nullptr) {
2517 return *owner_id_pointer;
2531 if (id_from.
lib && !id_to.
lib) {
2547 switch (
GS(
id->name)) {
2562 BLI_assert((order_a && order_b) || (!order_a && !order_b));
2564 if (order_a && order_b) {
2565 if (*order_a < *order_b) {
2568 if (*order_a > *order_b) {
2573 return strcmp(a->
name,
b->name) < 0;
2611 if (*order > relative_order) {
2616 *id_order = relative_order + 1;
2622 if (*order < relative_order) {
2627 *id_order = relative_order - 1;
2633 if (
id->asset_data) {
2637 if (
id->library_weak_reference !=
nullptr) {
2653 if (
id->override_library) {
2662 if (opop->subitem_reference_name) {
2665 if (opop->subitem_local_name) {
2677static_assert(blender::dna::is_ID_v<ID>);
2678static_assert(blender::dna::is_ID_v<Object>);
2679static_assert(!blender::dna::is_ID_v<int>);
2680static_assert(!blender::dna::is_ID_v<ID *>);
2681static_assert(!blender::dna::is_ID_v<const ID>);
2682static_assert(!blender::dna::is_ID_v<ListBase>);
2683static_assert(!blender::dna::is_ID_v<SomeTypeWithIDMember>);
AnimData * BKE_animdata_copy_in_lib(Main *bmain, std::optional< Library * > owner_library, AnimData *adt, int flag)
void BKE_animdata_blend_write(BlendWriter *writer, ID *id)
bool id_can_have_animdata(const ID *id)
void BKE_animdata_duplicate_id_action(Main *bmain, ID *id, uint duplicate_flags)
void BKE_pose_rebuild(Main *bmain, Object *ob, bArmature *arm, bool do_id_user)
AssetMetaData * BKE_asset_metadata_copy(const AssetMetaData *source)
void BKE_asset_metadata_free(AssetMetaData **asset_data)
void BKE_asset_metadata_write(BlendWriter *writer, AssetMetaData *asset_data)
void BKE_bpath_foreach_path_id(BPathForeachPathData *bpath_data, ID *id)
@ BKE_BPATH_FOREACH_PATH_SKIP_MULTIFILE
Main * CTX_data_main(const bContext *C)
IDProperty * IDP_CopyProperty_ex(const IDProperty *prop, int flag) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void IDP_BlendWrite(BlendWriter *writer, const IDProperty *prop)
const IDTypeInfo * BKE_idtype_get_info_from_id(const ID *id)
@ IDTYPE_FLAGS_NO_ANIMDATA
@ IDTYPE_FLAGS_NO_LIBLINKING
const IDTypeInfo * BKE_idtype_get_info_from_idcode(short id_code)
const char * BKE_idtype_idcode_to_name(short idcode)
bool BKE_idtype_idcode_is_linkable(short idcode)
IDTypeInfo IDType_ID_LINK_PLACEHOLDER
Key ** BKE_key_from_id_p(ID *id)
Key * BKE_key_from_id(ID *id)
@ LIB_ID_MAKELOCAL_INDIRECT
@ LIB_ID_MAKELOCAL_FORCE_LOCAL
@ LIB_ID_MAKELOCAL_LIBOVERRIDE_CLEAR
@ LIB_ID_MAKELOCAL_ASSET_DATA_CLEAR
@ LIB_ID_MAKELOCAL_FULL_LIBRARY
@ LIB_ID_MAKELOCAL_FORCE_COPY
#define MAIN_ID_SESSION_UID_UNSET
#define MAX_ID_FULL_NAME_UI
@ LIB_ID_CREATE_NO_ALLOCATE
@ LIB_ID_COPY_ASSET_METADATA
@ LIB_ID_COPY_NO_LIB_OVERRIDE
@ LIB_ID_COPY_SET_COPIED_ON_WRITE
@ LIB_ID_CREATE_NO_USER_REFCOUNT
@ LIB_ID_COPY_NO_ANIMDATA
@ LIB_ID_CREATE_NO_DEG_TAG
const char * BKE_id_name(const ID &id)
void BKE_lib_override_library_main_hierarchy_root_ensure(Main *bmain)
bool BKE_lib_override_library_is_system_defined(const Main *bmain, const ID *id)
void BKE_lib_override_library_copy(ID *dst_id, const ID *src_id, bool do_full_copy)
void BKE_lib_override_library_make_local(Main *bmain, ID *id)
void BKE_library_ID_test_usages(Main *bmain, void *idv, bool *r_is_used_local, bool *r_is_used_linked)
LibraryForeachIDCallbackFlag
@ IDWALK_CB_EMBEDDED_NOT_OWNING
void BKE_library_foreach_ID_link(Main *bmain, ID *id, blender::FunctionRef< LibraryIDLinkCallback > callback, void *user_data, LibraryForeachIDFlag flag)
@ IDWALK_IGNORE_MISSING_OWNER_ID
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 void BKE_libblock_remap(Main *bmain, void *old_idv, void *new_idv, int remap_flags) ATTR_NONNULL(1
@ ID_REMAP_SKIP_INDIRECT_USAGE
#define FOREACH_MAIN_ID_END
MainListsArray BKE_main_lists_get(Main &bmain)
ListBase * which_libbase(Main *bmain, short type)
std::array< ListBase *, INDEX_ID_MAX - 1 > MainListsArray
void BKE_main_lock(Main *bmain)
void BKE_main_relations_create(Main *bmain, short flag)
#define FOREACH_MAIN_ID_BEGIN(_bmain, _id)
const char * BKE_main_blendfile_path(const Main *bmain) ATTR_NONNULL()
void BKE_main_unlock(Main *bmain)
void BKE_main_relations_free(Main *bmain)
void BKE_main_namemap_remove_id(Main &bmain, ID &id)
bool BKE_main_namemap_get_unique_name(Main &bmain, ID &id, char *r_name)
API for Blender-side Rigid Body stuff.
void BKE_rigidbody_ensure_local_object(struct Main *bmain, struct Object *ob)
#define BLI_assert_msg(a, msg)
GSet * BLI_gset_ptr_new(const char *info)
bool BLI_gset_haskey(const GSet *gs, const void *key) ATTR_WARN_UNUSED_RESULT
unsigned int BLI_gset_len(const GSet *gs) ATTR_WARN_UNUSED_RESULT
void BLI_gset_insert(GSet *gs, void *key)
void * BLI_ghash_lookup(const GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT
GSet * BLI_gset_str_new_ex(const char *info, unsigned int nentries_reserve) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
void BLI_ghash_insert(GHash *gh, void *key, void *val)
void BLI_gset_free(GSet *gs, GSetKeyFreeFP keyfreefp)
bool BLI_gset_add(GSet *gs, void *key)
bool BLI_gset_remove(GSet *gs, const void *key, GSetKeyFreeFP keyfreefp)
void BLI_linklist_prepend_nlink(LinkNode **listp, void *ptr, LinkNode *nlink) ATTR_NONNULL(1
void BLI_linklist_prepend_arena(LinkNode **listp, void *ptr, struct MemArena *ma) ATTR_NONNULL(1
int BLI_findindex(const ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define LISTBASE_FOREACH(type, var, list)
void * BLI_findstring(const ListBase *listbase, const char *id, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_insertlinkafter(ListBase *listbase, void *vprevlink, void *vnewlink) ATTR_NONNULL(1)
void BLI_remlink(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_addhead(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
int BLI_listbase_count(const ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void * BLI_listbase_findafter_string(Link *link, const char *id, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void BLI_insertlinkbefore(ListBase *listbase, void *vnextlink, void *vnewlink) ATTR_NONNULL(1)
MemArena * BLI_memarena_new(size_t bufsize, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL ATTR_NONNULL(2) ATTR_MALLOC
void BLI_memarena_free(MemArena *ma) ATTR_NONNULL(1)
bool BLI_path_abs(char path[FILE_MAX], const char *basepath) ATTR_NONNULL(1
int BLI_path_normalize(char *path) ATTR_NONNULL(1)
bool BLI_path_is_rel(const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT
bool void BLI_path_rel(char path[FILE_MAX], const char *basepath) ATTR_NONNULL(1)
char * BLI_sprintfN(const char *__restrict format,...) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC ATTR_PRINTF_FORMAT(1
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC
int char char int BLI_strcasecmp(const char *s1, const char *s2) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
char * STRNCPY(char(&dst)[N], const char *src)
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
int BLI_str_utf8_invalid_strip(char *str, size_t str_len) ATTR_NONNULL(1)
#define STRNCPY_UTF8(dst, src)
size_t BLI_string_split_name_number(const char *name, char delim, char *r_name_left, int *r_number) ATTR_NONNULL(1
Utility defines for timing/benchmarks.
#define TIMEIT_START(var)
#define TIMEIT_VALUE_PRINT(var)
#define POINTER_FROM_INT(i)
#define POINTER_AS_INT(i)
#define BLO_write_struct(writer, struct_name, data_ptr)
void BLO_write_string(BlendWriter *writer, const char *data_ptr)
#define BLO_write_struct_list(writer, struct_name, list_ptr)
#define BLT_I18NCONTEXT_ID_ID
#define CLOG_ERROR(clg_ref,...)
void DEG_id_tag_update(ID *id, unsigned int flags)
void DEG_id_type_tag(Main *bmain, short id_type)
void DEG_relations_tag_update(Main *bmain)
bool DEG_is_evaluated(const T *id)
T * DEG_get_original(T *id)
ID and Library types, which are fundamental for SDNA.
#define ID_IS_OVERRIDE_LIBRARY_VIRTUAL(_id)
@ ID_TAG_NO_USER_REFCOUNT
#define ID_FAKE_USERS(id)
#define ID_IS_OVERRIDE_LIBRARY_REAL(_id)
#define ID_IS_LINKED(_id)
#define ID_TYPE_IS_DEPRECATED(id_type)
#define ID_IS_EDITABLE(_id)
#define ID_REAL_USERS(id)
#define ID_IS_OVERRIDE_LIBRARY(_id)
#define ID_NEW_SET(_id, _idn)
@ ID_FLAG_INDIRECT_WEAK_LINK
@ ID_FLAG_EMBEDDED_DATA_LIB_OVERRIDE
@ ID_FLAG_LINKED_AND_PACKED
@ LIBRARY_FLAG_IS_ARCHIVE
#define ID_LINK_PLACEHOLDER
Object groups, one object can be in many groups at once.
Read Guarded memory(de)allocation.
Provides wrapper around system-specific atomic primitives, and some extensions (faked-atomic operatio...
ATOMIC_INLINE int32_t atomic_fetch_and_or_int32(int32_t *p, int32_t x)
ATOMIC_INLINE uint32_t atomic_add_and_fetch_uint32(uint32_t *p, uint32_t x)
ATOMIC_INLINE int32_t atomic_fetch_and_and_int32(int32_t *p, int32_t x)
BMesh const char void * data
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
void append(const T &value)
IndexRange index_range() const
void add(ID *old_id, ID *new_id)
void BKE_id_newptr_and_tag_clear(ID *id)
ID * BKE_id_owner_get(ID *id, const bool debug_relationship_assert)
ID * BKE_libblock_alloc_notest(short type)
DEG_id_tag_update_ex(cb_data->bmain, cb_data->owner_id, ID_RECALC_TAG_FOR_UNDO|ID_RECALC_SYNC_TO_EVAL)
void BKE_libblock_init_empty(ID *id)
void id_lib_extern(ID *id)
void BKE_main_id_refcount_recompute(Main *bmain, const bool do_linked_only)
void * BKE_id_new_in_lib(Main *bmain, std::optional< Library * > owner_library, const short type, const char *name)
void BKE_main_id_repair_duplicate_names_listbase(Main *bmain, ListBase *lb)
void BKE_library_make_local(Main *bmain, const Library *lib, GHash *old_to_new_ids, const bool untagged_only, const bool set_fake, const bool clear_asset_data)
static int id_copy_libmanagement_cb(LibraryIDLinkCallbackData *cb_data)
#define ID_SORT_STEP_SIZE
void BKE_libblock_copy_in_lib(Main *bmain, std::optional< Library * > owner_library, const ID *id, std::optional< const ID * > new_owner_id, ID **new_id_p, const int orig_flag)
ID * BKE_id_copy_for_use_in_bmain(Main *bmain, const ID *id)
void BKE_id_tag_clear_atomic(ID *id, int tag)
void BKE_lib_id_clear_library_data(Main *bmain, ID *id, const int flags)
bool id_single_user(bContext *C, ID *id, PointerRNA *ptr, PropertyRNA *prop)
ID * BKE_libblock_find_name(Main *bmain, const short type, const char *name, const std::optional< Library * > lib)
void BKE_libblock_copy_ex(Main *bmain, const ID *id, ID **new_id_p, const int orig_flag)
void BKE_id_full_name_get(char name[MAX_ID_FULL_NAME], const ID *id, char separator_char)
ID * BKE_libblock_find_name_and_library(Main *bmain, const short type, const char *name, const char *lib_name)
static bool lib_id_library_local_paths_callback(BPathForeachPathData *bpath_data, char *path_dst, size_t path_dst_maxncpy, const char *path_src)
bool BKE_id_is_editable(const Main *bmain, const ID *id)
static int id_refcount_recompute_callback(LibraryIDLinkCallbackData *cb_data)
char * BKE_id_to_unique_string_key(const ID *id)
void BKE_main_id_flag_listbase(ListBase *lb, const int flag, const bool value)
void id_sort_by_name(ListBase *lb, ID *id, ID *id_sorting_hint)
bool BKE_id_copy_is_allowed(const ID *id)
void BKE_main_id_tag_idcode(Main *mainvar, const short type, const int tag, const bool value)
void BKE_libblock_management_main_remove(Main *bmain, void *idv)
ID * BKE_libblock_find_name_and_library_filepath(Main *bmain, short type, const char *name, const char *lib_filepath_abs)
static int libblock_management_us_plus(LibraryIDLinkCallbackData *cb_data)
void BKE_lib_id_expand_local(Main *bmain, ID *id, const int flags)
static void id_swap(Main *bmain, ID *id_a, ID *id_b, const bool do_full_id, const bool do_self_remap, IDRemapper *input_remapper_id_a, IDRemapper *input_remapper_id_b, const int self_remap_flags)
ID * BKE_id_copy_ex(Main *bmain, const ID *id, ID **new_id_p, const int flag)
void BKE_id_tag_set_atomic(ID *id, int tag)
void BKE_id_move_to_same_lib(Main &bmain, ID &id, const ID &owner_id)
bool BKE_id_can_use_id(const ID &id_from, const ID &id_to)
#define LIB_ID_TYPES_NOCOPY
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_id_reorder(const ListBase *lb, ID *id, ID *relative, bool after)
void * BKE_libblock_copy(Main *bmain, const ID *id)
void BKE_id_full_name_ui_prefix_get(char name[MAX_ID_FULL_NAME_UI], const ID *id, const bool add_lib_hint, char separator_char, int *r_prefix_len)
IDNewNameResult BKE_libblock_rename(Main &bmain, ID &id, blender::StringRefNull name, const IDNewNameMode mode)
void BKE_main_id_flag_all(Main *bmain, const int flag, const bool value)
static int lib_id_expand_local_cb(LibraryIDLinkCallbackData *cb_data)
bool BKE_id_is_in_main(Main *bmain, ID *id)
void BKE_libblock_runtime_reset_remapping_status(ID *id)
void BKE_main_id_newptr_and_tag_clear(Main *bmain)
void BKE_lib_libblock_session_uid_ensure(ID *id)
void * BKE_id_new_nomain(const short type, const char *name)
void id_us_ensure_real(ID *id)
void BKE_lib_id_make_local_generic(Main *bmain, ID *id, const int flags)
void id_fake_user_clear(ID *id)
void id_us_clear_real(ID *id)
void BKE_lib_id_swap_full(Main *bmain, ID *id_a, ID *id_b, const bool do_self_remap, const int self_remap_flags)
void BKE_libblock_management_usercounts_set(Main *bmain, void *idv)
void BKE_lib_id_make_local_generic_action_define(Main *bmain, ID *id, int flags, bool *r_force_local, bool *r_force_copy)
void BKE_main_lib_objects_recalc_all(Main *bmain)
ID * BKE_id_copy(Main *bmain, const ID *id)
void id_us_plus_no_lib(ID *id)
static void library_make_local_copying_check(ID *id, GSet *loop_tags, MainIDRelations *id_relations, GSet *done_ids)
void BKE_main_id_tag_listbase(ListBase *lb, const int tag, const bool value)
void lib_id_copy_ensure_local(Main *bmain, const ID *old_id, ID *new_id, const int flags)
void BKE_main_id_tag_all(Main *mainvar, const int tag, const bool value)
static void id_embedded_swap(Main *bmain, ID **embedded_id_a, ID **embedded_id_b, const bool do_full_id, IDRemapper *remapper_id_a, IDRemapper *remapper_id_b)
void id_lib_indirect_weak_link(ID *id)
bool BKE_lib_id_make_local(Main *bmain, ID *id, const int flags)
void * BKE_id_new(Main *bmain, const short type, const char *name)
void BKE_libblock_runtime_ensure(ID &id)
static int * id_order_get(ID *id)
void * BKE_libblock_alloc_in_lib(Main *bmain, std::optional< Library * > owner_library, short type, const char *name, const int flag)
static uint global_session_uid
Vector< ID * > BKE_id_ordered_list(const ListBase *lb)
void * BKE_libblock_alloc(Main *bmain, short type, const char *name, const int flag)
IDNewNameResult BKE_id_new_name_validate(Main &bmain, ListBase &lb, ID &id, const char *newname, IDNewNameMode mode, const bool do_linked_data)
ID * BKE_id_copy_in_lib(Main *bmain, std::optional< Library * > owner_library, const ID *id, std::optional< const ID * > new_owner_id, ID **new_id_p, const int flag)
static int libblock_management_us_min(LibraryIDLinkCallbackData *cb_data)
ID * BKE_libblock_find_session_uid(Main *bmain, const short type, const uint32_t session_uid)
void BKE_id_blend_write(BlendWriter *writer, ID *id)
void BKE_libblock_management_main_add(Main *bmain, void *idv)
ID * BKE_id_copy_for_duplicate(Main *bmain, ID *id, const eDupli_ID_Flags duplicate_flags, const int copy_flags)
void BKE_libblock_management_usercounts_clear(Main *bmain, void *idv)
static bool id_order_compare(ID *a, ID *b)
static int foreach_assign_id_to_orig_callback(LibraryIDLinkCallbackData *cb_data)
size_t BKE_libblock_get_alloc_info(short type, const char **r_name)
bool BKE_id_can_be_asset(const ID *id)
IDNewNameResult BKE_id_rename(Main &bmain, ID &id, blender::StringRefNull name, const IDNewNameMode mode)
bool BKE_id_is_in_global_main(ID *id)
void BKE_lib_libblock_session_uid_renew(ID *id)
void * MEM_callocN(size_t len, const char *str)
void * MEM_malloc_arrayN(size_t len, size_t size, const char *str)
void MEM_freeN(void *vmemh)
void action_slots_user_cache_invalidate(Main &bmain)
bNodeTree ** node_tree_ptr_from_id(ID *id)
bNodeTree * node_tree_from_id(ID *id)
void RNA_property_pointer_set(PointerRNA *ptr, PropertyRNA *prop, PointerRNA ptr_value, ReportList *reports)
void RNA_property_update(bContext *C, PointerRNA *ptr, PropertyRNA *prop)
bool RNA_property_editable(const PointerRNA *ptr, PropertyRNA *prop)
PointerRNA RNA_id_pointer_create(ID *id)
OnClearAssetDataFn on_clear_asset_fn
BPathForeachPathFunctionCallback callback_function
@ RENAMED_COLLISION_FORCED
@ RENAMED_COLLISION_ADJUSTED
IDTypeCopyDataFunction copy_data
IDTypeInitDataFunction init_data
IDTypeMakeLocalFunction make_local
AssetTypeInfo * asset_type_info
IDTypeEmbeddedOwnerPointerGetFunction owner_pointer_get
struct AssetMetaData * asset_data
IDProperty * system_properties
struct LibraryWeakReference * library_weak_reference
LibraryForeachIDCallbackFlag cb_flag
LibraryRuntimeHandle * runtime
MainIDRelationsEntryItem * next
MainIDRelationsEntryItem * from_ids
GHash * relations_from_pointers
bool is_locked_for_linking
bool is_memfile_undo_written
MainIDRelations * relations
struct Collection * master_collection
static DynamicLibrary lib