Blender  V2.93
Classes | Typedefs | Enumerations | Functions | Variables
BKE_idtype.h File Reference
#include "BLI_sys_types.h"

Go to the source code of this file.

Classes

struct  IDCacheKey
 
struct  IDTypeInfo
 

Typedefs

typedef struct IDCacheKey IDCacheKey
 
typedef void(* IDTypeInitDataFunction) (struct ID *id)
 
typedef void(* IDTypeCopyDataFunction) (struct Main *bmain, struct ID *id_dst, const struct ID *id_src, const int flag)
 
typedef void(* IDTypeFreeDataFunction) (struct ID *id)
 
typedef void(* IDTypeMakeLocalFunction) (struct Main *bmain, struct ID *id, const int flags)
 
typedef void(* IDTypeForeachIDFunction) (struct ID *id, struct LibraryForeachIDData *data)
 
typedef enum eIDTypeInfoCacheCallbackFlags eIDTypeInfoCacheCallbackFlags
 
typedef void(* IDTypeForeachCacheFunctionCallback) (struct ID *id, const struct IDCacheKey *cache_key, void **cache_p, uint flags, void *user_data)
 
typedef void(* IDTypeForeachCacheFunction) (struct ID *id, IDTypeForeachCacheFunctionCallback function_callback, void *user_data)
 
typedef struct ID *(* IDTypeEmbeddedOwnerGetFunction) (struct Main *bmain, struct ID *id)
 
typedef void(* IDTypeBlendWriteFunction) (struct BlendWriter *writer, struct ID *id, const void *id_address)
 
typedef void(* IDTypeBlendReadDataFunction) (struct BlendDataReader *reader, struct ID *id)
 
typedef void(* IDTypeBlendReadLibFunction) (struct BlendLibReader *reader, struct ID *id)
 
typedef void(* IDTypeBlendReadExpandFunction) (struct BlendExpander *expander, struct ID *id)
 
typedef void(* IDTypeBlendReadUndoPreserve) (struct BlendLibReader *reader, struct ID *id_new, struct ID *id_old)
 
typedef void(* IDTypeLibOverrideApplyPost) (struct ID *id_dst, struct ID *id_src)
 
typedef struct IDTypeInfo IDTypeInfo
 

Enumerations

enum  { IDTYPE_FLAGS_NO_COPY = 1 << 0 , IDTYPE_FLAGS_NO_LIBLINKING = 1 << 1 , IDTYPE_FLAGS_NO_MAKELOCAL = 1 << 2 , IDTYPE_FLAGS_NO_ANIMDATA = 1 << 3 }
 
enum  eIDTypeInfoCacheCallbackFlags { IDTYPE_CACHE_CB_FLAGS_PERSISTENT = 1 << 0 }
 

Functions

uint BKE_idtype_cache_key_hash (const void *key_v)
 
bool BKE_idtype_cache_key_cmp (const void *key_a_v, const void *key_b_v)
 
void BKE_idtype_init (void)
 
const struct IDTypeInfoBKE_idtype_get_info_from_idcode (const short id_code)
 
const struct IDTypeInfoBKE_idtype_get_info_from_id (const struct ID *id)
 
const char * BKE_idtype_idcode_to_name (const short idcode)
 
const char * BKE_idtype_idcode_to_name_plural (const short idcode)
 
const char * BKE_idtype_idcode_to_translation_context (const short idcode)
 
bool BKE_idtype_idcode_is_linkable (const short idcode)
 
bool BKE_idtype_idcode_is_valid (const short idcode)
 
short BKE_idtype_idcode_from_name (const char *idtype_name)
 
uint64_t BKE_idtype_idcode_to_idfilter (const short idcode)
 
short BKE_idtype_idcode_from_idfilter (const uint64_t idfilter)
 
int BKE_idtype_idcode_to_index (const short idcode)
 
short BKE_idtype_idcode_from_index (const int index)
 
short BKE_idtype_idcode_iter_step (int *index)
 
void BKE_idtype_id_foreach_cache (struct ID *id, IDTypeForeachCacheFunctionCallback function_callback, void *user_data)
 

Variables

IDTypeInfo IDType_ID_SCE
 
IDTypeInfo IDType_ID_LI
 
