Blender V5.3
BKE_lib_query.hh File Reference
#include "DNA_ID.h"
#include "BLI_enum_flags.hh"
#include "BLI_function_ref.hh"
#include <array>

Go to the source code of this file.

Classes

struct  blender::LibraryIDLinkCallbackData
struct  blender::LibQueryUnusedIDsData

Namespaces

namespace  blender
 BMesh Iterators.

Macros

#define BKE_LIB_FOREACHID_PROCESS_ID_NOCHECK(data_, id_, cb_flag_)
#define BKE_LIB_FOREACHID_PROCESS_ID(data_, id_, cb_flag_)
#define BKE_LIB_FOREACHID_PROCESS_IDSUPER_P(data_, id_super_p_, cb_flag_)
#define BKE_LIB_FOREACHID_PROCESS_IDSUPER(data_, id_super_, cb_flag_)
#define BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(data_, func_call_)

Typedefs

using blender::LibraryIDLinkCallback = int(LibraryIDLinkCallbackData *cb_data)

Enumerations

enum  blender::LibraryForeachIDCallbackFlag {
  blender::IDWALK_CB_NOP = 0 , blender::IDWALK_CB_NEVER_NULL = (1 << 0) , blender::IDWALK_CB_NEVER_SELF = (1 << 1) , blender::IDWALK_CB_INDIRECT_USAGE = (1 << 2) ,
  blender::IDWALK_CB_DIRECT_WEAK_LINK = (1 << 3) , blender::IDWALK_CB_EMBEDDED = (1 << 4) , blender::IDWALK_CB_EMBEDDED_NOT_OWNING = (1 << 5) , blender::IDWALK_CB_LOOPBACK = (1 << 6) ,
  blender::IDWALK_CB_INTERNAL = (1 << 9) , blender::IDWALK_CB_READFILE_IGNORE = (1 << 10) , blender::IDWALK_CB_WRITEFILE_IGNORE = (1 << 11) , blender::IDWALK_CB_USER = (1 << 12) ,
  blender::IDWALK_CB_USER_ONE = (1 << 13) , blender::IDWALK_CB_OVERRIDE_LIBRARY_REFERENCE = (1 << 16) , blender::IDWALK_CB_OVERRIDE_LIBRARY_HIERARCHY_ROOT = (1 << 17) , blender::IDWALK_CB_OVERRIDE_LIBRARY_NOT_OVERRIDABLE = (1 << 18) ,
  blender::IDWALK_CB_OVERRIDE_LIBRARY_HIERARCHY_DEFAULT = (1 << 19) , blender::IDWALK_CB_HASH_IGNORE = (1 << 20)
}
enum  { blender::IDWALK_RET_NOP = 0 , blender::IDWALK_RET_STOP_ITER = 1 << 0 , blender::IDWALK_RET_STOP_RECURSION = 1 << 1 }
enum  blender::LibraryForeachIDFlag {
  blender::IDWALK_NOP = 0 , blender::IDWALK_READONLY = (1 << 0) , blender::IDWALK_RECURSE = (1 << 1) , blender::IDWALK_INCLUDE_UI = (1 << 2) ,
  blender::IDWALK_IGNORE_EMBEDDED_ID = (1 << 3) , blender::IDWALK_NO_ORIG_POINTERS_ACCESS = (1 << 5) , blender::IDWALK_IGNORE_MISSING_OWNER_ID = (1 << 6) , blender::IDWALK_DO_INTERNAL_RUNTIME_POINTERS = (1 << 9) ,
  blender::IDWALK_DO_LIBRARY_POINTER = (1 << 10) , blender::IDWALK_DO_DEPRECATED_POINTERS = (1 << 11)
}

Functions

 blender::ENUM_OPERATORS (LibraryForeachIDCallbackFlag)
 blender::ENUM_OPERATORS (LibraryForeachIDFlag)
bool blender::BKE_lib_query_foreachid_iter_stop (const LibraryForeachIDData *data)
void blender::BKE_lib_query_foreachid_process (LibraryForeachIDData *data, ID **id_pp, LibraryForeachIDCallbackFlag cb_flag)
LibraryForeachIDFlag blender::BKE_lib_query_foreachid_process_flags_get (const LibraryForeachIDData *data)
Main * blender::BKE_lib_query_foreachid_process_main_get (const LibraryForeachIDData *data)
int blender::BKE_lib_query_foreachid_process_callback_flag_override (LibraryForeachIDData *data, LibraryForeachIDCallbackFlag cb_flag, bool do_replace)
void blender::BKE_library_foreach_ID_embedded (LibraryForeachIDData *data, ID **id_pp)
void blender::BKE_lib_query_idpropertiesForeachIDLink_callback (IDProperty *id_prop, void *user_data)
void blender::BKE_library_foreach_ID_link (Main *bmain, ID *id, FunctionRef< LibraryIDLinkCallback > callback, void *user_data, LibraryForeachIDFlag flag)
void blender::BKE_library_foreach_subdata_id (Main *bmain, ID *owner_id, ID *self_id, FunctionRef< void(LibraryForeachIDData *data)> subdata_foreach_id, FunctionRef< LibraryIDLinkCallback > callback, void *user_data, const LibraryForeachIDFlag flag)
void blender::BKE_library_update_ID_link_user (ID *id_dst, ID *id_src, int cb_flag)
int blender::BKE_library_ID_use_ID (ID *id_user, ID *id_used)
bool blender::BKE_library_id_can_use_idtype (ID *owner_id, short id_type_used)
uint64_t blender::BKE_library_id_can_use_filter_id (const ID *owner_id, const bool include_ui, const IDTypeInfo *owner_id_type=nullptr)
bool blender::BKE_library_ID_is_locally_used (Main *bmain, void *idv)
bool blender::BKE_library_ID_is_indirectly_used (Main *bmain, void *idv)
void blender::BKE_library_ID_test_usages (Main *bmain, void *idv, bool *r_is_used_local, bool *r_is_used_linked)
void blender::BKE_lib_query_unused_ids_amounts (Main *bmain, LibQueryUnusedIDsData &parameters)
void blender::BKE_lib_query_unused_ids_tag (Main *bmain, int tag, LibQueryUnusedIDsData &parameters)
void blender::BKE_library_unused_linked_data_set_tag (Main *bmain, bool do_init_tag)
void blender::BKE_library_indirectly_used_data_tag_clear (Main *bmain)

