38 mappings.
add(old_id, new_id);
45 return (source_types &
filter) != 0;
50 const ID *id_self)
const
55 const ID *new_id = mappings.
lookup(
id);
59 if (new_id ==
nullptr) {
69 if (*r_id_ptr ==
nullptr) {
81 *r_id_ptr = mappings.
lookup(*r_id_ptr);
85 if (*r_id_ptr ==
nullptr) {
102 for (
auto item : mappings.
items()) {
113 return static_cast<IDRemapper *
>(
static_cast<void *
>(remapper));
126 static_cast<const void *
>(remapper));
134 MEM_new<blender::bke::id::remapper::IDRemapper>(__func__);
135 return wrap(remapper);
141 MEM_delete<blender::bke::id::remapper::IDRemapper>(remapper);
159 remapper->
add(old_id, new_id);
171 const struct ID *id_self)
184 "ID_REMAP_APPLY_WHEN_REMAPPING_TO_SELF requires id_self parameter.");
194 "ID_REMAP_APPLY_UNMAP_WHEN_REMAPPING_TO_SELF requires id_self parameter. Use "
195 "`BKE_id_remapper_apply_ex`.");
211 return "not_mappable";
213 return "unavailable";
226 if (old_id !=
nullptr && new_id !=
nullptr) {
227 printf(
"Remap %s(%p) to %s(%p)\n", old_id->
name, old_id, new_id->
name, new_id);
229 if (old_id !=
nullptr && new_id ==
nullptr) {
230 printf(
"Unassign %s(%p)\n", old_id->
name, old_id);
uint64_t BKE_idtype_idcode_to_idfilter(short idcode)
void id_us_min(struct ID *id)
void id_us_ensure_real(struct ID *id)
void id_us_plus_no_lib(struct ID *id)
@ ID_REMAP_RESULT_SOURCE_REMAPPED
@ ID_REMAP_RESULT_SOURCE_UNASSIGNED
@ ID_REMAP_RESULT_SOURCE_NOT_MAPPABLE
@ ID_REMAP_RESULT_SOURCE_UNAVAILABLE
@ ID_REMAP_APPLY_UPDATE_REFCOUNT
@ ID_REMAP_APPLY_UNMAP_WHEN_REMAPPING_TO_SELF
@ ID_REMAP_APPLY_ENSURE_REAL
void(* IDRemapperIterFunction)(struct ID *old_id, struct ID *new_id, void *user_data)
#define BLI_assert_unreachable()
#define BLI_assert_msg(a, msg)
ID and Library types, which are fundamental for sdna.
Read Guarded memory(de)allocation.
bool add(const Key &key, const Value &value)
const Value & lookup(const Key &key) const
ItemIterator items() const
bool contains(const Key &key) const
CCL_NAMESPACE_BEGIN struct Options options
DO_INLINE void filter(lfVector *V, fmatrix3x3 *S)
void BKE_id_remapper_add(IDRemapper *id_remapper, ID *old_id, ID *new_id)
static void id_remapper_print_item_cb(ID *old_id, ID *new_id, void *UNUSED(user_data))
static blender::bke::id::remapper::IDRemapper * unwrap(IDRemapper *remapper)
wrap C handle to a CPP IDRemapper.
bool BKE_id_remapper_has_mapping_for(const struct IDRemapper *id_remapper, uint64_t type_filter)
IDRemapperApplyResult BKE_id_remapper_get_mapping_result(const struct IDRemapper *id_remapper, struct ID *id, IDRemapperApplyOptions options, const struct ID *id_self)
static IDRemapper * wrap(blender::bke::id::remapper::IDRemapper *remapper)
wrap CPP IDRemapper to a C handle.
void BKE_id_remapper_clear(struct IDRemapper *id_remapper)
IDRemapper * BKE_id_remapper_create(void)
IDRemapperApplyResult BKE_id_remapper_apply_ex(const IDRemapper *id_remapper, ID **r_id_ptr, const IDRemapperApplyOptions options, ID *id_self)
const char * BKE_id_remapper_result_string(const IDRemapperApplyResult result)
void BKE_id_remapper_print(const struct IDRemapper *id_remapper)
bool BKE_id_remapper_is_empty(const struct IDRemapper *id_remapper)
void BKE_id_remapper_iter(const struct IDRemapper *id_remapper, IDRemapperIterFunction func, void *user_data)
IDRemapperApplyResult BKE_id_remapper_apply(const IDRemapper *id_remapper, ID **r_id_ptr, const IDRemapperApplyOptions options)
void BKE_id_remapper_free(IDRemapper *id_remapper)
unsigned __int64 uint64_t
void add(ID *old_id, ID *new_id)
void iter(IDRemapperIterFunction func, void *user_data) const
bool contains_mappings_for_any(IDTypeFilter filter) const
IDRemapperApplyResult get_mapping_result(ID *id, IDRemapperApplyOptions options, const ID *id_self) const
IDRemapperApplyResult apply(ID **r_id_ptr, IDRemapperApplyOptions options, ID *id_self) const