IDTypeInfo IDType_ID_OB
 
IDTypeInfo IDType_ID_ME
 
IDTypeInfo IDType_ID_CU
 
IDTypeInfo IDType_ID_MB
 
IDTypeInfo IDType_ID_MA
 
IDTypeInfo IDType_ID_TE
 
IDTypeInfo IDType_ID_IM
 
IDTypeInfo IDType_ID_LT
 
IDTypeInfo IDType_ID_LA
 
IDTypeInfo IDType_ID_CA
 
IDTypeInfo IDType_ID_IP
 
IDTypeInfo IDType_ID_KE
 
IDTypeInfo IDType_ID_WO
 
IDTypeInfo IDType_ID_SCR
 
IDTypeInfo IDType_ID_VF
 
IDTypeInfo IDType_ID_TXT
 
IDTypeInfo IDType_ID_SPK
 
IDTypeInfo IDType_ID_SO
 
IDTypeInfo IDType_ID_GR
 
IDTypeInfo IDType_ID_AR
 
IDTypeInfo IDType_ID_AC
 
IDTypeInfo IDType_ID_NT
 
IDTypeInfo IDType_ID_BR
 
IDTypeInfo IDType_ID_PA
 
IDTypeInfo IDType_ID_GD
 
IDTypeInfo IDType_ID_WM
 
IDTypeInfo IDType_ID_MC
 
IDTypeInfo IDType_ID_MSK
 
IDTypeInfo IDType_ID_LS
 
IDTypeInfo IDType_ID_PAL
 
IDTypeInfo IDType_ID_PC
 
IDTypeInfo IDType_ID_CF
 
IDTypeInfo IDType_ID_WS
 
IDTypeInfo IDType_ID_LP
 
IDTypeInfo IDType_ID_HA
 
IDTypeInfo IDType_ID_PT
 
IDTypeInfo IDType_ID_VO
 
IDTypeInfo IDType_ID_SIM
 
IDTypeInfo IDType_ID_LINK_PLACEHOLDER
 

Detailed Description

ID type structure, helping to factorize common operations and data for all data-block types.

Definition in file BKE_idtype.h.

Typedef Documentation

◆ eIDTypeInfoCacheCallbackFlags

◆ IDCacheKey

typedef struct IDCacheKey IDCacheKey

◆ IDTypeBlendReadDataFunction

typedef void(* IDTypeBlendReadDataFunction) (struct BlendDataReader *reader, struct ID *id)

Definition at line 103 of file BKE_idtype.h.

◆ IDTypeBlendReadExpandFunction

typedef void(* IDTypeBlendReadExpandFunction) (struct BlendExpander *expander, struct ID *id)

Definition at line 105 of file BKE_idtype.h.

◆ IDTypeBlendReadLibFunction

typedef void(* IDTypeBlendReadLibFunction) (struct BlendLibReader *reader, struct ID *id)

Definition at line 104 of file BKE_idtype.h.

◆ IDTypeBlendReadUndoPreserve

typedef void(* IDTypeBlendReadUndoPreserve) (struct BlendLibReader *reader, struct ID *id_new, struct ID *id_old)

Definition at line 107 of file BKE_idtype.h.

◆ IDTypeBlendWriteFunction

typedef void(* IDTypeBlendWriteFunction) (struct BlendWriter *writer, struct ID *id, const void *id_address)

Definition at line 100 of file BKE_idtype.h.

◆ IDTypeCopyDataFunction

