Blender V5.3
blender::IDTypeInfo Struct Reference

#include <BKE_idtype.hh>

Static Public Member Functions

template<class T>
static constexpr T InvalidPointer ()

Public Attributes

short id_code = ID_LINK_PLACEHOLDER
uint64_t id_filter = 0
uint64_t dependencies_id_types = 0
int main_listbase_index = INDEX_ID_MAX
size_t struct_size = 0
const char * name = nullptr
const char * name_plural = nullptr
const char * translation_context = nullptr
uint32_t flags = 0
AssetTypeInfo * asset_type_info = InvalidPointer<AssetTypeInfo *>()
IDTypeInitDataFunction init_data = InvalidPointer<IDTypeInitDataFunction>()
IDTypeCopyDataFunction copy_data = InvalidPointer<IDTypeCopyDataFunction>()
IDTypeFreeDataFunction free_data = InvalidPointer<IDTypeFreeDataFunction>()
IDTypeMakeLocalFunction make_local = InvalidPointer<IDTypeMakeLocalFunction>()
IDTypeForeachIDFunction foreach_id = InvalidPointer<IDTypeForeachIDFunction>()
IDTypeForeachCacheFunction foreach_cache = InvalidPointer<IDTypeForeachCacheFunction>()
IDTypeForeachPathFunction foreach_path = InvalidPointer<IDTypeForeachPathFunction>()
IDTypeForeachColorFunction foreach_working_space_color
IDTypeForeachAssetWeakReferenceFunction foreach_asset_weak_reference
IDTypeEmbeddedOwnerPointerGetFunction owner_pointer_get
IDTypeBlendWriteFunction blend_write = InvalidPointer<IDTypeBlendWriteFunction>()
IDTypeBlendReadDataFunction blend_read_data = InvalidPointer<IDTypeBlendReadDataFunction>()
IDTypeBlendReadAfterLiblinkFunction blend_read_after_liblink
IDTypeBlendReadUndoPreserve blend_read_undo_preserve
IDTypeLibOverrideApplyPost lib_override_apply_post

Detailed Description

Definition at line 149 of file BKE_idtype.hh.

Member Function Documentation

◆ InvalidPointer()

template<class T>
constexpr T blender::IDTypeInfo::InvalidPointer ( )
inlinestaticconstexpr

Utils to define invalid pointers for all data & callbacks below.

Definition at line 198 of file BKE_idtype.hh.

References T, and UINTPTR_MAX.

Referenced by blender::id_type_is_valid().

Member Data Documentation

◆ asset_type_info

AssetTypeInfo* blender::IDTypeInfo::asset_type_info = InvalidPointer<AssetTypeInfo *>()

Information and callbacks for assets, based on the type of asset.

Definition at line 206 of file BKE_idtype.hh.

Referenced by blender::BKE_lib_id_clear_library_data(), blender::ed::asset::clear_id(), blender::direct_link_id_common(), blender::id_type_is_valid(), and blender::ed::asset::mark_id().

◆ blend_read_after_liblink

IDTypeBlendReadAfterLiblinkFunction blender::IDTypeInfo::blend_read_after_liblink
Initial value:

Used to do some validation and/or complex processing on the ID after it has been fully read and its ID pointers have been updated to valid values (lib linking process).

Note that this is still called before the do_versions_after_linking versioning code.

Definition at line 285 of file BKE_idtype.hh.

Referenced by blender::after_liblink_id_process(), and blender::id_type_is_valid().

◆ blend_read_data

IDTypeBlendReadDataFunction blender::IDTypeInfo::blend_read_data = InvalidPointer<IDTypeBlendReadDataFunction>()

Update pointers for all structs directly owned by this data block.

Definition at line 277 of file BKE_idtype.hh.

Referenced by blender::direct_link_id(), and blender::id_type_is_valid().

◆ blend_read_undo_preserve

IDTypeBlendReadUndoPreserve blender::IDTypeInfo::blend_read_undo_preserve
Initial value:

Allow an ID type to preserve some of its data across (memfile) undo steps.

Note
Called from #setup_app_data when undoing or redoing a memfile step.
In case the whole ID should be fully preserved across undo steps, it is better to flag its type with IDTYPE_FLAGS_NO_MEMFILE_UNDO, since that flag allows more aggressive optimizations in readfile code for memfile undo.

Definition at line 297 of file BKE_idtype.hh.

Referenced by blender::id_type_is_valid(), and blender::lib_link_all().

◆ blend_write

IDTypeBlendWriteFunction blender::IDTypeInfo::blend_write = InvalidPointer<IDTypeBlendWriteFunction>()

Write all structs that should be saved in a .blend file.

Definition at line 272 of file BKE_idtype.hh.

Referenced by blender::id_type_is_valid(), and blender::write_id().

◆ copy_data

IDTypeCopyDataFunction blender::IDTypeInfo::copy_data = InvalidPointer<IDTypeCopyDataFunction>()

Copy the given data-block's data from source to destination. May be NULL if mere memory-copy of the ID struct itself is enough.

Definition at line 219 of file BKE_idtype.hh.

Referenced by blender::BKE_id_copy_in_lib(), and blender::id_type_is_valid().

◆ dependencies_id_types

uint64_t blender::IDTypeInfo::dependencies_id_types = 0

Known types of ID dependencies.

Used by BKE_library_id_can_use_filter_id, together with additional runtime heuristics, to generate a filter value containing only ID types that given ID could be using.

Definition at line 169 of file BKE_idtype.hh.

Referenced by blender::BKE_library_id_can_use_filter_id(), and blender::id_type_init().

◆ flags

◆ foreach_asset_weak_reference

IDTypeForeachAssetWeakReferenceFunction blender::IDTypeInfo::foreach_asset_weak_reference
Initial value:

Iterator to edit all asset weak references of given ID.

Definition at line 258 of file BKE_idtype.hh.

Referenced by blender::BKE_asset_weak_reference_foreach_main(), and blender::id_type_is_valid().

◆ foreach_cache

◆ foreach_id

IDTypeForeachIDFunction blender::IDTypeInfo::foreach_id = InvalidPointer<IDTypeForeachIDFunction>()

Called by BKE_library_foreach_ID_link() to apply a callback over all other ID usages (ID pointers) of given data-block.

Definition at line 236 of file BKE_idtype.hh.

Referenced by blender::id_type_is_valid(), and blender::library_foreach_ID_link().

◆ foreach_path

IDTypeForeachPathFunction blender::IDTypeInfo::foreach_path = InvalidPointer<IDTypeForeachPathFunction>()

Iterator over all file paths of given ID.

Definition at line 246 of file BKE_idtype.hh.

Referenced by blender::BKE_bpath_foreach_path_id(), and blender::id_type_is_valid().

◆ foreach_working_space_color

IDTypeForeachColorFunction blender::IDTypeInfo::foreach_working_space_color
Initial value:

Iterator to edit all scene linear RGB colors of given ID. Alpha should not be premultiplied in the RGB values.

Definition at line 252 of file BKE_idtype.hh.

Referenced by blender::id_type_is_valid(), and blender::IMB_colormanagement_working_space_convert().

◆ free_data

IDTypeFreeDataFunction blender::IDTypeInfo::free_data = InvalidPointer<IDTypeFreeDataFunction>()

Free the data of the data-block (NOT the ID itself). May be NULL if there is nothing to do.

Definition at line 224 of file BKE_idtype.hh.

Referenced by blender::BKE_libblock_free_datablock(), and blender::id_type_is_valid().

◆ id_code

◆ id_filter

uint64_t blender::IDTypeInfo::id_filter = 0

Bit-flag matching id_code, used for filtering (e.g. in file browser), see DNA_ID.h's FILTER_ID_XX enums.

Definition at line 161 of file BKE_idtype.hh.

Referenced by blender::BKE_idtype_index_to_idfilter(), and blender::id_type_is_valid().

◆ init_data

