Blender V5.0
IDTypeInfo Struct Reference

#include <BKE_idtype.hh>

Public Attributes

short id_code
uint64_t id_filter
uint64_t dependencies_id_types
int main_listbase_index
size_t struct_size
const char * name
const char * name_plural
const char * translation_context
uint32_t flags
AssetTypeInfoasset_type_info
IDTypeInitDataFunction init_data
IDTypeCopyDataFunction copy_data
IDTypeFreeDataFunction free_data
IDTypeMakeLocalFunction make_local
IDTypeForeachIDFunction foreach_id
IDTypeForeachCacheFunction foreach_cache
IDTypeForeachPathFunction foreach_path
IDTypeForeachColorFunction foreach_working_space_color
IDTypeEmbeddedOwnerPointerGetFunction owner_pointer_get
IDTypeBlendWriteFunction blend_write
IDTypeBlendReadDataFunction blend_read_data
IDTypeBlendReadAfterLiblinkFunction blend_read_after_liblink
IDTypeBlendReadUndoPreserve blend_read_undo_preserve
IDTypeLibOverrideApplyPost lib_override_apply_post

Detailed Description

Definition at line 146 of file BKE_idtype.hh.

Member Data Documentation

◆ asset_type_info

AssetTypeInfo* IDTypeInfo::asset_type_info

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

Definition at line 197 of file BKE_idtype.hh.

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

◆ blend_read_after_liblink

IDTypeBlendReadAfterLiblinkFunction IDTypeInfo::blend_read_after_liblink

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 268 of file BKE_idtype.hh.

Referenced by after_liblink_id_process(), and get_type_info().

◆ blend_read_data

IDTypeBlendReadDataFunction IDTypeInfo::blend_read_data

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

Definition at line 260 of file BKE_idtype.hh.

Referenced by direct_link_id(), and get_type_info().

◆ blend_read_undo_preserve

IDTypeBlendReadUndoPreserve IDTypeInfo::blend_read_undo_preserve

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 279 of file BKE_idtype.hh.

Referenced by get_type_info(), and lib_link_all().

◆ blend_write

IDTypeBlendWriteFunction IDTypeInfo::blend_write

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

Definition at line 255 of file BKE_idtype.hh.

Referenced by get_type_info(), and write_id().

◆ copy_data

IDTypeCopyDataFunction IDTypeInfo::copy_data

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 210 of file BKE_idtype.hh.

Referenced by BKE_id_copy_in_lib(), and get_type_info().

◆ dependencies_id_types

uint64_t IDTypeInfo::dependencies_id_types

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 166 of file BKE_idtype.hh.

Referenced by BKE_library_id_can_use_filter_id(), and get_type_info().

◆ flags

◆ foreach_cache

IDTypeForeachCacheFunction IDTypeInfo::foreach_cache

Iterator over all cache pointers of given ID.

Definition at line 232 of file BKE_idtype.hh.

Referenced by BKE_idtype_id_foreach_cache(), blo_cache_storage_init(), blo_cache_storage_old_bmain_clear(), direct_link_id(), and get_type_info().

◆ foreach_id

IDTypeForeachIDFunction IDTypeInfo::foreach_id

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 227 of file BKE_idtype.hh.

Referenced by get_type_info(), and library_foreach_ID_link().

◆ foreach_path

IDTypeForeachPathFunction IDTypeInfo::foreach_path

Iterator over all file paths of given ID.

Definition at line 237 of file BKE_idtype.hh.

Referenced by BKE_bpath_foreach_path_id(), and get_type_info().

◆ foreach_working_space_color

IDTypeForeachColorFunction IDTypeInfo::foreach_working_space_color

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

Definition at line 243 of file BKE_idtype.hh.

Referenced by get_type_info(), and IMB_colormanagement_working_space_convert().

◆ free_data

IDTypeFreeDataFunction IDTypeInfo::free_data

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

Definition at line 215 of file BKE_idtype.hh.

Referenced by BKE_libblock_free_datablock(), and get_type_info().

◆ id_code

short IDTypeInfo::id_code

Unique identifier of this type, either as a short or an array of two chars, see DNA_ID_enums.h's ID_XX enums.

Definition at line 153 of file BKE_idtype.hh.

Referenced by BKE_idtype_get_info_from_idtype_index(), BKE_idtype_idcode_from_name(), BKE_idtype_index_to_idcode(), get_type_info(), read_undo_reuse_noundo_local_ids(), and setup_app_data().

◆ id_filter

uint64_t IDTypeInfo::id_filter

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 158 of file BKE_idtype.hh.

Referenced by BKE_idtype_index_to_idfilter(), and get_type_info().

◆ init_data

IDTypeInitDataFunction IDTypeInfo::init_data

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

Definition at line 204 of file BKE_idtype.hh.

Referenced by BKE_libblock_init_empty(), and get_type_info().

◆ lib_override_apply_post

IDTypeLibOverrideApplyPost IDTypeInfo::lib_override_apply_post

Called after library override operations have been applied.

Note
Currently needed for some update operation on point caches.

Definition at line 286 of file BKE_idtype.hh.

Referenced by get_type_info(), and RNA_struct_override_apply().

◆ main_listbase_index

int IDTypeInfo::main_listbase_index

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 173 of file BKE_idtype.hh.

Referenced by get_type_info().

◆ make_local

IDTypeMakeLocalFunction IDTypeInfo::make_local

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

Definition at line 221 of file BKE_idtype.hh.

Referenced by BKE_lib_id_make_local(), and get_type_info().

◆ name

const char* IDTypeInfo::name

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 185 of file BKE_idtype.hh.

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

◆ name_plural

const char* IDTypeInfo::name_plural

Plural version of the user-visible name.

Definition at line 187 of file BKE_idtype.hh.

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

◆ owner_pointer_get

IDTypeEmbeddedOwnerPointerGetFunction IDTypeInfo::owner_pointer_get

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

Definition at line 248 of file BKE_idtype.hh.

Referenced by BKE_id_owner_get(), BKE_libblock_copy_in_lib(), and get_type_info().

◆ struct_size

size_t IDTypeInfo::struct_size

Memory size of a data-block of that type.

Definition at line 176 of file BKE_idtype.hh.

Referenced by BKE_libblock_get_alloc_info(), BLO_Write_IDBuffer::BLO_Write_IDBuffer(), get_type_info(), and id_swap().

◆ translation_context

const char* IDTypeInfo::translation_context

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

Definition at line 189 of file BKE_idtype.hh.

Referenced by BKE_idtype_idcode_to_translation_context(), and get_type_info().


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