|
Blender V5.0
|
#include <optional>#include "BLI_color_types.hh"#include "BLI_function_ref.hh"#include "BLI_implicit_sharing_ptr.hh"#include "BLI_sys_types.h"Go to the source code of this file.
Classes | |
| struct | IDCacheKey |
| struct | IDTypeForeachColorFunctionCallback |
| struct | IDTypeInfo |
Macros | |
| #define | BKE_idtype_idcode_is_localizable BKE_idtype_idcode_is_linkable |
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 , IDTYPE_FLAGS_NO_MEMFILE_UNDO = 1 << 5 , IDTYPE_FLAGS_NEVER_UNUSED = 1 << 6 } |
| 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.hh.
| #define BKE_idtype_idcode_is_localizable BKE_idtype_idcode_is_linkable |
Definition at line 397 of file BKE_idtype.hh.
Referenced by template_ID().
| using IDTypeBlendReadAfterLiblinkFunction = void (*)(BlendLibReader *reader, ID *id) |
Definition at line 140 of file BKE_idtype.hh.
| using IDTypeBlendReadDataFunction = void (*)(BlendDataReader *reader, ID *id) |
Definition at line 139 of file BKE_idtype.hh.
| using IDTypeBlendReadUndoPreserve = void (*)(BlendLibReader *reader, ID *id_new, ID *id_old) |
Definition at line 142 of file BKE_idtype.hh.
| using IDTypeBlendWriteFunction = void (*)(BlendWriter *writer, ID *id, const void *id_address) |
Definition at line 138 of file BKE_idtype.hh.
| using IDTypeCopyDataFunction |
| flag | Copying options (see BKE_lib_id.hh's LIB_ID_COPY_... flags for more). |
Definition at line 93 of file BKE_idtype.hh.
| using IDTypeEmbeddedOwnerPointerGetFunction = ID **(*)(ID * id, bool debug_relationship_assert) |
Callback returning the address of the pointer to the owner ID, for embedded (and Shape-key) ones.
| debug_relationship_assert | usually the owner <-> embedded relation pointers should be fully valid, and can be asserted on. But in some cases, they are not (fully) valid, e.g when copying an ID and all of its embedded data. |
Definition at line 136 of file BKE_idtype.hh.
Definition at line 112 of file BKE_idtype.hh.
Definition at line 110 of file BKE_idtype.hh.
| using IDTypeForeachColorFunction = void (*)(ID *id, const IDTypeForeachColorFunctionCallback &cb) |
Definition at line 126 of file BKE_idtype.hh.
| using IDTypeForeachIDFunction = void (*)(ID *id, LibraryForeachIDData *data) |
Definition at line 101 of file BKE_idtype.hh.
| using IDTypeForeachPathFunction = void (*)(ID *id, BPathForeachPathData *bpath_data) |
Definition at line 116 of file BKE_idtype.hh.
| using IDTypeFreeDataFunction = void (*)(ID *id) |
Definition at line 96 of file BKE_idtype.hh.
| using IDTypeInitDataFunction = void (*)(ID *id) |
Definition at line 90 of file BKE_idtype.hh.
| using IDTypeLibOverrideApplyPost = void (*)(ID *id_dst, ID *id_src) |
Definition at line 144 of file BKE_idtype.hh.
| using IDTypeMakeLocalFunction = void (*)(Main *bmain, ID *id, int flags) |
| flags | See BKE_lib_id.hh's LIB_ID_MAKELOCAL_... flags. |
Definition at line 99 of file BKE_idtype.hh.
| 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_NO_LIBLINKING. |
| 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 DNA_ID.h. |
| IDTYPE_FLAGS_NO_ANIMDATA | Indicates that the given IDType does not have animation data. |
| IDTYPE_FLAGS_NO_MEMFILE_UNDO | Indicates that the given IDType is not handled through memfile (aka global) undo.
|
| IDTYPE_FLAGS_NEVER_UNUSED | Indicates that the given IDType is considered as unused. This is used for some 'root' ID types which typically do not have any actual user (WM. Scene...). It prevents e.g. their deletion through the 'Purge' operation.
|
Definition at line 31 of file BKE_idtype.hh.
| 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 103 of file BKE_idtype.hh.
| bool BKE_idtype_cache_key_cmp | ( | const void * | key_a_v, |
| const void * | key_b_v ) |
Definition at line 36 of file idtype.cc.
References IDCacheKey::id_session_uid, and IDCacheKey::identifier.
Referenced by blo_cache_storage_init().
| uint BKE_idtype_cache_key_hash | ( | const void * | key_v | ) |
Definition at line 28 of file idtype.cc.
References BLI_ghashutil_combine_hash(), BLI_ghashutil_uinthash(), hash, IDCacheKey::id_session_uid, and IDCacheKey::identifier.
Referenced by blo_cache_storage_init().
| const IDTypeInfo * BKE_idtype_get_info_from_id | ( | const ID * | id | ) |
Definition at line 146 of file idtype.cc.
References BKE_idtype_get_info_from_idcode(), GS, and ID::name.
Referenced by absolute_convert_foreach_path_cb(), after_liblink_id_process(), blender::bke::asset_write_in_library(), BKE_bpath_foreach_path_id(), BKE_id_copy_in_lib(), BKE_id_owner_get(), BKE_idtype_id_foreach_cache(), BKE_lib_id_clear_library_data(), BKE_lib_id_make_local(), BKE_libblock_copy_in_lib(), BKE_libblock_free_datablock(), BKE_libblock_init_empty(), BKE_library_id_can_use_filter_id(), BKE_library_id_can_use_idtype(), blo_cache_storage_init(), blo_cache_storage_old_bmain_clear(), BLO_Write_IDBuffer::BLO_Write_IDBuffer(), blender::ed::asset::clear_id(), direct_link_id(), direct_link_id_common(), gather_local_ids_to_write(), id_swap(), IMB_colormanagement_working_space_convert(), lib_link_all(), lib_query_unused_ids_tag_recurse(), library_foreach_ID_link(), blender::ed::asset::mark_id(), blender::ed::space_node::node_find_create_data_block_value(), blender::ed::outliner::outliner_id_copy_tag(), read_libblock_undo_restore(), read_undo_reuse_noundo_local_ids(), relative_convert_foreach_path_cb(), RNA_struct_override_apply(), and write_id().
| const IDTypeInfo * BKE_idtype_get_info_from_idcode | ( | short | id_code | ) |
Definition at line 141 of file idtype.cc.
References BKE_idtype_get_info_from_idtype_index(), and BKE_idtype_idcode_to_index().
Referenced by blender::bke::asset_root_path_for_save(), 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().
| const IDTypeInfo * BKE_idtype_get_info_from_idtype_index | ( | const int | idtype_index | ) |
Definition at line 127 of file idtype.cc.
References BKE_idtype_idcode_to_index(), BLI_assert_msg, IDTypeInfo::id_code, id_types, and IDTypeInfo::name.
Referenced by BKE_idtype_get_info_from_idcode(), BKE_idtype_index_to_idcode(), BKE_idtype_index_to_idfilter(), get_alloc_name(), and setup_app_data().
| void BKE_idtype_id_foreach_cache | ( | ID * | id, |
| IDTypeForeachCacheFunctionCallback | function_callback, | ||
| void * | user_data ) |
Wrapper around IDTypeInfo foreach_cache that also handles embedded IDs.
Definition at line 379 of file idtype.cc.
References BKE_idtype_get_info_from_id(), BKE_idtype_get_info_from_idcode(), IDTypeInfo::foreach_cache, GS, bNodeTree::id, Collection::id, ID_NT, ID_SCE, Scene::master_collection, ID::name, and blender::bke::node_tree_from_id().
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 216 of file idtype.cc.
References BKE_idtype_get_info_from_idcode(), BLI_assert, IDTypeInfo::flags, IDTYPE_FLAGS_APPEND_IS_REUSABLE, and IDTYPE_FLAGS_NO_LIBLINKING.
Referenced by BKE_blendfile_append(), BKE_main_library_weak_reference_add_item(), BKE_main_library_weak_reference_create(), and blendfile_append_define_actions().
| 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 185 of file idtype.cc.
References BLI_assert, IDTypeInfo::id_code, and idtype_get_info_from_name().
Referenced by groupname_to_code(), imb_thumb_load_from_blend_id(), wm_id_linked_relocate_exec(), 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 197 of file idtype.cc.
References BKE_idtype_get_info_from_idcode(), BLI_assert, IDTypeInfo::flags, and IDTYPE_FLAGS_NO_LIBLINKING.
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_common_processing(), id_lib_extern(), id_lib_indirect_weak_link(), blender::ed::outliner::id_override_library_create_hierarchy_pre_process(), lib_id_expand_local_cb(), link_named_part(), blender::ed::outliner::outliner_id_relocate_invoke(), read_file_bhead_idname_map_create(), read_library_linked_id(), wm_link_append_item_poll(), write_file_handle(), write_id_direct_linked_data_process_cb(), 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 204 of file idtype.cc.
References BKE_idtype_get_info_from_idcode(), BLI_assert, IDTypeInfo::flags, IDTYPE_FLAGS_NO_LIBLINKING, and IDTYPE_FLAGS_ONLY_APPEND.
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 192 of file idtype.cc.
References BKE_idtype_get_info_from_idcode(), and true.
Referenced by blo_bhead_is_id_valid_type(), BLO_blendhandle_get_linkable_groups(), change_ID_pointer_to_real_ID_pointer_fd(), direct_link_id_common(), direct_link_id_embedded_id(), and link_named_part().
| short BKE_idtype_idcode_iter_step | ( | int * | idtype_index | ) |
Return an ID code and steps the index forward 1.
| index | start as 0. |
Definition at line 373 of file idtype.cc.
References BKE_idtype_index_to_idcode(), 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 363 of file idtype.cc.
References BKE_idtype_idcode_to_index(), and BKE_idtype_index_to_idfilter().
Referenced by blender::bke::id::IDRemapper::add(), blender::bke::id::IDRemapper::add_overwrite(), BKE_blendfile_link_append_context_item_idtypes_from_library_add(), BKE_library_id_can_use_idtype(), blender::ed::asset::filter_matches_asset(), is_filtered_id_file_type(), and previews_clear_exec().
| int BKE_idtype_idcode_to_index | ( | short | idcode | ) |
Convert an idcode into an idtype_index (e.g. ID_OB -> INDEX_ID_OB).
Definition at line 228 of file idtype.cc.
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_idtype_get_info_from_idtype_index(), BKE_idtype_idcode_to_idfilter(), DEG_graph_id_type_tag(), DEG_id_type_any_exists(), DEG_id_type_updated(), UniqueName_Map::find_by_type(), lib_query_unused_ids_tag_id(), lib_query_unused_ids_untag_id(), read_libblock(), and blender::ed::outliner::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 164 of file idtype.cc.
References BKE_idtype_get_info_from_idcode(), BLI_assert, and IDTypeInfo::name.
Referenced by blender::ed::object::apply_objects_internal(), blender::bke::asset_edit_weak_reference_from_id(), blender::bke::asset_weak_reference_for_essentials(), blender::bke::asset_weak_reference_for_user_library(), BKE_id_new_in_lib(), BKE_id_new_name_validate(), BKE_id_new_nomain(), BKE_mesh_new_nomain(), BKE_pointcloud_new_nomain(), BLO_blendhandle_get_linkable_groups(), BPy_GeometrySet_static_from_evaluated_object(), BPy_InlineShaderNodes_static_from_light(), BPy_InlineShaderNodes_static_from_material(), BPy_InlineShaderNodes_static_from_world(), datadropper_init(), delete_key_button_exec(), blender::animrig::delete_keyframe(), filelist_readjob_list_lib_add_from_indexer_entries(), filelist_readjob_main_assets_add_items(), blender::asset_system::AssetRepresentation::library_relative_identifier(), blender::ed::object::mode_set_ex(), pydriver_error(), pyrna_struct_keyframe_delete(), read_library_linked_id(), rna_id_write_error(), blender::ed::vse::sequencer_report_duplicates(), setup_app_data(), UI_context_copy_to_selected_list(), ui_tooltip_data_from_search_item_tooltip_data(), uiTemplatePreview(), blender::ed::outliner::unused_message_gen(), wm_id_linked_relocate_exec(), 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 171 of file idtype.cc.
References BKE_idtype_get_info_from_idcode(), BLI_assert, and IDTypeInfo::name_plural.
Referenced by blender::bke::asset_weak_reference_for_essentials(), bpy_lib_enter(), bpy_lib_exit(), bpy_lib_exit_lapp_context_items_cb(), idp_repr_fn_recursive(), blender::ed::outliner::outliner_idcode_to_plural(), pyrna_prop_repr_ex(), pyrna_struct_repr(), RNA_path_full_ID_py(), blender::ed::vse::sequencer_report_duplicates(), blender::ed::outliner::unused_message_gen(), 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 178 of file idtype.cc.
References BKE_idtype_get_info_from_idcode(), BLI_assert, BLT_I18NCONTEXT_DEFAULT, and IDTypeInfo::translation_context.
| short BKE_idtype_idfilter_to_idcode | ( | uint64_t | idfilter | ) |
Convert an idfilter into an idcode (e.g. FILTER_ID_OB -> ID_OB).
Definition at line 368 of file idtype.cc.
References BKE_idtype_idfilter_to_index(), and BKE_idtype_index_to_idcode().
| int BKE_idtype_idfilter_to_index | ( | uint64_t | id_filter | ) |
Convert an id_filter into an idtype_index (e.g. FILTER_ID_OB -> INDEX_ID_OB).
Definition at line 286 of file idtype.cc.
References BR, CASE_IDINDEX, CV, and LT.
Referenced by BKE_idtype_idfilter_to_idcode().
| short BKE_idtype_index_to_idcode | ( | int | idtype_index | ) |
Convert an idtype_index into an idcode (e.g. INDEX_ID_OB -> ID_OB).
Definition at line 341 of file idtype.cc.
References BKE_idtype_get_info_from_idtype_index(), BLI_assert_unreachable, and IDTypeInfo::id_code.
Referenced by BKE_idtype_idcode_iter_step(), BKE_idtype_idfilter_to_idcode(), and blender::ed::outliner::unused_message_gen().
| uint64_t BKE_idtype_index_to_idfilter | ( | int | idtype_index | ) |
Convert an idtype_index into an idfilter (e.g. INDEX_ID_OB -> FILTER_ID_OB).
Definition at line 352 of file idtype.cc.
References BKE_idtype_get_info_from_idtype_index(), BLI_assert_unreachable, and IDTypeInfo::id_filter.
Referenced by BKE_idtype_idcode_to_idfilter().
| void BKE_idtype_init | ( | ) |
Definition at line 121 of file idtype.cc.
References id_type_init().
Referenced by blender::bke::greasepencil::tests::GreasePencilIDTestContext::GreasePencilIDTestContext(), blender::ed::greasepencil::tests::GreasePencilIDTestContext::GreasePencilIDTestContext(), blender::bke::tests::LibIDMainSortTestContext::LibIDMainSortTestContext(), main(), blender::bke::image::partial_update::ImagePartialUpdateTest::SetUp(), BlendfileLoadingBaseTest::SetUpTestCase(), blender::animrig::nla::tests::NLASlottedActionTest::SetUpTestSuite(), blender::animrig::tests::ActionFCurveMoveTest::SetUpTestSuite(), blender::animrig::tests::ActionFilterTest::SetUpTestSuite(), blender::animrig::tests::ActionIteratorsTest::SetUpTestSuite(), blender::animrig::tests::ActionLayersTest::SetUpTestSuite(), blender::animrig::tests::ActionLegacyTest::SetUpTestSuite(), blender::animrig::tests::ActionQueryTest::SetUpTestSuite(), blender::animrig::tests::AnimationEvaluationTest::SetUpTestSuite(), blender::animrig::tests::AnimDrawTest::SetUpTestSuite(), blender::animrig::tests::KeyframingTest::SetUpTestSuite(), blender::animrig::tests::PoseTest::SetUpTestSuite(), blender::asset_system::tests::AssetLibraryTestBase::SetUpTestSuite(), blender::bke::tests::ArmatureDeformTest::SetUpTestSuite(), blender::bke::tests::BMainTest::SetUpTestSuite(), blender::bke::tests::BPathTest::SetUpTestSuite(), blender::bke::tests::ImageTest::SetUpTestSuite(), blender::bke::tests::LibQueryTest::SetUpTestSuite(), blender::bke::tests::LibRemapTest::SetUpTestSuite(), blender::bke::tests::PaintBVHTest::SetUpTestSuite(), blender::bke::tests::SceneTest::SetUpTestSuite(), blender::ed::sculpt_paint::tests::MeshTests::SetUpTestSuite(), blender::ed::sculpt_paint::undo::tests::SculptUndoTest::SetUpTestSuite(), blender::editor::animation::tests::KeylistSummaryTest::SetUpTestSuite(), blender::geometry::tests::RealizeInstancesTest::SetUpTestSuite(), blender::interface::tests::CopyDriversToSelected::SetUpTestSuite(), blender::io::obj::OBJCurvesTest::SetUpTestSuite(), blender::nodes::tests::BundleTest::SetUpTestSuite(), blender::nodes::tests::NodeTest::SetUpTestSuite(), BrushTest::SetUpTestSuite(), blender::animrig::tests::ArmatureBoneCollections::TearDown(), blender::animrig::tests::ArmatureBoneCollectionsTestList::TearDown(), blender::bke::id::tests::TEST(), blender::bke::id::tests::TEST(), blender::bke::id::tests::TEST(), blender::bke::id::tests::TEST(), blender::bke::id::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), and blender::ed::animation::tests::TEST_F().
|
extern |
Definition at line 742 of file blenkernel/intern/action.cc.
Referenced by id_type_init().
|
extern |
Definition at line 503 of file blenkernel/intern/armature.cc.
|
extern |
|
extern |
Definition at line 253 of file blenkernel/intern/camera.cc.
|
extern |
Definition at line 124 of file cachefile.cc.
|
extern |
|
extern |
Definition at line 153 of file blenkernel/intern/curves.cc.
|
extern |
Definition at line 266 of file gpencil_legacy.cc.
|
extern |
Definition at line 354 of file grease_pencil.cc.
|
extern |
Definition at line 386 of file collection.cc.
|
extern |
Definition at line 472 of file source/blender/blenkernel/intern/image.cc.
|
extern |
|
extern |
Definition at line 166 of file blenkernel/intern/light.cc.
|
extern |
Definition at line 198 of file library.cc.
|
extern |
Empty shell mostly, but needed for read code.
Definition at line 88 of file lib_id.cc.
Referenced by id_type_init().
|
extern |
Definition at line 52 of file lightprobe.cc.
|
extern |
Definition at line 658 of file linestyle.cc.
|
extern |
Definition at line 163 of file lattice.cc.
|
extern |
Definition at line 246 of file blenkernel/intern/material.cc.
|
extern |
|
extern |
Definition at line 298 of file movieclip.cc.
|
extern |
Definition at line 499 of file blenkernel/intern/mesh.cc.
|
extern |
Definition at line 186 of file blenkernel/intern/mask.cc.
|
extern |
|
extern |
Definition at line 1074 of file blenkernel/intern/object.cc.
|
extern |
Definition at line 383 of file particle.cc.
|
extern |
|
extern |
|
extern |
Definition at line 168 of file pointcloud.cc.
|
extern |
Definition at line 1565 of file scene.cc.
Referenced by blender::bke::tests::TEST(), and blender::bke::tests::TEST().
|
extern |
|
extern |
Definition at line 195 of file blenkernel/intern/sound.cc.
|
extern |
Definition at line 51 of file speaker.cc.
|
extern |
Definition at line 186 of file texture.cc.
|
extern |
|
extern |
|
extern |
Definition at line 277 of file blenkernel/intern/volume.cc.
|
extern |
|
extern |
Definition at line 185 of file blenkernel/intern/world.cc.
|
extern |
Definition at line 178 of file workspace.cc.