typedef void(* IDTypeCopyDataFunction) (struct Main *bmain, struct ID *id_dst, const struct ID *id_src, const int flag)
Parameters
flagCopying options (see BKE_lib_id.h's LIB_ID_COPY_... flags for more).

Definition at line 72 of file BKE_idtype.h.

◆ IDTypeEmbeddedOwnerGetFunction

typedef struct ID*(* IDTypeEmbeddedOwnerGetFunction) (struct Main *bmain, struct ID *id)

Definition at line 94 of file BKE_idtype.h.

◆ IDTypeForeachCacheFunction

typedef void(* IDTypeForeachCacheFunction) (struct ID *id, IDTypeForeachCacheFunctionCallback function_callback, void *user_data)

Definition at line 94 of file BKE_idtype.h.

◆ IDTypeForeachCacheFunctionCallback

typedef void(* IDTypeForeachCacheFunctionCallback) (struct ID *id, const struct IDCacheKey *cache_key, void **cache_p, uint flags, void *user_data)

Definition at line 89 of file BKE_idtype.h.

◆ IDTypeForeachIDFunction

typedef void(* IDTypeForeachIDFunction) (struct ID *id, struct LibraryForeachIDData *data)

Definition at line 82 of file BKE_idtype.h.

◆ IDTypeFreeDataFunction

typedef void(* IDTypeFreeDataFunction) (struct ID *id)

Definition at line 77 of file BKE_idtype.h.

◆ IDTypeInfo

typedef struct IDTypeInfo IDTypeInfo

◆ IDTypeInitDataFunction

typedef void(* IDTypeInitDataFunction) (struct ID *id)

Definition at line 69 of file BKE_idtype.h.

◆ IDTypeLibOverrideApplyPost

typedef void(* IDTypeLibOverrideApplyPost) (struct ID *id_dst, struct ID *id_src)

Definition at line 111 of file BKE_idtype.h.

◆ IDTypeMakeLocalFunction

typedef void(* IDTypeMakeLocalFunction) (struct Main *bmain, struct ID *id, const int flags)
Parameters
flagSee BKE_lib_id.h's LIB_ID_MAKELOCAL_... flags.

Definition at line 80 of file BKE_idtype.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

IDTypeInfo.flags.

Enumerator
IDTYPE_FLAGS_NO_COPY 

Indicates that the given IDType does not support copying.

IDTYPE_FLAGS_NO_LIBLINKING 

Indicates that the given IDType does not support linking/appending from a library file.

IDTYPE_FLAGS_NO_MAKELOCAL 

Indicates that the given IDType does not support making a library-linked ID local.

IDTYPE_FLAGS_NO_ANIMDATA 

Indicates that the given IDType does not have animation data.

Definition at line 43 of file BKE_idtype.h.

◆ eIDTypeInfoCacheCallbackFlags

Enumerator
IDTYPE_CACHE_CB_FLAGS_PERSISTENT 

Indicates to the callback that that cache may be stored in the .blend file, so its pointer should not be cleared at read-time.

Definition at line 84 of file BKE_idtype.h.

Function Documentation

◆ BKE_idtype_cache_key_cmp()

bool BKE_idtype_cache_key_cmp ( const void *  key_a_v,
const void *  key_b_v 
)

◆ BKE_idtype_cache_key_hash()

uint BKE_idtype_cache_key_hash ( const void *  key_v)

◆ BKE_idtype_get_info_from_id()

const struct IDTypeInfo* BKE_idtype_get_info_from_id ( const struct ID id)

◆ BKE_idtype_get_info_from_idcode()

const struct IDTypeInfo* BKE_idtype_get_info_from_idcode ( const short  id_code)

◆ BKE_idtype_id_foreach_cache()

void BKE_idtype_id_foreach_cache ( struct ID id,
IDTypeForeachCacheFunctionCallback  function_callback,
void *  user_data 
)

◆ BKE_idtype_idcode_from_idfilter()

short BKE_idtype_idcode_from_idfilter ( const uint64_t  idfilter)

Convert an idfilter into an idcode (e.g. FILTER_ID_OB -> ID_OB).

Definition at line 294 of file idtype.c.

References BR, CASE_IDFILTER, and LT.

◆ BKE_idtype_idcode_from_index()

short BKE_idtype_idcode_from_index ( const int  index)

◆ BKE_idtype_idcode_from_name()

short BKE_idtype_idcode_from_name ( const char *  idtype_name)

Convert an ID-type name into an idcode (ie. ID_SCE)

Parameters
idtype_nameThe ID-type's "user visible name" to convert.
Returns
The idcode for the name, or 0 if invalid.

Definition at line 208 of file idtype.c.

References BLI_assert, IDTypeInfo::id_code, idtype_get_info_from_name(), and NULL.

Referenced by groupname_to_code(), IMB_thumb_load_blend(), wm_link_append_exec(), and wm_link_append_item_poll().

◆ BKE_idtype_idcode_is_linkable()

bool BKE_idtype_idcode_is_linkable ( const short  idcode)

◆ BKE_idtype_idcode_is_valid()

bool BKE_idtype_idcode_is_valid ( const short  idcode)

Return if the ID code is a valid ID code.

Parameters
idcodeThe code to check.
Returns
Boolean, 0 when invalid.

Definition at line 221 of file idtype.c.

References BKE_idtype_get_info_from_idcode(), and NULL.

Referenced by blo_bhead_is_id_valid_type(), BLO_blendhandle_get_linkable_groups(), and link_named_part().

◆ BKE_idtype_idcode_iter_step()

short BKE_idtype_idcode_iter_step ( int *  index)

Return an ID code and steps the index forward 1.

Parameters
indexstart as 0.
Returns
the code, 0 when all codes have been returned.

Definition at line 472 of file idtype.c.

References ARRAY_SIZE, BKE_idtype_idcode_from_index(), and id_types.

Referenced by BKE_main_idmap_create(), bpy_lib_enter(), and bpy_lib_exit().

◆ BKE_idtype_idcode_to_idfilter()

uint64_t BKE_idtype_idcode_to_idfilter ( const short  idcode)

Convert an idcode into an idfilter (e.g. ID_OB -> FILTER_ID_OB).

Definition at line 242 of file idtype.c.

References BR, CASE_IDFILTER, and LT.

Referenced by BLO_library_link_copypaste(), groupname_to_filter_id(), and previews_clear_exec().

◆ BKE_idtype_idcode_to_index()

int BKE_idtype_idcode_to_index ( const short  idcode)

◆ BKE_idtype_idcode_to_name()

const char* BKE_idtype_idcode_to_name ( const short  idcode)

◆ BKE_idtype_idcode_to_name_plural()

const char* BKE_idtype_idcode_to_name_plural ( const short  idcode)

Convert an idcode into a name (plural).

Parameters
idcodeThe code to convert.
Returns
A static string representing the name of the code.

Definition at line 182 of file idtype.c.

References BKE_idtype_get_info_from_idcode(), BLI_assert, IDTypeInfo::name_plural, and NULL.

Referenced by bpy_lib_enter(), bpy_lib_exit(), idp_repr_fn_recursive(), outliner_idcode_to_plural(), outliner_orphans_purge_invoke(), pyrna_prop_repr_ex(), pyrna_struct_repr(), RNA_path_full_ID_py(), and wm_drag_name().

◆ BKE_idtype_idcode_to_translation_context()

const char* BKE_idtype_idcode_to_translation_context ( const short  idcode)

Convert an idcode into its translations' context.

Parameters
idcodeThe code to convert.
Returns
A static string representing the i18n context of the code.

Definition at line 195 of file idtype.c.

References BKE_idtype_get_info_from_idcode(), BLI_assert, BLT_I18NCONTEXT_DEFAULT, NULL, and IDTypeInfo::translation_context.

◆ BKE_idtype_init()

void BKE_idtype_init ( void  )

Definition at line 125 of file idtype.c.

References id_type_init().

Referenced by main(), BlendfileLoadingBaseTest::SetUpTestCase(), and blender::bke::tests::TEST().

Variable Documentation

◆ IDType_ID_AC

IDTypeInfo IDType_ID_AC
extern

Definition at line 290 of file action.c.

◆ IDType_ID_AR

IDTypeInfo IDType_ID_AR
extern

Definition at line 311 of file armature.c.

◆ IDType_ID_BR

IDTypeInfo IDType_ID_BR
extern

Definition at line 390 of file brush.c.

◆ IDType_ID_CA

IDTypeInfo IDType_ID_CA
extern

Definition at line 183 of file camera.c.

◆ IDType_ID_CF

IDTypeInfo IDType_ID_CF
extern

Definition at line 123 of file cachefile.c.

◆ IDType_ID_CU

IDTypeInfo IDType_ID_CU
extern

Definition at line 307 of file curve.c.

◆ IDType_ID_GD

IDTypeInfo IDType_ID_GD
extern

Definition at line 309 of file gpencil.c.

◆ IDType_ID_GR

IDTypeInfo IDType_ID_GR
extern

Definition at line 368 of file collection.c.

◆ IDType_ID_HA

IDTypeInfo IDType_ID_HA
extern

Definition at line 177 of file hair.c.

◆ IDType_ID_IM

IDTypeInfo IDType_ID_IM
extern

Definition at line 318 of file image.c.

◆ IDType_ID_IP

IDTypeInfo IDType_ID_IP
extern

Definition at line 179 of file ipo.c.

◆ IDType_ID_KE

IDTypeInfo IDType_ID_KE
extern

Definition at line 203 of file key.c.

◆ IDType_ID_LA

IDTypeInfo IDType_ID_LA
extern

Definition at line 189 of file light.c.

◆ IDType_ID_LI

IDTypeInfo IDType_ID_LI
extern

Definition at line 63 of file library.c.

◆ IDType_ID_LINK_PLACEHOLDER

IDTypeInfo IDType_ID_LINK_PLACEHOLDER
extern

Definition at line 93 of file lib_id.c.

Referenced by id_type_init().

◆ IDType_ID_LP

IDTypeInfo IDType_ID_LP
extern

Definition at line 87 of file lightprobe.c.

◆ IDType_ID_LS

IDTypeInfo IDType_ID_LS
extern

Definition at line 747 of file linestyle.c.

◆ IDType_ID_LT

IDTypeInfo IDType_ID_LT
extern

◆ IDType_ID_MA

IDTypeInfo IDType_ID_MA
extern

Definition at line 254 of file material.c.

◆ IDType_ID_MB

IDTypeInfo IDType_ID_MB
extern

Definition at line 184 of file mball.c.

◆ IDType_ID_MC

IDTypeInfo IDType_ID_MC
extern

Definition at line 342 of file movieclip.c.

◆ IDType_ID_ME

IDTypeInfo IDType_ID_ME
extern

◆ IDType_ID_MSK

IDTypeInfo IDType_ID_MSK
extern

Definition at line 250 of file mask.c.

◆ IDType_ID_NT

IDTypeInfo IDType_ID_NT
extern

Definition at line 942 of file node.cc.

◆ IDType_ID_OB

IDTypeInfo IDType_ID_OB
extern

◆ IDType_ID_PA

IDTypeInfo IDType_ID_PA
extern

Definition at line 491 of file particle.c.

◆ IDType_ID_PAL

IDTypeInfo IDType_ID_PAL
extern

Definition at line 138 of file paint.c.

◆ IDType_ID_PC

IDTypeInfo IDType_ID_PC
extern

Definition at line 204 of file paint.c.

◆ IDType_ID_PT

IDTypeInfo IDType_ID_PT
extern

Definition at line 170 of file pointcloud.cc.

◆ IDType_ID_SCE

IDTypeInfo IDType_ID_SCE
extern

Definition at line 1712 of file scene.c.

Referenced by blender::bke::tests::TEST().

◆ IDType_ID_SCR

IDTypeInfo IDType_ID_SCR
extern

Definition at line 309 of file screen.c.

◆ IDType_ID_SIM

IDTypeInfo IDType_ID_SIM
extern

Definition at line 152 of file simulation.cc.

◆ IDType_ID_SO

IDTypeInfo IDType_ID_SO
extern

Definition at line 200 of file blenkernel/intern/sound.c.

◆ IDType_ID_SPK

IDTypeInfo IDType_ID_SPK
extern

Definition at line 94 of file speaker.c.

◆ IDType_ID_TE

IDTypeInfo IDType_ID_TE
extern

Definition at line 206 of file texture.c.

◆ IDType_ID_TXT

IDTypeInfo IDType_ID_TXT
extern

Definition at line 239 of file text.c.

◆ IDType_ID_VF

IDTypeInfo IDType_ID_VF
extern

Definition at line 156 of file font.c.

◆ IDType_ID_VO

IDTypeInfo IDType_ID_VO
extern

Definition at line 632 of file volume.cc.

◆ IDType_ID_WM

IDTypeInfo IDType_ID_WM
extern

Definition at line 261 of file wm.c.

◆ IDType_ID_WO

IDTypeInfo IDType_ID_WO
extern

Definition at line 186 of file world.c.

◆ IDType_ID_WS

IDTypeInfo IDType_ID_WS
extern

Definition at line 173 of file workspace.c.