Blender  V3.3
Classes | Namespaces | Typedefs | Functions
lib_id_remapper.cc File Reference
#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::IDRemapperunwrap (IDRemapper *remapper)
 wrap C handle to a CPP IDRemapper. More...
 
static const blender::bke::id::remapper::IDRemapperunwrap (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)
 

Typedef Documentation

◆ IDTypeFilter

Definition at line 14 of file lib_id_remapper.cc.

Function Documentation

◆ BKE_id_remapper_add()

void BKE_id_remapper_add ( struct IDRemapper *  id_remapper,
struct ID old_id,
struct ID new_id 
)

◆ BKE_id_remapper_apply()

IDRemapperApplyResult BKE_id_remapper_apply ( const IDRemapper *  id_remapper,
ID **  r_id_ptr,
const IDRemapperApplyOptions  options 
)

◆ BKE_id_remapper_apply_ex()

IDRemapperApplyResult BKE_id_remapper_apply_ex ( const IDRemapper *  id_remapper,
ID **  r_id_ptr,
const IDRemapperApplyOptions  options,
ID id_self 
)

◆ BKE_id_remapper_clear()

void BKE_id_remapper_clear ( struct IDRemapper *  id_remapper)

◆ BKE_id_remapper_create()

IDRemapper* BKE_id_remapper_create ( void  )

◆ BKE_id_remapper_free()

void BKE_id_remapper_free ( struct IDRemapper *  id_remapper)

◆ BKE_id_remapper_get_mapping_result()

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().

◆ BKE_id_remapper_has_mapping_for()

bool BKE_id_remapper_has_mapping_for ( const struct IDRemapper *  id_remapper,
uint64_t  type_filter 
)

◆ BKE_id_remapper_is_empty()

bool BKE_id_remapper_is_empty ( const struct IDRemapper *  id_remapper)

◆ BKE_id_remapper_iter()

void BKE_id_remapper_iter ( const struct IDRemapper *  id_remapper,
IDRemapperIterFunction  func,
void user_data 
)

◆ BKE_id_remapper_print()

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().

◆ BKE_id_remapper_result_string()

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().

◆ id_remapper_print_item_cb()

static void id_remapper_print_item_cb ( ID old_id,
ID new_id,
void UNUSEDuser_data 
)
static

Definition at line 224 of file lib_id_remapper.cc.

References ID::name.

Referenced by BKE_id_remapper_print().

◆ unwrap() [1/2]

static const blender::bke::id::remapper::IDRemapper* unwrap ( const IDRemapper *  remapper)
static

wrap C handle to a CPP IDRemapper.

Definition at line 123 of file lib_id_remapper.cc.

◆ unwrap() [2/2]

static blender::bke::id::remapper::IDRemapper* unwrap ( IDRemapper *  remapper)
static

◆ wrap()

static IDRemapper* wrap ( blender::bke::id::remapper::IDRemapper remapper)
static

wrap CPP IDRemapper to a C handle.

Definition at line 111 of file lib_id_remapper.cc.

Referenced by BKE_id_remapper_create().