IDTypeInitDataFunction blender::IDTypeInfo::init_data = InvalidPointer<IDTypeInitDataFunction>()

Initialize a new, empty calloc'ed data-block. May be NULL if there is nothing to do.

Definition at line 213 of file BKE_idtype.hh.

Referenced by blender::BKE_libblock_init_empty(), and blender::id_type_is_valid().

◆ lib_override_apply_post

IDTypeLibOverrideApplyPost blender::IDTypeInfo::lib_override_apply_post
Initial value:

Called after library override operations have been applied.

Note
Currently needed for some update operation on point caches.

Definition at line 305 of file BKE_idtype.hh.

Referenced by blender::id_type_is_valid(), and blender::RNA_struct_override_apply().

◆ main_listbase_index

int blender::IDTypeInfo::main_listbase_index = INDEX_ID_MAX

Define the position of this data-block type in the virtual list of all data in a Main that is returned by BKE_main_lists_get(). Very important, this has to be unique and below INDEX_ID_MAX, see DNA_ID.h.

Definition at line 176 of file BKE_idtype.hh.

Referenced by blender::id_type_init(), and blender::id_type_is_valid().

◆ make_local

IDTypeMakeLocalFunction blender::IDTypeInfo::make_local = InvalidPointer<IDTypeMakeLocalFunction>()

Make a linked data-block local. May be NULL if default behavior from BKE_lib_id_make_local_generic() is enough.

Definition at line 230 of file BKE_idtype.hh.

Referenced by blender::BKE_lib_id_make_local(), and blender::id_type_is_valid().

◆ name

const char* blender::IDTypeInfo::name = nullptr

The user visible name for this data-block, also used as default name for a new data-block.

Note
: Also used for the 'filepath' ID type part when listing IDs in library blend-files (my_blendfile.blend/<IDType.name>/my_id_name, e.g. boat-v001.blend/Collection/PR-boat for the GRPR-boat Collection ID in boat-v001.blend).

Definition at line 188 of file BKE_idtype.hh.

Referenced by blender::absolute_convert_foreach_path_cb(), blender::bke::asset_write_in_library(), blender::BKE_idtype_get_info_from_idtype_index(), blender::BKE_idtype_idcode_to_name(), blender::BKE_idtype_name_normalize(), blender::BKE_libblock_get_alloc_info(), blender::get_alloc_name(), blender::id_type_is_valid(), blender::ed::space_node::node_find_create_data_block_value(), blender::ed::outliner::outliner_id_copy_tag_id(), and blender::relative_convert_foreach_path_cb().

◆ name_plural

const char* blender::IDTypeInfo::name_plural = nullptr

Plural version of the user-visible name.

Definition at line 190 of file BKE_idtype.hh.

Referenced by blender::bke::asset_root_path_for_save(), blender::BKE_idtype_idcode_to_name_plural(), and blender::id_type_is_valid().

◆ owner_pointer_get

IDTypeEmbeddedOwnerPointerGetFunction blender::IDTypeInfo::owner_pointer_get
Initial value:

For embedded IDs, return the address of the pointer to their owner ID.

Definition at line 264 of file BKE_idtype.hh.

Referenced by blender::BKE_id_owner_get(), blender::BKE_libblock_copy_in_lib(), and blender::id_type_is_valid().

◆ struct_size

size_t blender::IDTypeInfo::struct_size = 0

Memory size of a data-block of that type.

Definition at line 179 of file BKE_idtype.hh.

Referenced by blender::BKE_libblock_get_alloc_info(), blender::BLO_Write_IDBuffer::BLO_Write_IDBuffer(), blender::id_swap(), and blender::id_type_is_valid().

◆ translation_context

const char* blender::IDTypeInfo::translation_context = nullptr

Translation context to use for UI messages related to that type of data-block.

Definition at line 192 of file BKE_idtype.hh.

Referenced by blender::BKE_idtype_idcode_to_translation_context(), and blender::id_type_is_valid().


The documentation for this struct was generated from the following file: