Blender V4.3
blender::bke::id::IDRemapper Class Reference

#include <BKE_lib_remap.hh>

Public Member Functions

void clear ()
 
bool is_empty () const
 
bool contains_mappings_for_any (IDTypeFilter filter) const
 
void add (ID *old_id, ID *new_id)
 
void add_overwrite (ID *old_id, ID *new_id)
 
IDRemapperApplyResult get_mapping_result (ID *id, IDRemapperApplyOptions options, const ID *id_self) const
 
IDRemapperApplyResult apply (ID **r_id_ptr, IDRemapperApplyOptions options, ID *id_self=nullptr) const
 
void never_null_users_add (ID *id)
 
const Set< ID * > & never_null_users () const
 
void iter (FunctionRef< void(ID *old_id, ID *new_id)> func) const
 
void print () const
 

Static Public Member Functions

static const StringRefNull result_to_string (const IDRemapperApplyResult result)
 

Public Attributes

bool allow_idtype_mismatch = false
 

Detailed Description

Definition at line 268 of file BKE_lib_remap.hh.

Member Function Documentation

◆ add()

◆ add_overwrite()

void blender::bke::id::IDRemapper::add_overwrite ( ID * old_id,
ID * new_id )

◆ apply()

IDRemapperApplyResult blender::bke::id::IDRemapper::apply ( ID ** r_id_ptr,
IDRemapperApplyOptions options,
ID * id_self = nullptr ) const

◆ clear()

◆ contains_mappings_for_any()

bool blender::bke::id::IDRemapper::contains_mappings_for_any ( IDTypeFilter filter) const
inline

◆ get_mapping_result()

◆ is_empty()

◆ iter()

void blender::bke::id::IDRemapper::iter ( FunctionRef< void(ID *old_id, ID *new_id)> func) const
inline

◆ never_null_users()

const Set< ID * > & blender::bke::id::IDRemapper::never_null_users ( ) const
inline

◆ never_null_users_add()

void blender::bke::id::IDRemapper::never_null_users_add ( ID * id)
inline

◆ print()

void blender::bke::id::IDRemapper::print ( ) const

Print out the rules inside the given id_remapper. Can be used for debugging purposes.

Definition at line 112 of file lib_id_remapper.cc.

References iter(), ID::name, and printf.

◆ result_to_string()

const StringRefNull blender::bke::id::IDRemapper::result_to_string ( const IDRemapperApplyResult result)
static

Return a readable string for the given result. Can be used for debugging purposes.

Definition at line 96 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, and ID_REMAP_RESULT_SOURCE_UNAVAILABLE.

Referenced by foreach_libblock_remap_callback().

Member Data Documentation

◆ allow_idtype_mismatch

bool blender::bke::id::IDRemapper::allow_idtype_mismatch = false

In almost all cases, the original pointer and its new replacement should be of the same type. however, there are some rare exceptions, e.g. when converting from one ID type to another.

Definition at line 283 of file BKE_lib_remap.hh.

Referenced by add(), add_overwrite(), and blender::bke::greasepencil::convert::legacy_main().


The documentation for this class was generated from the following files: