Blender
V3.3
|
#include "DNA_ID.h"
#include "BKE_idtype.h"
#include "BKE_lib_id.h"
#include "BKE_lib_remap.h"
#include "MEM_guardedalloc.h"
#include "BLI_map.hh"
Go to the source code of this file.
Classes | |
struct | blender::bke::id::remapper::IDRemapper |
Namespaces | |
blender | |
blender::bke | |
blender::bke::id | |
blender::bke::id::remapper | |
Typedefs | |
using | IDTypeFilter = uint64_t |
Functions | |
static IDRemapper * | wrap (blender::bke::id::remapper::IDRemapper *remapper) |
wrap CPP IDRemapper to a C handle. More... | |
static blender::bke::id::remapper::IDRemapper * | unwrap (IDRemapper *remapper) |
wrap C handle to a CPP IDRemapper. More... | |
static const blender::bke::id::remapper::IDRemapper * | unwrap (const IDRemapper *remapper) |
wrap C handle to a CPP IDRemapper. More... | |
IDRemapper * | BKE_id_remapper_create (void) |
void | BKE_id_remapper_free (IDRemapper *id_remapper) |
void | BKE_id_remapper_clear (struct IDRemapper *id_remapper) |
bool | BKE_id_remapper_is_empty (const struct IDRemapper *id_remapper) |
void | BKE_id_remapper_add (IDRemapper *id_remapper, ID *old_id, ID *new_id) |
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) |
IDRemapperApplyResult | BKE_id_remapper_apply_ex (const IDRemapper *id_remapper, ID **r_id_ptr, const IDRemapperApplyOptions options, ID *id_self) |
IDRemapperApplyResult | BKE_id_remapper_apply (const IDRemapper *id_remapper, ID **r_id_ptr, const IDRemapperApplyOptions options) |
void | BKE_id_remapper_iter (const struct IDRemapper *id_remapper, IDRemapperIterFunction func, void *user_data) |
const char * | BKE_id_remapper_result_string (const IDRemapperApplyResult result) |
static void | id_remapper_print_item_cb (ID *old_id, ID *new_id, void *UNUSED(user_data)) |
void | BKE_id_remapper_print (const struct IDRemapper *id_remapper) |
using IDTypeFilter = uint64_t |
Definition at line 14 of file lib_id_remapper.cc.
void BKE_id_remapper_add | ( | struct IDRemapper * | id_remapper, |
struct ID * | old_id, | ||
struct ID * | new_id | ||
) |
Add a new remapping.
Definition at line 156 of file lib_id_remapper.cc.
References blender::bke::id::remapper::IDRemapper::add(), and unwrap().
Referenced by BKE_id_free_ex(), BKE_libblock_relink_ex(), BKE_libblock_remap_locked(), ED_spacedata_id_remap_single(), foreach_libblock_remap_callback(), id_delete(), id_relink_to_newid_looper(), lib_override_library_remap(), lib_override_remapper_overrides_add(), and blender::bke::id::remapper::tests::TEST().
IDRemapperApplyResult BKE_id_remapper_apply | ( | const IDRemapper * | id_remapper, |
ID ** | r_id_ptr, | ||
const IDRemapperApplyOptions | options | ||
) |
Definition at line 189 of file lib_id_remapper.cc.
References BKE_id_remapper_apply_ex(), BLI_assert_msg, ID_REMAP_APPLY_UNMAP_WHEN_REMAPPING_TO_SELF, and options.
IDRemapperApplyResult BKE_id_remapper_apply_ex | ( | const IDRemapper * | id_remapper, |
ID ** | r_id_ptr, | ||
const IDRemapperApplyOptions | options, | ||
ID * | id_self | ||
) |
Definition at line 177 of file lib_id_remapper.cc.
References blender::bke::id::remapper::IDRemapper::apply(), BLI_assert_msg, ID_REMAP_APPLY_UNMAP_WHEN_REMAPPING_TO_SELF, options, and unwrap().
Referenced by BKE_id_remapper_apply().
void BKE_id_remapper_clear | ( | struct IDRemapper * | id_remapper | ) |
Definition at line 144 of file lib_id_remapper.cc.
References blender::bke::id::remapper::IDRemapper::clear(), and unwrap().
Referenced by foreach_libblock_remap_callback(), id_delete(), and blender::bke::id::remapper::tests::TEST().
IDRemapper* BKE_id_remapper_create | ( | void | ) |
Create a new ID Remapper.
An ID remapper stores multiple remapping rules.
Definition at line 131 of file lib_id_remapper.cc.
References wrap().
Referenced by BKE_id_free_ex(), BKE_lib_override_library_create_from_tag(), BKE_libblock_relink_ex(), BKE_libblock_relink_to_newid(), BKE_libblock_remap_locked(), ED_spacedata_id_remap_single(), id_delete(), lib_override_library_remap(), lib_override_library_resync(), and blender::bke::id::remapper::tests::TEST().
void BKE_id_remapper_free | ( | struct IDRemapper * | id_remapper | ) |
Free the given ID Remapper.
Definition at line 138 of file lib_id_remapper.cc.
References unwrap().
Referenced by BKE_id_free_ex(), BKE_lib_override_library_create_from_tag(), BKE_libblock_relink_ex(), BKE_libblock_relink_to_newid(), BKE_libblock_remap_locked(), ED_spacedata_id_remap_single(), id_delete(), lib_override_library_remap(), lib_override_library_resync(), and blender::bke::id::remapper::tests::TEST().
IDRemapperApplyResult BKE_id_remapper_get_mapping_result | ( | const struct IDRemapper * | id_remapper, |
struct ID * | id, | ||
IDRemapperApplyOptions | options, | ||
const struct ID * | id_self | ||
) |
Determine the mapping result, without applying the mapping.
Definition at line 168 of file lib_id_remapper.cc.
References blender::bke::id::remapper::IDRemapper::get_mapping_result(), options, and unwrap().
Referenced by foreach_libblock_remap_callback(), and libblock_remap_data_preprocess_ob().
bool BKE_id_remapper_has_mapping_for | ( | const struct IDRemapper * | id_remapper, |
uint64_t | type_filter | ||
) |
Definition at line 162 of file lib_id_remapper.cc.
References blender::bke::id::remapper::IDRemapper::contains_mappings_for_any(), and unwrap().
Referenced by clip_id_remap(), image_id_remap(), libblock_remap_data(), libblock_remap_data_preprocess_ob(), and view3d_id_remap().
bool BKE_id_remapper_is_empty | ( | const struct IDRemapper * | id_remapper | ) |
Definition at line 150 of file lib_id_remapper.cc.
References blender::bke::id::remapper::IDRemapper::is_empty(), and unwrap().
Referenced by BKE_libblock_relink_multiple(), BKE_libblock_remap_multiple_locked(), and id_delete().
void BKE_id_remapper_iter | ( | const struct IDRemapper * | id_remapper, |
IDRemapperIterFunction | func, | ||
void * | user_data | ||
) |
Definition at line 199 of file lib_id_remapper.cc.
References blender::bke::id::remapper::IDRemapper::iter(), unwrap(), and user_data.
Referenced by BKE_id_remapper_print(), BKE_libblock_relink_multiple(), BKE_libblock_remap_multiple_locked(), libblock_remap_data(), blender::ed::space_node::node_id_remap(), and WM_main_remap_editor_id_reference().
void BKE_id_remapper_print | ( | const struct IDRemapper * | id_remapper | ) |
Prints out the rules inside the given id_remapper. Can be used for debugging purposes.
Definition at line 234 of file lib_id_remapper.cc.
References BKE_id_remapper_iter(), and id_remapper_print_item_cb().
const char* BKE_id_remapper_result_string | ( | const IDRemapperApplyResult | result | ) |
Returns a readable string for the given result. Can be used for debugging purposes.
Definition at line 207 of file lib_id_remapper.cc.
References BLI_assert_unreachable, ID_REMAP_RESULT_SOURCE_NOT_MAPPABLE, ID_REMAP_RESULT_SOURCE_REMAPPED, ID_REMAP_RESULT_SOURCE_UNASSIGNED, ID_REMAP_RESULT_SOURCE_UNAVAILABLE, and result.
Referenced by foreach_libblock_remap_callback().
Definition at line 224 of file lib_id_remapper.cc.
References ID::name.
Referenced by BKE_id_remapper_print().
|
static |
wrap C handle to a CPP IDRemapper.
Definition at line 123 of file lib_id_remapper.cc.
|
static |
wrap C handle to a CPP IDRemapper.
Definition at line 117 of file lib_id_remapper.cc.
Referenced by BKE_id_remapper_add(), BKE_id_remapper_apply_ex(), BKE_id_remapper_clear(), BKE_id_remapper_free(), BKE_id_remapper_get_mapping_result(), BKE_id_remapper_has_mapping_for(), BKE_id_remapper_is_empty(), and BKE_id_remapper_iter().
|
static |
wrap CPP IDRemapper to a C handle.
Definition at line 111 of file lib_id_remapper.cc.
Referenced by BKE_id_remapper_create().