|
Blender V4.3
|
#include <array>#include <cstring>#include "MEM_guardedalloc.h"#include "BLI_ghash.h"#include "BLI_utildefines.h"#include "CLG_log.h"#include "BLT_translation.hh"#include "DNA_ID.h"#include "DNA_collection_types.h"#include "DNA_node_types.h"#include "DNA_scene_types.h"#include "BKE_main.hh"#include "BKE_node.hh"#include "BKE_idtype.hh"Go to the source code of this file.
Macros | |
| #define | INIT_TYPE(_id_code) |
| #define | CASE_IDINDEX(_id) |
| #define | CASE_IDINDEX(_id) |
Variables | |
| static std::array< IDTypeInfo *, INDEX_ID_MAX > | id_types |
| #define CASE_IDINDEX | ( | _id | ) |
Referenced by BKE_idtype_idcode_to_index(), and BKE_idtype_idfilter_to_index().
| #define CASE_IDINDEX | ( | _id | ) |
| #define INIT_TYPE | ( | _id_code | ) |
Referenced by id_type_init().
| bool BKE_idtype_cache_key_cmp | ( | const void * | key_a_v, |
| const void * | key_b_v ) |
Definition at line 41 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 33 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 150 of file idtype.cc.
References BKE_idtype_get_info_from_idcode(), and GS.
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_init_id_buffer_from_id(), blender::ed::asset::clear_id(), direct_link_id(), direct_link_id_common(), id_buffer_init_from_id(), id_swap(), lib_link_all(), lib_query_unused_ids_tag_recurse(), library_foreach_ID_link(), blender::ed::asset::mark_id(), read_libblock_undo_restore(), read_undo_reuse_noundo_local_ids(), relative_convert_foreach_path_cb(), RNA_struct_override_apply(), and write_file_handle().
| const IDTypeInfo * BKE_idtype_get_info_from_idcode | ( | const short | id_code | ) |
Definition at line 145 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 133 of file idtype.cc.
References 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 385 of file idtype.cc.
References BKE_idtype_get_info_from_id(), BKE_idtype_get_info_from_idcode(), IDTypeInfo::foreach_cache, GS, bNodeTree::id, ID_NT, ID_SCE, 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 220 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 189 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_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 201 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(), 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 208 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 196 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(), 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 379 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 369 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 232 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_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(), 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 168 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(), blender::ed::space_node::create_inspection_string_for_generic_value(), datadropper_init(), delete_key_button_exec(), blender::animrig::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(), setup_app_data(), UI_context_copy_to_selected_list(), ui_tooltip_data_from_search_item_tooltip_data(), uiTemplatePreview(), blender::ed::outliner::unused_message_gen(), 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 175 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::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 182 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 374 of file idtype.cc.
References BKE_idtype_idfilter_to_index(), and BKE_idtype_index_to_idcode().
Convert an id_filter into an idtype_index (e.g. FILTER_ID_OB -> INDEX_ID_OB).
Definition at line 291 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 347 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().
Convert an idtype_index into an idfilter (e.g. INDEX_ID_OB -> FILTER_ID_OB).
Definition at line 358 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 127 of file idtype.cc.
References id_type_init().
Referenced by blender::bke::tests::Context< TestData >::Context(), 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::KeyframingTest::SetUpTestSuite(), blender::bke::tests::BMainTest::SetUpTestSuite(), blender::bke::tests::BPathTest::SetUpTestSuite(), blender::bke::tests::ImageTest::SetUpTestSuite(), blender::interface::tests::CopyDriversToSelected::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(), and blender::bke::tests::TEST().
|
static |
Definition at line 51 of file idtype.cc.
References BLI_assert, BLI_assert_msg, IDTypeInfo::dependencies_id_types, ID_AC, ID_AR, ID_BR, ID_CA, ID_CF, ID_CU_LEGACY, ID_CV, ID_GD_LEGACY, ID_GP, ID_GR, ID_IM, ID_IP, ID_KE, ID_LA, ID_LI, ID_LP, ID_LS, ID_LT, ID_MA, ID_MB, ID_MC, ID_ME, ID_MSK, ID_NT, ID_OB, ID_PA, ID_PAL, ID_PC, ID_PT, ID_SCE, ID_SCR, ID_SO, ID_SPK, ID_TE, ID_TXT, id_types, ID_VF, ID_VO, ID_WM, ID_WO, ID_WS, IDTYPE_FLAGS_NO_ANIMDATA, IDType_ID_AC, IDType_ID_LINK_PLACEHOLDER, INDEX_ID_MAX, INDEX_ID_NULL, INIT_TYPE, IDTypeInfo::main_listbase_index, and UNUSED_VARS_NDEBUG.
Referenced by BKE_idtype_init().
|
static |
Definition at line 155 of file idtype.cc.
References id_types, and STREQ.
Referenced by BKE_idtype_idcode_from_name().
|
static |
Definition at line 49 of file idtype.cc.
Referenced by BKE_idtype_get_info_from_idtype_index(), BKE_idtype_idcode_iter_step(), id_type_init(), and idtype_get_info_from_name().