Detailed Description

API to perform operations over all ID pointers used by a given data-block.

Note
BKE_lib_ files are for operations over data-blocks themselves, although they might alter Main as well (when creating/renaming/deleting an ID e.g.).

Names

Warning
Descriptions below is ideal goal, current status of naming does not yet fully follow it (this is WIP).
  • BKE_lib_query_ should be used for functions in that file.

Definition in file BKE_lib_query.hh.

Macro Definition Documentation

◆ BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL

◆ BKE_LIB_FOREACHID_PROCESS_ID

◆ BKE_LIB_FOREACHID_PROCESS_ID_NOCHECK

#define BKE_LIB_FOREACHID_PROCESS_ID_NOCHECK ( data_,
id_,
cb_flag_ )
Value:
{ \
BKE_lib_query_foreachid_process((data_), (ID **)&(id_), (cb_flag_)); \
if (BKE_lib_query_foreachid_iter_stop((data_))) { \
return; \
} \
} \
((void)0)

Should typically only be used when processing deprecated ID types (like IPO ones).

Definition at line 267 of file BKE_lib_query.hh.

◆ BKE_LIB_FOREACHID_PROCESS_IDSUPER

#define BKE_LIB_FOREACHID_PROCESS_IDSUPER ( data_,
id_super_,
cb_flag_ )
Value:
{ \
BKE_LIB_FOREACHID_PROCESS_IDSUPER_P(data_, &(id_super_), cb_flag_); \
} \
((void)0)

Definition at line 293 of file BKE_lib_query.hh.

Referenced by blender::action_foreach_id(), blender::bke::action_foreach_id(), blender::BKE_animdata_foreach_id(), blender::BKE_nla_strip_foreach_id(), blender::BKE_screen_foreach_id_screen_area(), blender::BKE_texture_mtex_foreach_id(), blender::brush_foreach_id(), blender::buttons_foreach_id(), blender::camera_foreach_id(), blender::clip_foreach_id(), blender::collection_foreach_id(), blender::curve_foreach_id(), blender::curves_foreach_id(), blender::bke::compositor::for_each_id_in_effects(), blender::graph_foreach_id(), blender::grease_pencil_foreach_id(), blender::greasepencil_foreach_id(), blender::image_foreach_id(), blender::lattice_foreach_id(), blender::library_foreach_id(), blender::bke::library_foreach_node_socket(), blender::lightprobe_foreach_id(), blender::linestyle_foreach_id(), blender::material_foreach_id(), blender::mesh_foreach_id(), blender::metaball_foreach_id(), blender::movie_clip_foreach_id(), blender::nla_foreach_id(), blender::bke::node_foreach_id(), blender::ed::space_node::node_foreach_id(), blender::object_foreach_id(), blender::particle_settings_foreach_id(), blender::pointcloud_foreach_id(), blender::scene_foreach_id(), blender::scene_foreach_layer_collection(), blender::screen_foreach_id(), blender::script_foreach_id(), blender::ed::vse::sequencer_foreach_id(), blender::bke::node_interface::socket_types::socket_data_foreach_id_impl(), blender::bke::node_interface::socket_types::socket_data_foreach_id_impl(), blender::bke::node_interface::socket_types::socket_data_foreach_id_impl(), blender::bke::node_interface::socket_types::socket_data_foreach_id_impl(), blender::bke::node_interface::socket_types::socket_data_foreach_id_impl(), blender::bke::node_interface::socket_types::socket_data_foreach_id_impl(), blender::bke::node_interface::socket_types::socket_data_foreach_id_impl(), blender::bke::node_interface::socket_types::socket_data_foreach_id_impl(), blender::bke::node_interface::socket_types::socket_data_foreach_id_impl(), blender::bke::node_interface::socket_types::socket_data_foreach_id_impl(), blender::speaker_foreach_id(), blender::text_foreach_id(), blender::texture_foreach_id(), blender::view3d_foreach_id(), blender::volume_foreach_id(), blender::window_manager_foreach_id(), and blender::workspace_foreach_id().

◆ BKE_LIB_FOREACHID_PROCESS_IDSUPER_P

#define BKE_LIB_FOREACHID_PROCESS_IDSUPER_P ( data_,
id_super_p_,
cb_flag_ )
Value:
{ \
CHECK_TYPE(&((*(id_super_p_))->id), ID *); \
BKE_lib_query_foreachid_process((data_), (ID **)(id_super_p_), (cb_flag_)); \
if (BKE_lib_query_foreachid_iter_stop((data_))) { \
return; \
} \
} \
((void)0)

Definition at line 283 of file BKE_lib_query.hh.