Blender
V3.3
|
#include "BLI_sys_types.h"
Go to the source code of this file.
Classes | |
struct | IDCacheKey |
struct | IDTypeInfo |
Macros | |
#define | BKE_idtype_idcode_is_localizable BKE_idtype_idcode_is_linkable |
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, int flag) |
typedef void(* | IDTypeFreeDataFunction) (struct ID *id) |
typedef void(* | IDTypeMakeLocalFunction) (struct Main *bmain, struct ID *id, 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 void(* | IDTypeForeachPathFunction) (struct ID *id, struct BPathForeachPathData *bpath_data) |
typedef struct ID *(* | IDTypeEmbeddedOwnerGetFunction) (struct Main *bmain, struct ID *id, struct ID *owner_id_hint) |
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_ONLY_APPEND = 1 << 2 , IDTYPE_FLAGS_APPEND_IS_REUSABLE = 1 << 3 , IDTYPE_FLAGS_NO_ANIMDATA = 1 << 4 } |
enum | eIDTypeInfoCacheCallbackFlags { IDTYPE_CACHE_CB_FLAGS_PERSISTENT = 1 << 0 } |
ID type structure, helping to factorize common operations and data for all data-block types.
Definition in file BKE_idtype.h.
#define BKE_idtype_idcode_is_localizable BKE_idtype_idcode_is_linkable |
Definition at line 336 of file BKE_idtype.h.
typedef struct IDCacheKey IDCacheKey |
typedef void(* IDTypeBlendReadDataFunction) (struct BlendDataReader *reader, struct ID *id) |
Definition at line 97 of file BKE_idtype.h.
typedef void(* IDTypeBlendReadExpandFunction) (struct BlendExpander *expander, struct ID *id) |
Definition at line 99 of file BKE_idtype.h.
typedef void(* IDTypeBlendReadLibFunction) (struct BlendLibReader *reader, struct ID *id) |
Definition at line 98 of file BKE_idtype.h.
typedef void(* IDTypeBlendReadUndoPreserve) (struct BlendLibReader *reader, struct ID *id_new, struct ID *id_old) |
Definition at line 101 of file BKE_idtype.h.
typedef void(* IDTypeBlendWriteFunction) (struct BlendWriter *writer, struct ID *id, const void *id_address) |
Definition at line 94 of file BKE_idtype.h.
typedef void(* IDTypeCopyDataFunction) (struct Main *bmain, struct ID *id_dst, const struct ID *id_src, int flag) |
flag | Copying options (see BKE_lib_id.h's LIB_ID_COPY_... flags for more). |
Definition at line 60 of file BKE_idtype.h.
typedef struct ID*(* IDTypeEmbeddedOwnerGetFunction) (struct Main *bmain, struct ID *id, struct ID *owner_id_hint) |
owner_id_hint | If non-NULL, a potential owner of the given embedded ID. Can speed up look-up of the owner ID in some cases. |
Definition at line 86 of file BKE_idtype.h.
typedef void(* IDTypeForeachCacheFunction) (struct ID *id, IDTypeForeachCacheFunctionCallback function_callback, void *user_data) |
Definition at line 82 of file BKE_idtype.h.
typedef void(* IDTypeForeachCacheFunctionCallback) (struct ID *id, const struct IDCacheKey *cache_key, void **cache_p, uint flags, void *user_data) |
Definition at line 77 of file BKE_idtype.h.
typedef void(* IDTypeForeachIDFunction) (struct ID *id, struct LibraryForeachIDData *data) |
Definition at line 70 of file BKE_idtype.h.
typedef void(* IDTypeForeachPathFunction) (struct ID *id, struct BPathForeachPathData *bpath_data) |
Definition at line 86 of file BKE_idtype.h.
Definition at line 65 of file BKE_idtype.h.
typedef struct IDTypeInfo IDTypeInfo |
Definition at line 57 of file BKE_idtype.h.
Definition at line 105 of file BKE_idtype.h.
flags | See BKE_lib_id.h's LIB_ID_MAKELOCAL_... flags. |
Definition at line 68 of file BKE_idtype.h.
anonymous enum |
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_ONLY_APPEND | Indicates that the given IDType should not be directly linked from a library file, but may be appended. NOTE: Mutually exclusive with |
IDTYPE_FLAGS_APPEND_IS_REUSABLE | Allow to re-use an existing local ID with matching weak library reference instead of creating a new copy of it, when appending. See also LibraryWeakReference in |
IDTYPE_FLAGS_NO_ANIMDATA | Indicates that the given IDType does not have animation data. |
Definition at line 28 of file BKE_idtype.h.
Enumerator | |
---|---|
IDTYPE_CACHE_CB_FLAGS_PERSISTENT | Indicates to the callback that cache may be stored in the .blend file, so its pointer should not be cleared at read-time. |
Definition at line 72 of file BKE_idtype.h.
Definition at line 39 of file idtype.c.
References IDCacheKey::id_session_uuid, and IDCacheKey::offset_in_ID.
Referenced by blo_cache_storage_init().
Definition at line 31 of file idtype.c.
References BLI_ghashutil_combine_hash(), BLI_ghashutil_uinthash(), hash, IDCacheKey::id_session_uuid, and IDCacheKey::offset_in_ID.
Referenced by blo_cache_storage_init().
const struct IDTypeInfo* BKE_idtype_get_info_from_id | ( | const struct ID * | id | ) |
Referenced by BKE_bpath_foreach_path_id(), BKE_id_copy_ex(), BKE_lib_id_make_local(), BKE_lib_override_library_get(), BKE_libblock_free_datablock(), BKE_libblock_init_empty(), blo_cache_storage_init(), blo_cache_storage_old_bmain_clear(), BLO_expand_main(), collection_duplicate_exec(), direct_link_id(), direct_link_id_common(), ED_asset_mark_id(), id_swap(), lib_link_all(), lib_override_library_main_resync_root_get(), lib_query_unused_ids_tag_recurse(), library_foreach_ID_link(), outliner_collection_delete(), RNA_find_real_ID_and_path(), RNA_struct_override_apply(), and write_file_handle().
const struct IDTypeInfo* BKE_idtype_get_info_from_idcode | ( | short | id_code | ) |
Definition at line 112 of file idtype.c.
References ARRAY_SIZE, BKE_idtype_idcode_to_index(), id_types, and NULL.
Referenced by BKE_idtype_get_info_from_id(), BKE_idtype_id_foreach_cache(), BKE_idtype_idcode_append_is_reusable(), BKE_idtype_idcode_is_linkable(), BKE_idtype_idcode_is_only_appendable(), BKE_idtype_idcode_is_valid(), BKE_idtype_idcode_to_name(), BKE_idtype_idcode_to_name_plural(), BKE_idtype_idcode_to_translation_context(), BKE_libblock_get_alloc_info(), and id_type_can_have_animdata().
void BKE_idtype_id_foreach_cache | ( | struct ID * | id, |
IDTypeForeachCacheFunctionCallback | function_callback, | ||
void * | user_data | ||
) |
Wrapper around IDTypeInfo foreach_cache that also handles embedded IDs.
Definition at line 447 of file idtype.c.
References BKE_idtype_get_info_from_id(), BKE_idtype_get_info_from_idcode(), IDTypeInfo::foreach_cache, GS, id, Collection::id, bNodeTree::id, ID_NT, ID_SCE, Scene::master_collection, ID::name, ntreeFromID(), NULL, scene, and user_data.
Referenced by blo_cache_storage_init(), blo_cache_storage_old_bmain_clear(), and direct_link_id().
bool BKE_idtype_idcode_append_is_reusable | ( | short | idcode | ) |
Check if an ID type can try to reuse and existing matching local one when being appended again.
idcode | The IDType code to check. |
Definition at line 194 of file idtype.c.
References BKE_idtype_get_info_from_idcode(), BLI_assert, IDTypeInfo::flags, IDTYPE_FLAGS_APPEND_IS_REUSABLE, IDTYPE_FLAGS_NO_LIBLINKING, and NULL.
Referenced by BKE_blendfile_append(), BKE_main_library_weak_reference_add_item(), and BKE_main_library_weak_reference_create().
short BKE_idtype_idcode_from_idfilter | ( | uint64_t | idfilter | ) |
Convert an idfilter into an idcode (e.g. FILTER_ID_OB -> ID_OB).
Definition at line 266 of file idtype.c.
References BLI_assert_unreachable, BR, CASE_IDFILTER, CASE_IDFILTER_NONE, CV, and LT.
short BKE_idtype_idcode_from_index | ( | int | index | ) |
Get an idcode from an index (e.g. INDEX_ID_OB -> ID_OB).
Definition at line 383 of file idtype.c.
References BR, CASE_IDCODE, CV, ID_LINK_PLACEHOLDER, INDEX_ID_NULL, and LT.
Referenced by BKE_idtype_idcode_iter_step(), and outliner_orphans_purge_invoke().
short BKE_idtype_idcode_from_name | ( | const char * | idtype_name | ) |
Convert an ID-type name into an idcode (ie. ID_SCE)
idtype_name | The ID-type's "user visible name" to convert. |
Definition at line 163 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_from_blend_id(), wm_link_append_exec(), and wm_link_append_item_poll().
bool BKE_idtype_idcode_is_linkable | ( | short | idcode | ) |
Check if an ID type is linkable.
idcode | The IDType code to check. |
Definition at line 175 of file idtype.c.
References BKE_idtype_get_info_from_idcode(), BLI_assert, IDTypeInfo::flags, IDTYPE_FLAGS_NO_LIBLINKING, and NULL.
Referenced by BKE_blendfile_library_relocate(), BKE_blendfile_link_append_context_item_idtypes_from_library_add(), BKE_id_can_be_asset(), BKE_lib_override_library_create_from_tag(), BKE_library_make_local(), BKE_main_library_weak_reference_create(), BLO_blendhandle_get_linkable_groups(), bpy_lib_enter(), bpy_lib_exit(), foreach_libblock_link_append_callback(), id_lib_extern(), id_lib_indirect_weak_link(), id_override_library_create_hierarchy_pre_process_fn(), lib_id_expand_local_cb(), link_named_part(), read_file_bhead_idname_map_create(), read_library_linked_id(), wm_link_append_item_poll(), and write_libraries().
bool BKE_idtype_idcode_is_only_appendable | ( | short | idcode | ) |
Check if an ID type is only appendable.
idcode | The IDType code to check. |
Definition at line 182 of file idtype.c.
References BKE_idtype_get_info_from_idcode(), BLI_assert, IDTypeInfo::flags, IDTYPE_FLAGS_NO_LIBLINKING, IDTYPE_FLAGS_ONLY_APPEND, and NULL.
Referenced by wm_link_append_item_poll().
bool BKE_idtype_idcode_is_valid | ( | short | idcode | ) |
Return if the ID code is a valid ID code.
idcode | The code to check. |
Definition at line 170 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().
short BKE_idtype_idcode_iter_step | ( | int * | index | ) |
Return an ID code and steps the index forward 1.
index | start as 0. |
Definition at line 442 of file idtype.c.
References ARRAY_SIZE, BKE_idtype_idcode_from_index(), and id_types.
Referenced by BKE_blendfile_link_append_context_item_idtypes_from_library_add(), BKE_main_idmap_create(), bpy_lib_enter(), bpy_lib_exit(), and main_namemap_validate_and_fix().
uint64_t BKE_idtype_idcode_to_idfilter | ( | short | idcode | ) |
Convert an idcode into an idfilter (e.g. ID_OB -> FILTER_ID_OB).
Definition at line 206 of file idtype.c.
References BLI_assert_unreachable, BR, CASE_IDFILTER, CASE_IDFILTER_NONE, CV, and LT.
Referenced by blender::bke::id::remapper::IDRemapper::add(), BKE_blendfile_link_append_context_item_idtypes_from_library_add(), BKE_library_id_can_use_idtype(), ED_asset_filter_matches_asset(), groupname_to_filter_id(), and previews_clear_exec().
int BKE_idtype_idcode_to_index | ( | short | idcode | ) |
Convert an idcode into an index (e.g. ID_OB -> INDEX_ID_OB).
Definition at line 324 of file idtype.c.
References BR, CASE_IDINDEX, CV, ID_LINK_PLACEHOLDER, INDEX_ID_NULL, and LT.
Referenced by blender::deg::Depsgraph::add_id_node(), BKE_idtype_get_info_from_idcode(), BKE_lib_query_unused_ids_tag(), DEG_graph_id_type_tag(), DEG_id_type_any_exists(), DEG_id_type_updated(), UniqueName_Map::find_by_type(), lib_query_unused_ids_tag_recurse(), and tree_element_id_type_to_index().
const char* BKE_idtype_idcode_to_name | ( | short | idcode | ) |
Convert an idcode into a name.
idcode | The code to convert. |
Definition at line 142 of file idtype.c.
References BKE_idtype_get_info_from_idcode(), BLI_assert, IDTypeInfo::name, and NULL.
Referenced by apply_objects_internal(), BKE_id_new(), BKE_id_new_name_validate(), BKE_id_new_nomain(), BKE_mesh_new_nomain(), BKE_pointcloud_new_nomain(), BLO_blendhandle_get_linkable_groups(), clear_keyframe(), blender::ed::space_node::create_inspection_string_for_generic_value(), datadropper_init(), delete_key_button_exec(), delete_keyframe(), filelist_readjob_list_lib_add_from_indexer_entries(), filelist_readjob_main_assets_add_items(), pydriver_error(), pyrna_struct_keyframe_delete(), read_library_linked_id(), rna_id_write_error(), uiTemplatePreview(), and WM_operator_drop_load_path().
const char* BKE_idtype_idcode_to_name_plural | ( | short | idcode | ) |
Convert an idcode into a name (plural).
idcode | The code to convert. |
Definition at line 149 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(), bpy_lib_exit_lapp_context_items_cb(), 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_get_item_name().
const char* BKE_idtype_idcode_to_translation_context | ( | short | idcode | ) |
Convert an idcode into its translations' context.
idcode | The code to convert. |
Definition at line 156 of file idtype.c.
References BKE_idtype_get_info_from_idcode(), BLI_assert, BLT_I18NCONTEXT_DEFAULT, NULL, and IDTypeInfo::translation_context.
Definition at line 106 of file idtype.c.
References id_type_init().
Referenced by blender::bke::tests::Context< TestData >::Context(), blender::bke::tests::LibIDMainSortTestContext::LibIDMainSortTestContext(), main(), blender::bke::image::partial_update::ImagePartialUpdateTest::SetUp(), BlendfileLoadingBaseTest::SetUpTestCase(), blender::bke::tests::BPathTest::SetUpTestSuite(), and blender::bke::tests::TEST().
|
extern |
|
extern |
Definition at line 298 of file armature.c.
|
extern |
|
extern |
|
extern |
Definition at line 131 of file cachefile.c.
|
extern |
|
extern |
|
extern |
|
extern |
Definition at line 360 of file collection.c.
|
extern |
Definition at line 457 of file source/blender/blenkernel/intern/image.cc.
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
Empty shell mostly, but needed for read code.
Definition at line 77 of file lib_id.c.
Referenced by id_type_init().
|
extern |
Definition at line 70 of file lightprobe.c.
|
extern |
Definition at line 733 of file linestyle.c.
|
extern |
Definition at line 175 of file lattice.c.
Referenced by blender::bke::tests::test_lattice_deform_free(), and blender::bke::tests::test_lattice_deform_init().
|
extern |
Definition at line 240 of file material.c.
|
extern |
|
extern |
Definition at line 328 of file movieclip.c.
|
extern |
Definition at line 364 of file mesh.cc.
Referenced by blender::bke::tests::test_lattice_deform_free(), and blender::bke::tests::test_lattice_deform_init().
|
extern |
|
extern |
|
extern |
Definition at line 1222 of file object.cc.
Referenced by blender::bke::tests::test_lattice_deform_free(), and blender::bke::tests::test_lattice_deform_init().
|
extern |
Definition at line 479 of file particle.c.
|
extern |
|
extern |
|
extern |
Definition at line 160 of file pointcloud.cc.
|
extern |
Definition at line 1693 of file scene.cc.
Referenced by blender::bke::tests::TEST().
|
extern |
|
extern |
Definition at line 134 of file simulation.cc.
|
extern |
Definition at line 195 of file blenkernel/intern/sound.c.
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
Definition at line 178 of file workspace.c.