Blender V5.3
BKE_main_idmap.hh File Reference

Go to the source code of this file.

Namespaces

namespace  blender
 BMesh Iterators.

Enumerations

enum  { blender::MAIN_IDMAP_TYPE_NAME = 1 << 0 , blender::MAIN_IDMAP_TYPE_UID = 1 << 1 }

Functions

BKE_main_idmap API

Cache ID (name, library lookups). This doesn't account for adding/removing data-blocks, and should only be used when performing many lookups.

Note
GHash's are initialized on demand, since its likely some types will never have lookups run on them, so its a waste to create and never use.
IDNameLib_Map * blender::BKE_main_idmap_create (Main *bmain, bool create_valid_ids_set, Main *old_bmain, int idmap_types) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void blender::BKE_main_idmap_clear (IDNameLib_Map &id_map)
void blender::BKE_main_idmap_destroy (IDNameLib_Map *id_map) ATTR_NONNULL()
void blender::BKE_main_idmap_insert_id (IDNameLib_Map *id_map, ID *id) ATTR_NONNULL()
void blender::BKE_main_idmap_remove_id (IDNameLib_Map *id_map, const ID *id) ATTR_NONNULL()
Main * blender::BKE_main_idmap_main_get (IDNameLib_Map *id_map) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
ID * blender::BKE_main_idmap_lookup_name (IDNameLib_Map *id_map, short id_type, const char *name, const Library *lib) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
ID ID * blender::BKE_main_idmap_lookup_id (IDNameLib_Map *id_map, const ID *id) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
ID ID ID * blender::BKE_main_idmap_lookup_uid (IDNameLib_Map *id_map, uint session_uid) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)

Detailed Description

API to generate and use a mapping from [ID type & name] to [id pointer], within a given Main data-base.

Note
BKE_main files are for operations over the Main database itself, or generating extra temp data to help working with it. Those should typically not affect the data-blocks themselves.

Names

  • BKE_main_idmap_ Should be used for functions in that file.

Definition in file BKE_main_idmap.hh.