|
Blender V5.0
|
#include <optional>#include "BLI_compiler_attrs.h"#include "BLI_set.hh"#include "BLI_string_ref.hh"#include "BLI_utildefines.h"#include "BLI_vector.hh"#include "DNA_ID.h"#include "DNA_userdef_enums.h"Go to the source code of this file.
Classes | |
| struct | blender::bke::id::ID_Runtime_Remap |
| struct | blender::bke::id::ID_Runtime |
| struct | IDNewNameResult |
Namespaces | |
| namespace | blender |
| namespace | blender::bke |
| namespace | blender::bke::id |
Macros | |
| #define | MAIN_ID_SESSION_UID_UNSET 0 |
| #define | MAX_ID_FULL_NAME (256 + 256 + 3 + 1) |
| #define | MAX_ID_FULL_NAME_UI (MAX_ID_FULL_NAME + 3) |
| #define | IS_TAGGED(_id) |
Functions | |
| size_t | BKE_libblock_get_alloc_info (short type, const char **r_name) |
| ID * | BKE_libblock_alloc_notest (short type) ATTR_WARN_UNUSED_RESULT |
| void * | BKE_libblock_alloc (Main *bmain, short type, const char *name, int flag) ATTR_WARN_UNUSED_RESULT |
| void * | BKE_libblock_alloc_in_lib (Main *bmain, std::optional< Library * > owner_library, short type, const char *name, int flag) ATTR_WARN_UNUSED_RESULT |
| void | BKE_libblock_init_empty (ID *id) ATTR_NONNULL(1) |
| void | BKE_libblock_runtime_ensure (ID &id) |
| void | BKE_libblock_runtime_reset_remapping_status (ID *id) ATTR_NONNULL(1) |
| void | BKE_lib_libblock_session_uid_ensure (ID *id) |
| void | BKE_lib_libblock_session_uid_renew (ID *id) |
| void * | BKE_id_new (Main *bmain, short type, const char *name) |
| template<typename T> | |
| T * | BKE_id_new (Main *bmain, const char *name) |
| void * | BKE_id_new_in_lib (Main *bmain, std::optional< Library * > owner_library, short type, const char *name) |
| void * | BKE_id_new_nomain (short type, const char *name) |
| template<typename T> | |
| T * | BKE_id_new_nomain (const char *name) |
| void | BKE_libblock_copy_ex (Main *bmain, const ID *id, ID **new_id_p, int orig_flag) |
| void | BKE_libblock_copy_in_lib (Main *bmain, std::optional< Library * > owner_library, const ID *id, std::optional< const ID * > new_owner_id, ID **new_id_p, int orig_flag) |
| void * | BKE_libblock_copy (Main *bmain, const ID *id) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL() |
| void | BKE_id_move_to_same_lib (Main &bmain, ID &id, const ID &owner_id) |
| IDNewNameResult | BKE_libblock_rename (Main &bmain, ID &id, blender::StringRefNull name, const IDNewNameMode mode=IDNewNameMode::RenameExistingNever) |
| IDNewNameResult | BKE_id_rename (Main &bmain, ID &id, blender::StringRefNull name, const IDNewNameMode mode=IDNewNameMode::RenameExistingNever) |
| ID * | BKE_libblock_find_name (Main *bmain, short type, const char *name, const std::optional< Library * > lib=std::nullopt) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL() |
| ID * | BKE_libblock_find_session_uid (Main *bmain, short type, uint32_t session_uid) |
| ID * | BKE_libblock_find_session_uid (Main *bmain, uint32_t session_uid) |
| ID * | BKE_libblock_find_name_and_library (Main *bmain, short type, const char *name, const char *lib_name) |
| ID * | BKE_libblock_find_name_and_library_filepath (Main *bmain, short type, const char *name, const char *lib_filepath_abs) |
| void | BKE_libblock_free_data_py (ID *id) |
| void | BKE_libblock_free_runtime_data (ID *id) |
| void | BKE_libblock_free_data (ID *id, bool do_id_user) ATTR_NONNULL() |
| void | BKE_libblock_free_datablock (ID *id, int flag) ATTR_NONNULL() |
| void | BKE_id_free_ex (Main *bmain, void *idv, int flag_orig, bool use_flag_from_idtag) |
| void | BKE_id_free (Main *bmain, void *idv) |
| void | BKE_id_free_us (Main *bmain, void *idv) ATTR_NONNULL() |
| void | BKE_id_delete (Main *bmain, void *idv) ATTR_NONNULL() |
| void | BKE_id_delete_ex (Main *bmain, void *idv, const int extra_remapping_flags) ATTR_NONNULL(1 |
| void size_t | BKE_id_multi_tagged_delete (Main *bmain) ATTR_NONNULL() |
| size_t | BKE_id_multi_delete (Main *bmain, blender::Set< ID * > &ids_to_delete) |
| void | BKE_libblock_management_main_add (Main *bmain, void *idv) |
| void | BKE_libblock_management_main_remove (Main *bmain, void *idv) |
| void | BKE_libblock_management_usercounts_set (Main *bmain, void *idv) |
| void | BKE_libblock_management_usercounts_clear (Main *bmain, void *idv) |
| void | id_lib_extern (ID *id) |
| void | id_lib_indirect_weak_link (ID *id) |
| void | id_us_ensure_real (ID *id) |
| void | id_us_clear_real (ID *id) |
| void | id_us_plus_no_lib (ID *id) |
| void | id_us_plus (ID *id) |
| void | id_us_min (ID *id) |
| void | id_fake_user_set (ID *id) |
| void | id_fake_user_clear (ID *id) |
| void | BKE_id_newptr_and_tag_clear (ID *id) |
| void | BKE_lib_id_make_local_generic_action_define (Main *bmain, ID *id, int flags, bool *r_force_local, bool *r_force_copy) |
| void | BKE_lib_id_make_local_generic (Main *bmain, ID *id, int flags) |
| bool | BKE_lib_id_make_local (Main *bmain, ID *id, int flags) |
| bool | id_single_user (bContext *C, ID *id, PointerRNA *ptr, PropertyRNA *prop) |
| bool | BKE_id_copy_is_allowed (const ID *id) |
| ID * | BKE_id_copy_ex (Main *bmain, const ID *id, ID **new_id_p, int flag) |
| struct ID * | BKE_id_copy_in_lib (Main *bmain, std::optional< Library * > owner_library, const ID *id, std::optional< const ID * > new_owner_id, ID **new_id_p, int flag) |
| ID * | BKE_id_copy (Main *bmain, const ID *id) |
| ID * | BKE_id_copy_for_duplicate (Main *bmain, ID *id, eDupli_ID_Flags duplicate_flags, int copy_flags) |
| ID * | BKE_id_copy_for_use_in_bmain (Main *bmain, const ID *id) |
| void | BKE_lib_id_swap (Main *bmain, ID *id_a, ID *id_b, const bool do_self_remap, const int self_remap_flags) |
| void | BKE_lib_id_swap_full (Main *bmain, ID *id_a, ID *id_b, const bool do_self_remap, const int self_remap_flags) |
| void | id_sort_by_name (ListBase *lb, ID *id, ID *id_sorting_hint) |
| void | BKE_lib_id_expand_local (Main *bmain, ID *id, int flags) |
| IDNewNameResult | BKE_id_new_name_validate (Main &bmain, ListBase &lb, ID &id, const char *newname, IDNewNameMode mode, bool do_linked_data) |
| void | BKE_lib_id_clear_library_data (Main *bmain, ID *id, int flags) |
| void | BKE_main_id_tag_idcode (Main *mainvar, short type, int tag, bool value) |
| void | BKE_main_id_tag_listbase (ListBase *lb, int tag, bool value) |
| void | BKE_main_id_tag_all (Main *mainvar, int tag, bool value) |
| void | BKE_main_id_flag_listbase (ListBase *lb, int flag, bool value) |
| void | BKE_main_id_flag_all (Main *bmain, int flag, bool value) |
| void | BKE_main_id_newptr_and_tag_clear (Main *bmain) |
| void | BKE_main_id_refcount_recompute (Main *bmain, bool do_linked_only) |
| void | BKE_main_lib_objects_recalc_all (Main *bmain) |
| void | BKE_main_id_repair_duplicate_names_listbase (Main *bmain, ListBase *lb) |
| void | BKE_id_full_name_get (char name[MAX_ID_FULL_NAME], const ID *id, char separator_char) |
| void | BKE_id_full_name_ui_prefix_get (char name[MAX_ID_FULL_NAME_UI], const ID *id, bool add_lib_hint, char separator_char, int *r_prefix_len) |
| const char * | BKE_id_name (const ID &id) |
| char * | BKE_id_name (ID &id) |
| char * | BKE_id_to_unique_string_key (const ID *id) |
| void | BKE_library_make_local (Main *bmain, const Library *lib, GHash *old_to_new_ids, bool untagged_only, bool set_fake, bool clear_asset_data) |
| void | BKE_id_tag_set_atomic (ID *id, int tag) |
| void | BKE_id_tag_clear_atomic (ID *id, int tag) |
| bool | BKE_id_is_in_main (Main *bmain, ID *id) |
| bool | BKE_id_is_in_global_main (ID *id) |
| bool | BKE_id_can_be_asset (const ID *id) |
| ID * | BKE_id_owner_get (ID *id, const bool debug_relationship_assert=true) |
| bool | BKE_id_is_editable (const Main *bmain, const ID *id) |
| bool | BKE_id_can_use_id (const ID &id_from, const ID &id_to) |
| blender::Vector< ID * > | BKE_id_ordered_list (const ListBase *lb) |
| void | BKE_id_reorder (const ListBase *lb, ID *id, ID *relative, bool after) |
| void | BKE_id_blend_write (BlendWriter *writer, ID *id) |
| void | BKE_id_eval_properties_copy (ID *id_cow, ID *id) |
API to manage data-blocks inside of Blender's Main data-base, or as independent runtime-only data.
Definition in file BKE_lib_id.hh.
| #define IS_TAGGED | ( | _id | ) |
Definition at line 1002 of file BKE_lib_id.hh.
Referenced by blender::ed::object::object_convert_exec().
| #define MAIN_ID_SESSION_UID_UNSET 0 |
When an ID's UID is of that value, it is unset/invalid (e.g. for runtime IDs, etc.).
Definition at line 156 of file BKE_lib_id.hh.
Referenced by blender::deg::DepsgraphNodeBuilder::add_id_node(), BKE_lib_libblock_session_uid_ensure(), BKE_lib_libblock_session_uid_renew(), BKE_main_idmap_create(), BKE_main_idmap_insert_id(), BKE_main_idmap_remove_id(), BLO_memfile_write_init(), direct_link_id_common(), direct_link_region(), main_relations_create_idlink_cb(), blender::ed::object::make_override_library_exec(), blender::ed::object::make_override_library_invoke(), mywrite_id_end(), blender::ed::object::OBJECT_OT_make_override_library(), and WM_OT_id_linked_relocate().
| #define MAX_ID_FULL_NAME (256 + 256 + 3 + 1) |
256 is MAX_ID_NAME - 2
Definition at line 881 of file BKE_lib_id.hh.
Referenced by BKE_id_full_name_get(), blender::seq::effect_text_font_load(), blender::render::hydra::FinalEngine::render(), and rna_def_ID().
| #define MAX_ID_FULL_NAME_UI (MAX_ID_FULL_NAME + 3) |
Adds 'key-code' two letters at beginning.
Definition at line 883 of file BKE_lib_id.hh.
Referenced by BKE_id_full_name_ui_prefix_get(), id_search_add(), and ui_rna_collection_search_update_fn().
| anonymous enum |
New ID creation/copying options.
| Enumerator | |
|---|---|
| LIB_ID_CREATE_NO_MAIN | Create data-block outside of any main database - similar to 'localize' functions of materials etc. |
| LIB_ID_CREATE_NO_USER_REFCOUNT | Do not affect user reference-count of data-blocks used by new one (which also gets zero user-count then). Implies LIB_ID_CREATE_NO_MAIN. |
| LIB_ID_CREATE_NO_ALLOCATE | Assume given newid already points to allocated memory for whole data-block (ID + data) - USE WITH CAUTION! Implies LIB_ID_CREATE_NO_MAIN. |
| LIB_ID_CREATE_NO_DEG_TAG | Do not tag new ID for update in depsgraph. |
| LIB_ID_CREATE_LOCAL | Very similar to LIB_ID_CREATE_NO_MAIN, and should never be used with it (typically combined with LIB_ID_CREATE_LOCALIZE or LIB_ID_COPY_LOCALIZE in fact). It ensures that IDs created with it will get the ID_TAG_LOCALIZED tag, and uses some specific code in some copy cases (mostly for node trees). |
| LIB_ID_COPY_SET_COPIED_ON_WRITE | Create for the depsgraph, when set ID_TAG_COPIED_ON_EVAL must be set. Internally this is used to share some pointers instead of duplicating them. |
| LIB_ID_COPY_ID_NEW_SET | Set ID.newid pointer of the given source ID with the address of its new copy. |
| LIB_ID_COPY_NO_PREVIEW | Object only, needed by make_local code. Do not copy preview data, when supported. |
| LIB_ID_COPY_CACHES | Copy runtime data caches. |
| LIB_ID_COPY_NO_ANIMDATA | Don't copy id->adt, used by ID data-block localization routines. |
| LIB_ID_COPY_NO_LIB_OVERRIDE | Do not copy id->override_library, used by ID data-block override routines. |
| LIB_ID_COPY_NO_LIB_OVERRIDE_LOCAL_DATA_FLAG | When copying local sub-data (like constraints or modifiers), do not set their "library override local data" flag. |
| LIB_ID_COPY_ACTIONS | EXCEPTION! Deep-copy actions used by animation-data of copied ID. |
| LIB_ID_COPY_SHAPEKEY | EXCEPTION! Deep-copy shape-keys used by copied obdata ID. |
| LIB_ID_COPY_NODETREE_LOCALIZE | EXCEPTION! Specific deep-copy of node trees used e.g. for rendering purposes. |
| LIB_ID_COPY_RIGID_BODY_NO_COLLECTION_HANDLING | EXCEPTION! Specific handling of RB objects regarding collections differs depending whether we duplicate scene/collections, or objects. |
| LIB_ID_COPY_ASSET_METADATA | |
| LIB_ID_COPY_DEFAULT | Shape-keys are not real ID's, more like local data to geometry IDs. |
| LIB_ID_CREATE_LOCALIZE | Create a local, outside of bmain, data-block to work on. |
| LIB_ID_COPY_LOCALIZE | Generate a local copy, outside of bmain, to work on (used by copy-on-eval e.g.). |
Definition at line 220 of file BKE_lib_id.hh.
| anonymous enum |
New freeing logic options.
| Enumerator | |
|---|---|
| LIB_ID_FREE_NO_MAIN | Do not try to remove freed ID from given Main (passed Main may be NULL). |
| LIB_ID_FREE_NO_USER_REFCOUNT | Do not affect user reference-count of data-blocks used by freed one. Implies LIB_ID_FREE_NO_MAIN. |
| LIB_ID_FREE_NOT_ALLOCATED | Assume freed ID data-block memory is managed elsewhere, do not free it (still calls relevant ID type's freeing function though) - USE WITH CAUTION! Implies LIB_ID_FREE_NO_MAIN. |
| LIB_ID_FREE_NO_DEG_TAG | Do not tag freed ID for update in depsgraph. |
| LIB_ID_FREE_NO_UI_USER | Do not attempt to remove freed ID from UI data/notifiers/... |
| LIB_ID_FREE_NO_NAMEMAP_REMOVE | Do not remove freed ID's name from a potential runtime name-map. |
Definition at line 479 of file BKE_lib_id.hh.
| anonymous enum |
Flags to control make local code behavior.
| Enumerator | |
|---|---|
| LIB_ID_MAKELOCAL_FULL_LIBRARY | Making that ID local is part of making local a whole library. Implies LIB_ID_MAKELOCAL_INDIRECT. |
| LIB_ID_MAKELOCAL_INDIRECT | Also make local indirectly linked IDs. Implied by LIB_ID_MAKELOCAL_FULL_LIBRARY. |
| LIB_ID_MAKELOCAL_FORCE_LOCAL | In case caller code already knows this ID should be made local without copying. |
| LIB_ID_MAKELOCAL_FORCE_COPY | In case caller code already knows this ID should be made local using copying. |
| LIB_ID_MAKELOCAL_ASSET_DATA_CLEAR | Clear asset data (in case the ID can actually be made local, in copy case asset data is never copied over). |
| LIB_ID_MAKELOCAL_LIBOVERRIDE_CLEAR | Clear any liboverride data as part of making this linked data local. |
Definition at line 643 of file BKE_lib_id.hh.
| enum eLibIDDuplicateFlags |
Duplicate (a.k.a. deep copy) common processing options. See also eDupli_ID_Flags for options controlling what kind of IDs to duplicate.
| Enumerator | |
|---|---|
| LIB_ID_DUPLICATE_IS_SUBPROCESS | This call to a duplicate function is part of another call for some parent ID. Therefore, this sub-process should not clear newid pointers, nor handle remapping itself. NOTE: In some cases (like Object one), the duplicate function may be called on the root ID with this flag set, as remapping and/or other similar tasks need to be handled by the caller. |
| LIB_ID_DUPLICATE_IS_ROOT_ID | This call is performed on a 'root' ID, and should therefore perform some decisions regarding sub-IDs (dependencies), check for linked vs. locale data, etc. |
Definition at line 458 of file BKE_lib_id.hh.
|
strong |
How to handle ID rename in case requested name is already used by another ID.
| Enumerator | |
|---|---|
| RenameExistingNever | Never rename another existing ID if the target name is already in use. The renamed ID will get a name modified with a numerical suffix instead. |
| RenameExistingAlways | Always rename another existing ID if the target name is already in use. The renamed ID will get the requested unmodified name. |
| RenameExistingSameRoot | Only rename another existing ID if the target name is already in use, when the current name of the renamed ID has the same root as the other ID name (i.e. they have the same name, besides the numeric suffix). E.g. Assuming there is already an existing ID named Object: |
Definition at line 344 of file BKE_lib_id.hh.
| void BKE_id_blend_write | ( | BlendWriter * | writer, |
| ID * | id ) |
Definition at line 2631 of file lib_id.cc.
References BKE_animdata_blend_write(), BKE_asset_metadata_write(), BLO_write_string(), BLO_write_struct, BLO_write_struct_list, ELEM, GS, ID_WM, IDP_BlendWrite(), and LISTBASE_FOREACH.
Referenced by blender::bke::action_blend_write(), armature_blend_write(), BKE_collection_blend_write_nolib(), brush_blend_write(), cache_file_blend_write(), camera_blend_write(), curve_blend_write(), curves_blend_write(), grease_pencil_blend_write(), greasepencil_blend_write(), image_blend_write(), lattice_blend_write(), library_blend_write_data(), light_blend_write(), lightprobe_blend_write(), linestyle_blend_write(), mask_blend_write(), material_blend_write(), mesh_blend_write(), metaball_blend_write(), movieclip_blend_write(), blender::bke::node_tree_blend_write(), object_blend_write(), paint_curve_blend_write(), palette_blend_write(), particle_settings_blend_write(), pointcloud_blend_write(), scene_blend_write(), screen_blend_write(), shapekey_blend_write(), sound_blend_write(), speaker_blend_write(), text_blend_write(), texture_blend_write(), vfont_blend_write(), volume_blend_write(), window_manager_blend_write(), workspace_blend_write(), and world_blend_write().
| bool BKE_id_can_be_asset | ( | const ID * | id | ) |
Definition at line 2505 of file lib_id.cc.
References BKE_idtype_idcode_is_linkable(), GS, ID_IS_EDITABLE, and ID_IS_OVERRIDE_LIBRARY.
Referenced by blender::ed::asset::copy_to_id(), blender::ed::asset::id_type_is_supported(), and blender::ed::asset::mark_id().
Check that a pointer from one ID to another is possible.
Taking into account lib linking and main database membership.
Definition at line 2528 of file lib_id.cc.
References ID_TAG_NO_MAIN, ID::lib, and ID::tag.
Referenced by RNA_property_pointer_poll().
Invoke the appropriate copy method for the block and return the new id as result.
See BKE_id_copy_ex for details.
Definition at line 782 of file lib_id.cc.
References BKE_id_copy_in_lib(), and LIB_ID_COPY_DEFAULT.
Referenced by action_create_new(), animdata_copy_id_action(), BKE_animdata_merge_copy(), BKE_gpencil_data_duplicate(), BKE_id_copy_for_use_in_bmain(), BKE_scene_duplicate(), brush_make_local(), copy_particle_systems_to_object(), blender::ed::object::duplibase_for_convert(), geometry_extract_apply(), blender::ed::object::get_object_for_conversion(), blender::ed::object::make_object_duplilist_real(), new_texture_exec(), nlaedit_apply_scale_exec(), nlaedit_make_single_user_exec(), blender::ed::space_node::node_group_ungroup(), paint_mask_slice_exec(), and separate_exec().
Generic entry point for copying a data-block (new API).
There are exceptions though:
| bmain | Main database, may be NULL only if LIB_ID_CREATE_NO_MAIN is specified. |
| id | Source data-block. |
| new_id_p | Pointer to new (copied) ID pointer, may be NULL. Used to allow copying into already allocated memory. |
| flag | Set of copy options, see DNA_ID.h enum for details (leave to zero for default, full copy). |
Definition at line 777 of file lib_id.cc.
References BKE_id_copy_in_lib(), and flag.
Referenced by blender::ed::object::apply_grease_pencil_for_modifier(), blender::ed::object::apply_grease_pencil_for_modifier_all_keyframes(), BKE_curves_copy_for_eval(), BKE_displist_make_curveTypes(), BKE_grease_pencil_copy_for_eval(), BKE_id_copy_for_duplicate(), BKE_lattice_modifiers_calc(), BKE_lib_id_make_local_generic(), BKE_lib_override_library_update(), BKE_mesh_copy_for_eval(), BKE_nlastrip_copy(), BKE_pointcloud_copy_for_eval(), BKE_volume_copy_for_eval(), clip_start_prefetch_job(), blender::ed::object::create_applied_mesh_for_modifier(), curve_from_curve_object(), curve_from_font_object(), do_hair_dynamics(), duplicate_ids(), blender::ed::space_node::duplicate_material(), flip_pose(), blender::ed::object::geometry_node_tree_copy_assign_exec(), blender::compositor::get_mask_raster_handles(), get_quick_mesh(), id_single_user(), blender::eevee::MaterialModule::MaterialModule(), mesh_new_from_mesh(), modify_mesh(), modify_mesh(), modify_mesh(), new_material_exec(), new_particle_settings_exec(), new_world_exec(), blender::bke::node_tree_copy_tree_ex(), normalEditModifier_do(), object_for_curve_to_mesh_create(), particle_settings_localize(), preview_get_localized_world(), psys_thread_context_init_distribute(), remap_hair_emitter(), blender::seq::seq_render_mask(), blender::ed::object::single_mat_users(), blender::ed::object::single_obdata_users(), blender::ed::object::single_object_users_collection(), and undomesh_from_editmesh().
| ID * BKE_id_copy_for_duplicate | ( | Main * | bmain, |
| ID * | id, | ||
| eDupli_ID_Flags | duplicate_flags, | ||
| int | copy_flags ) |
Invoke the appropriate copy method for the block and return the new id as result.
Unlike BKE_id_copy, it does set the ID.newid pointer of the given id to the copied one.
It is designed as a basic common helper for the higher-level 'duplicate' operations (aka 'deep copy' of data-blocks and some of their dependency ones), see e.g. BKE_object_duplicate.
Currently, it only handles the given ID, and their shape keys and actions if any, according to the given duplicate_flags.
| duplicate_flags | is of type eDupli_ID_Flags, see UserDef.dupflag. Currently only USER_DUP_LINKED_ID and USER_DUP_ACT have an effect here. |
| copy_flags | flags passed to BKE_id_copy_ex. |
Definition at line 787 of file lib_id.cc.
References BKE_animdata_duplicate_id_action(), BKE_id_copy_ex(), BKE_key_from_id(), ID_IS_LINKED, ID_NEW_SET, id_us_min(), ID::newid, and USER_DUP_LINKED_ID.
Referenced by BKE_brush_duplicate(), BKE_object_duplicate(), BKE_scene_duplicate(), collection_duplicate_recursive(), and blender::seq::strip_duplicate().
Special version of BKE_id_copy which is safe from using evaluated id as source with a copy result appearing in the main database. Takes care of the referenced data-blocks consistency.
Definition at line 851 of file lib_id.cc.
References BKE_id_copy(), BKE_key_from_id_p(), BKE_library_foreach_ID_link(), DEG_is_evaluated(), foreach_assign_id_to_orig_callback(), and IDWALK_NOP.
| struct ID * BKE_id_copy_in_lib | ( | Main * | bmain, |
| std::optional< Library * > | owner_library, | ||
| const ID * | id, | ||
| std::optional< const ID * > | new_owner_id, | ||
| ID ** | new_id_p, | ||
| int | flag ) |
Enable copying non-local data into libraries.
See BKE_id_copy_ex for details.
| owner_library | the Library to 'assign' the newly created ID to. Use nullptr to make ID not use any library (i.e. become a local ID). Use #std::nullopt for default behavior (i.e. behavior of the BKE_id_copy_ex function). |
| new_owner_id | When copying an embedded ID, the owner ID of the new copy. Should be nullopt for regular ID copying, or in case the owner ID is not (yet) known. |
Definition at line 675 of file lib_id.cc.
References BKE_idtype_get_info_from_id(), BKE_libblock_copy_in_lib(), BKE_library_foreach_ID_link(), BLI_assert, BLI_assert_msg, IDTypeInfo::copy_data, data, flag, ID::flag, IDTypeInfo::flags, id_copy_libmanagement_cb(), ID_FLAG_EMBEDDED_DATA, ID_IS_LINKED, ID_TAG_EXTERN, ID_TAG_INDIRECT, IDTYPE_FLAGS_NO_COPY, IDWALK_IGNORE_MISSING_OWNER_ID, ID::lib, lib_id_copy_ensure_local(), LIB_ID_CREATE_NO_ALLOCATE, LIB_ID_CREATE_NO_MAIN, and ID::tag.
Referenced by BKE_animdata_copy_in_lib(), BKE_id_copy(), BKE_id_copy_ex(), curve_copy_data(), lattice_copy_data(), blender::bke::greasepencil::convert::legacy_gpencil_sanitize_annotations(), lib_override_library_create_from(), light_copy_data(), linestyle_copy_data(), material_copy_data(), mesh_copy_data(), blender::bke::node_tree_localize(), pack_linked_id(), scene_copy_data(), texture_copy_data(), and world_copy_data().
| bool BKE_id_copy_is_allowed | ( | const ID * | id | ) |
Test whether given id can be copied or not.
Definition at line 666 of file lib_id.cc.
References ELEM, GS, ID_TYPE_IS_DEPRECATED, and LIB_ID_TYPES_NOCOPY.
Referenced by template_ID().
| void BKE_id_delete | ( | Main * | bmain, |
| void * | idv ) |
Properly delete a single ID from given bmain database.
Definition at line 395 of file lib_id_delete.cc.
References BKE_id_delete_ex().
Referenced by blender::bke::asset_edit_id_delete(), blender::bke::asset_reload(), BKE_blendfile_read_make_empty(), BKE_brush_delete(), BKE_collection_delete(), BKE_lib_override_library_create_from_tag(), blo_read_file_internal(), BLO_update_defaults_startup_blend(), blender::ed::object::clear_override_library_exec(), blender::ed::object::collection_unlink_exec(), blender::ed::object::convert_font_to_grease_pencil(), blender::bke::tests::ArmatureDeformTestBase::curves_test(), ED_scene_delete(), blender::bke::tests::ArmatureDeformTestBase::edit_mesh_test(), blender::bke::tests::ArmatureDeformTestBase::grease_pencil_test(), blender::bke::blendfile::PartialWriteContext::id_delete(), blender::ed::outliner::id_override_library_clear_single_process(), Freestyle::PythonInterpreter::interpretFile(), blender::bke::tests::ArmatureDeformTestBase::mesh_test(), blender::ed::outliner::outliner_object_delete_fn(), override_idtemplate_clear_exec(), blender::ed::vse::sequencer_clipboard_paste_exec(), blender::bke::tests::TEST(), text_unlink_exec(), blender::ed::object::volume_import_exec(), and blender::bke::blendfile::PartialWriteContext::write().
| void BKE_id_delete_ex | ( | Main * | bmain, |
| void * | idv, | ||
| const int | extra_remapping_flags ) |
Like BKE_id_delete, but with extra corner-case options.
| extra_remapping_flags | Additional ID_REMAP_ flags to pass to remapping code when ensuring that deleted IDs are not used by any other ID in given bmain. Typical example would be e.g. ID_REMAP_FORCE_UI_POINTERS, required when default UI-handling callbacks of remapping code won't be working (e.g. from readfile code). |
Referenced by BLO_main_validate_shapekeys().
Copy relatives parameters, from id to id_cow. Use handle the ID_RECALC_PARAMETERS tag.
Definition at line 18 of file lib_id_eval.cc.
References BKE_mesh_copy_parameters(), BLI_assert, BLI_assert_unreachable, GS, ID_ME, ID_TAG_COPIED_ON_EVAL, ID_TYPE_SUPPORTS_PARAMS_WITHOUT_COW, ID::name, and ID::tag.
Referenced by blender::deg::DepsgraphNodeBuilder::build_parameters().
| void BKE_id_free | ( | Main * | bmain, |
| void * | idv ) |
Complete ID freeing, should be usable in most cases (even for out-of-Main IDs).
See BKE_id_free_ex description for full details.
| bmain | Main database containing the freed ID, can be NULL in case it's a temp ID outside of any Main. |
| idv | Pointer to ID to be freed. |
Definition at line 223 of file lib_id_delete.cc.
References BKE_id_free_ex().
Referenced by add_nodes(), arrayModifier_doArray(), blender::ed::object::bake(), BKE_crazyspace_build_sculpt(), BKE_crazyspace_get_first_deform_matrices_editbmesh(), BKE_grease_pencil_nomain_to_grease_pencil(), BKE_id_free_us(), BKE_image_merge(), BKE_lib_override_library_resync(), BKE_materials_exit(), BKE_mesh_eval_geometry(), BKE_mesh_mirror_apply_mirror_on_axis_for_modifier(), BKE_mesh_nomain_to_mesh(), BKE_object_free_caches(), BKE_object_free_derived_caches(), BKE_object_to_curve_clear(), BKE_object_to_mesh_clear(), BKE_pointcloud_nomain_to_pointcloud(), BKE_sculpt_get_first_deform_matrices(), BKE_workspace_layout_remove(), BKE_workspace_remove(), bpy_bmesh_from_object(), BPy_GeometrySet_dealloc(), BPy_InlineShaderNodes_dealloc(), C_BVHTree_FromObject(), canvas_copyMesh(), blender::bke::CurveComponent::clear(), blender::bke::GreasePencilComponent::clear(), blender::bke::MeshComponent::clear(), blender::bke::PointCloudComponent::clear(), blender::bke::VolumeComponent::clear(), blender::ed::transform::SnapCache_EditMesh::clear(), blender::io::obj::OBJMesh::clear(), cloth_build_springs(), construct_param_handle_subsurfed(), blender::ed::object::convert_curves_legacy_to_grease_pencil(), blender::ed::object::convert_font_to_curves(), blender::ed::object::convert_font_to_grease_pencil(), blender::ed::object::convert_grease_pencil_to_mesh(), blender::io::ply::convert_ply_to_mesh(), blender::ed::object::create_applied_mesh_for_modifier(), blender::ed::animrig::create_pose_asset_user_library(), deform_verts(), deform_verts(), distribute_particles_on_dm(), do_hair_dynamics(), blender::io::alembic::ABCCurveWriter::do_write(), blender::io::usd::USDCurvesWriter::do_write(), dynamicPaint_brushMeshCalculateVelocity(), dynamicPaint_Modifier_apply(), dynamicPaint_Modifier_free_runtime(), dynamicPaint_paintMesh(), ED_workspace_delete(), blender::bke::editbmesh_calc_modifiers(), blender::nodes::materialx::export_to_materialx(), blender::ed::greasepencil::fill_strokes(), final_skin(), fluid_modifier_freeEffector(), fluid_modifier_freeFlow(), free_data(), free_data(), blender::io::alembic::ABCGenericMeshWriter::free_export_mesh(), blender::io::alembic::ABCMetaballWriter::free_export_mesh(), blender::io::usd::USDGenericMeshWriter::free_export_mesh(), blender::io::usd::USDMetaballWriter::free_export_mesh(), blender::io::usd::USDTextWriter::free_export_mesh(), blender::ed::sculpt_paint::trim::free_geometry(), free_hair(), blender::bke::free_mesh_eval(), free_object_to_mesh(), geometry_extract_apply(), blender::compositor::get_mask_raster_handles(), GPU_material_from_nodetree(), knifeproject_poly_from_object(), lib_override_library_main_resync_on_library_indirect_level(), lineart_geometry_object_load(), blender::io::ply::load_plydata(), blender::geometry::boolean::mesh_boolean_float(), blender::bke::mesh_calc_modifiers(), mesh_new_from_curve_type_object(), mesh_new_from_mesh_object_with_layers(), mesh_remove_doubles_on_axis(), blender::bke::tests::ArmatureDeformTestBase::mesh_test(), mesh_wrapper_ensure_subdivision(), mirror_apply_on_axis(), mirrorModifier__doMirror(), blender::ed::object::modifier_apply_shape(), modify_mesh(), modify_mesh(), multiresModifier_reshapeFromDeformModifier(), blender::nodes::node_geo_deform_curves_on_surface_cc::node_geo_exec(), blender::ed::space_node::node_group_ungroup(), object_for_curve_to_mesh_free(), blender::ed::object::object_force_modifier_update_for_bind(), paint_mask_slice_exec(), poselib_blend_free(), blender::io::usd::process_usdz_textures(), psys_thread_context_init_distribute(), blender::ed::object::quadriflow_start_job(), RE_bake_normal_world_to_tangent(), RE_bake_pixels_populate_from_objects(), RE_multires_bake_images(), read_libblock(), remap_hair_emitter(), blender::ed::object::remesh_symmetry_bisect(), blender::ed::object::remesh_symmetry_mirror(), blender::seq::seq_render_mask(), blender::ed::space_node::shader_preview_free(), blender::ed::sculpt_paint::store_mesh_from_eval(), blender::ed::geometry::store_result_geometry(), subdivide_edit_mesh(), blender::bke::tests::PaintBVHTest::TearDown(), blender::ed::sculpt_paint::tests::MeshTests::TearDown(), blender::ed::sculpt_paint::undo::tests::SculptUndoTest::TearDown(), blender::animrig::tests::TEST(), blender::bke::greasepencil::tests::TEST(), blender::bke::greasepencil::tests::TEST(), blender::bke::greasepencil::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::ed::greasepencil::tests::TEST(), blender::ed::greasepencil::tests::TEST(), blender::ed::greasepencil::tests::TEST(), blender::ed::greasepencil::tests::TEST(), blender::ed::greasepencil::tests::TEST(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::bke::tests::TEST_F(), blender::ed::animation::tests::TEST_F(), blender::bke::bake::try_load_curves(), blender::bke::bake::try_load_grease_pencil(), blender::bke::bake::try_load_mesh(), blender::bke::bake::try_load_pointcloud(), undomesh_free_data(), blender::ed::sculpt_paint::trim::update_normals(), blender::ed::object::voxel_remesh_exec(), blender::bke::tests::IDSubDataTestData::~IDSubDataTestData(), blender::eevee::LookdevWorld::~LookdevWorld(), blender::eevee::MaterialModule::~MaterialModule(), and blender::eevee::World::~World().
| void BKE_id_free_ex | ( | Main * | bmain, |
| void * | idv, | ||
| int | flag_orig, | ||
| bool | use_flag_from_idtag ) |
Complete ID freeing, extended version for corner cases. Can override default (and safe!) freeing process, to gain some speed up.
At that point, given id is assumed to not be used by any other data-block already (might not be actually true, in case e.g. several inter-related IDs get freed together...). However, they might still be using (referencing) other IDs, this code takes care of it if ID_TAG_NO_USER_REFCOUNT is not defined.
| bmain | Main database containing the freed ID, can be NULL in case it's a temp ID outside of any Main. |
| idv | Pointer to ID to be freed. |
| flag_orig | Set of LIB_ID_FREE_... flags controlling/overriding usual freeing process, 0 to get default safe behavior. |
| use_flag_from_idtag | Still use freeing info flags from given ID data-block, even if some overriding ones are passed in flag parameter. |
Definition at line 197 of file lib_id_delete.cc.
References BKE_layer_collection_resync_allow(), BKE_layer_collection_resync_forbid(), BKE_main_collection_sync_remap(), ELEM, GS, id_free(), ID_GR, ID_OB, ID_SCE, LIB_ID_FREE_NO_MAIN, and name.
Referenced by BKE_id_free(), BKE_lib_override_library_update(), BKE_main_clear(), and blender::ed::sculpt_paint::greasepencil::PaintOperation::toggle_fill_guides_brush_off().
| void BKE_id_free_us | ( | Main * | bmain, |
| void * | idv ) |
Not really a freeing function by itself, it decrements user-count of given id, and only frees it if it reaches 0.
Definition at line 228 of file lib_id_delete.cc.
References BKE_id_free(), BKE_libblock_unlink(), BKE_library_main_rebuild_hierarchy(), GS, ID_IS_LINKED, ID_LI, ID_OB, id_us_clear_real(), and id_us_min().
Referenced by blender::ed::space_node::add_node_group_asset(), animchannels_delete_exec(), BKE_object_shapekey_free(), collection_object_remove_no_gobject_hash(), ED_workspace_delete(), gpencil_layer_remove_exec(), blender::io::usd::import_endjob(), import_endjob(), and WM_drag_free_imported_drag_ID().
| void BKE_id_full_name_get | ( | char | name[MAX_ID_FULL_NAME], |
| const ID * | id, | ||
| char | separator_char ) |
Generate full name of the data-block (without ID code, but with library if any).
| name | An allocated string of minimal length MAX_ID_FULL_NAME, will be filled with generated string. |
| separator_char | Character to use for separating name and library name. Can be 0 to use default (' '). |
Definition at line 2432 of file lib_id.cc.
References BKE_id_name(), BLI_strncpy(), ID_IS_LINKED, MAX_ID_FULL_NAME, and name.
Referenced by BKE_id_full_name_ui_prefix_get(), blender::seq::effect_text_font_load(), and blender::render::hydra::FinalEngine::render().
| void BKE_id_full_name_ui_prefix_get | ( | char | name[MAX_ID_FULL_NAME_UI], |
| const ID * | id, | ||
| bool | add_lib_hint, | ||
| char | separator_char, | ||
| int * | r_prefix_len ) |
Generate full name of the data-block (without ID code, but with library if any), with a 2 to 3 character prefix prepended indicating whether it comes from a library, is overriding, has a fake or no user, etc.
| name | An allocated string of minimal length MAX_ID_FULL_NAME_UI, will be filled with generated string. |
| separator_char | Character to use for separating name and library name. Can be 0 to use default (' '). |
| r_prefix_len | The length of the prefix added. |
Definition at line 2449 of file lib_id.cc.
References BKE_id_full_name_get(), i, ID_FLAG_FAKEUSER, ID_IS_OVERRIDE_LIBRARY, ID_MISSING, MAX_ID_FULL_NAME_UI, and name.
Referenced by add_collection_search_item(), id_search_add(), and ui_rna_collection_search_update_fn().
Check if that ID can be considered as editable from a high-level (editor) perspective.
Definition at line 2523 of file lib_id.cc.
References BKE_lib_override_library_is_system_defined(), and ID_IS_EDITABLE.
Referenced by action_unlink_poll(), blender::ed::object::bake_simulation::bake_simulation_validate_paths(), blender::ed::object::bake_simulation::collect_simulations_to_bake(), blender::ed::outliner::collection_flag_exec(), copy_particle_systems_to_object(), blender::ed::transform::createTransObject(), blender::ed::transform::createTransSculpt(), blender::ed::outliner::datastack_drop_init(), depthdropper_init(), depthdropper_poll(), depthdropper_test(), blender::ed::outliner::do_outliner_item_posemode_toggle(), draw_setting_widget(), blender::ed::object::drop_named_material_invoke(), ED_editors_init(), ED_object_posemode_enter(), ED_object_posemode_enter_ex(), ED_operator_node_editable(), ED_operator_object_active_editable_ex(), ED_operator_posemode_local(), ED_operator_scene_editable(), ED_operator_sequencer_scene(), ED_operator_sequencer_scene_editable(), edbm_separate_exec(), blender::ed::object::edit_modifier_poll_generic(), blender::ed::object::edit_shaderfx_poll_generic(), blender::ed::geometry::geometry_attributes_poll(), initFlyInfo(), initWalkInfo(), insert_key(), lib_id_fake_user_toggle_exec(), blender::ed::object::make_links_data_exec(), blender::ed::object::make_links_scene_exec(), blender::ed::outliner::material_drop_invoke(), merge_actions_selection_exec(), merge_actions_selection_poll(), blender::ed::object::object_convert_exec(), blender::ed::curves::object_has_editable_curves(), blender::ed::geometry::object_has_editable_data(), blender::ed::pointcloud::object_has_editable_pointcloud(), blender::ed::object::object_origin_set_exec(), blender::ed::object::object_transform_to_mouse_exec(), blender::ed::outliner::outliner_color_tag_set_exec(), blender::ed::outliner::parent_drop_set_parents(), poselib_keytag_pose(), blender::ed::object::posemode_exec(), blender::ed::outliner::scene_drop_invoke(), blender::ed::object::shade_smooth_exec(), blender::ed::object::bake_simulation::simulate_to_frame_startjob(), blender::ed::object::single_mat_users(), blender::ed::object::single_obdata_users(), blender::ed::object::single_object_action_users(), blender::ed::object::single_objectdata_action_users(), blender::ed::transform::special_aftertrans_update__sculpt(), text_edit_poll(), text_region_edit_poll(), text_space_edit_poll(), view3d_camera_to_view_poll(), WIDGETGROUP_armature_spline_poll(), WIDGETGROUP_camera_poll(), WIDGETGROUP_camera_view_poll(), WIDGETGROUP_empty_image_poll(), WIDGETGROUP_forcefield_poll(), WIDGETGROUP_light_area_poll(), WIDGETGROUP_light_point_poll(), WIDGETGROUP_light_spot_poll(), WIDGETGROUP_light_target_poll(), and WIDGETGROUP_placement_poll().
| bool BKE_id_is_in_global_main | ( | ID * | id | ) |
Check that given ID pointer actually is in G_MAIN. Main intended use is for debug asserts in places we cannot easily get rid of G_MAIN.
Definition at line 2500 of file lib_id.cc.
References BKE_id_is_in_main(), and G_MAIN.
Referenced by bpy_bmesh_to_mesh(), pygpu_offscreen_draw_view3d(), and pyrna_struct_keyframe_insert().
Check that given ID pointer actually is in given bmain.
Definition at line 2493 of file lib_id.cc.
References BLI_findindex(), GS, and which_libbase().
Referenced by BKE_id_is_in_global_main(), and BKE_libblock_rename().
For newly created IDs, move it into same library as owner ID. This assumes the ID is local.
Definition at line 879 of file lib_id.cc.
References BKE_id_name(), BKE_id_new_name_validate(), BKE_main_namemap_remove_id(), BLI_assert_msg, GS, ID_IS_LINKED, ID_TAG_INDIRECT, ID::lib, name, RenameExistingNever, and which_libbase().
Referenced by image_new_exec(), image_open_exec(), new_material_exec(), new_texture_exec(), new_world_exec(), blender::ed::space_node::node_group_make_from_nodes(), blender::ed::space_node::node_templateID_assign(), and paintcurve_for_brush_add().
| size_t BKE_id_multi_delete | ( | Main * | bmain, |
| blender::Set< ID * > & | ids_to_delete ) |
Properly delete all IDs from ids_to_delete, from given bmain database.
This is more efficient than calling BKE_id_delete repetitively on a large set of IDs (several times faster when deleting most of the IDs at once).
Definition at line 413 of file lib_id_delete.cc.
References id_delete().
Referenced by BKE_blendfile_link_pack(), blendfile_relocate_postprocess_cleanup(), and bpy_batch_remove().
| void size_t BKE_id_multi_tagged_delete | ( | Main * | bmain | ) |
Properly delete all IDs tagged with ID_TAG_DOIT, in given bmain database.
This is more efficient than calling BKE_id_delete repetitively on a large set of IDs (several times faster when deleting most of the IDs at once).
Definition at line 400 of file lib_id_delete.cc.
References blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), FOREACH_MAIN_ID_BEGIN, FOREACH_MAIN_ID_END, id_delete(), ID_TAG_DOIT, and ID::tag.
Referenced by BKE_blendfile_append(), BKE_lib_override_library_delete(), bpy_orphans_purge(), lib_override_cleanup_after_resync(), lib_override_library_main_resync_on_library_indirect_level(), lib_override_library_resync(), blender::ed::object::object_delete_exec(), blender::ed::outliner::outliner_batch_delete_object_hierarchy(), blender::ed::outliner::outliner_id_delete_invoke(), blender::ed::outliner::outliner_id_operation_exec(), blender::ed::outliner::outliner_lib_operation_exec(), blender::ed::outliner::outliner_orphans_purge_exec(), and blender::bke::blendfile::PartialWriteContext::remove_unused().
|
inline |
Get the name (without type prefix) of the ID.
Definition at line 917 of file BKE_lib_id.hh.
Referenced by add_archive_library(), blender::ed::object::add_grease_pencil_materials_for_conversion(), blender::ed::space_node::add_node_group_asset(), blender::bke::asset_reload(), BKE_blendfile_library_relocate(), BKE_blendfile_link_pack(), BKE_id_full_name_get(), BKE_id_move_to_same_lib(), BKE_id_new_name_validate(), BKE_id_to_unique_string_key(), BKE_libblock_copy_in_lib(), BKE_libblock_rename(), BKE_main_id_repair_duplicate_names_listbase(), BKE_main_namemap_remove_id(), blo_add_main_for_library(), BPy_InlineShaderNodes_static_from_light(), BPy_InlineShaderNodes_static_from_material(), BPy_InlineShaderNodes_static_from_world(), blender::ed::object::GeometryToObjectsBuilder::build_collection_for_geometry(), blender::ed::spreadsheet::IDViewerPathItem::build_row(), buttons_texture_user_mtex_add(), blender::ed::object::convert_curves_legacy_to_grease_pencil(), blender::ed::object::convert_font_to_curves(), blender::ed::object::convert_font_to_grease_pencil(), blender::ed::object::convert_mesh_to_grease_pencil(), direct_link_id_embedded_id(), blender::io::usd::USDPointInstancerWriter::do_write(), blender::ed::spreadsheet::draw_context_panel(), ED_mesh_shapes_join_objects_exec(), blender::bke::library::ensure_archive_library(), blender::bke::Instances::ensure_geometry_instances(), blender::io::fbx::ArmatureImportContext::find_armatures(), foreach_libblock_append_add_dependencies_callback(), foreach_libblock_link_finalize_cb(), blender::ed::object::GeometryToObjectsBuilder::get_objects_for_geometry(), blender::ed::object::is_smooth_by_angle_modifier(), blender::asset_system::AssetRepresentation::library_relative_identifier(), main_namemap_validate_and_fix(), blender::ed::object::mesh_to_grease_pencil_get_material_list(), blender::ed::object::mode_set_ex(), blender::ed::space_node::node_find_create_data_block_value(), blender::ed::space_node::node_find_update_fn(), blender::ed::space_node::node_group_make_from_node_declaration(), blender::ed::space_node::node_swap_group_asset_invoke(), blender::ed::outliner::outliner_id_relocate_invoke(), UniqueName_Map::populate(), scene_preview_render(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::animrig::tests::TEST_F(), blender::ed::space_node::ui_node_link_items(), blender::ed::viewer_path::viewer_path_elem_for_compute_context(), and wm_id_linked_relocate_exec().
|
inline |
Definition at line 921 of file BKE_lib_id.hh.
Definition at line 186 of file BKE_lib_id.hh.
References BKE_id_new(), name, and T.
| void * BKE_id_new | ( | Main * | bmain, |
| short | type, | ||
| const char * | name ) |
Generic helper to create a new empty data-block of given type in given bmain database.
Definition at line 1514 of file lib_id.cc.
References BKE_id_new_in_lib(), and name.
Referenced by blender::animrig::tests::ActionQueryTest::action_new(), add_archive_library(), blender::bke::tests::add_id_in_library(), BKE_action_add(), BKE_armature_add(), BKE_brush_add(), BKE_cachefile_add(), BKE_camera_add(), BKE_curves_add(), BKE_grease_pencil_add(), BKE_id_new(), BKE_key_add(), BKE_lattice_add(), BKE_light_add(), BKE_lightprobe_add(), BKE_material_add(), BKE_mball_add(), BKE_mesh_add(), BKE_paint_curve_add(), BKE_palette_add(), BKE_particlesettings_add(), BKE_pointcloud_add(), BKE_scene_add(), BKE_speaker_add(), BKE_text_add(), BKE_texture_add(), BKE_volume_add(), BKE_workspace_add(), BKE_world_add(), blo_add_main_for_library(), collection_add(), blender::ed::object::convert_curves_component_to_curves(), blender::ed::object::convert_curves_to_grease_pencil(), blender::ed::object::convert_curves_to_mesh(), blender::ed::object::convert_grease_pencil_component_to_curves(), blender::ed::object::convert_grease_pencil_to_mesh(), blender::animrig::tests::ActionLegacyTest::create_empty_action(), blender::bke::tests::ArmatureDeformTestBase::create_test_armature_object(), blender::ed::greasepencil::tests::GreasePencilIDTestContext::GreasePencilIDTestContext(), lib_override_library_create_post_process(), movieclip_alloc(), blender::animrig::nla::tests::NLASlottedActionTest::SetUp(), blender::animrig::tests::ActionFilterTest::SetUp(), blender::animrig::tests::ActionIteratorsTest::SetUp(), blender::animrig::tests::ActionLayersTest::SetUp(), blender::animrig::tests::AnimationEvaluationTest::SetUp(), blender::animrig::tests::AnimDrawTest::SetUp(), blender::animrig::tests::KeyframingTest::SetUp(), blender::animrig::tests::PoseTest::SetUp(), blender::bke::tests::BPathTest::SetUp(), blender::editor::animation::tests::KeylistSummaryTest::SetUp(), BlendfileLoadingBaseTest::SetUpTestCase(), blender::bke::greasepencil::tests::TEST(), blender::bke::greasepencil::tests::TEST(), blender::bke::greasepencil::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::asset_system::tests::TEST_F(), blender::asset_system::tests::TEST_F(), blender::bke::tests::TEST_F(), blender::bke::tests::TEST_F(), blender::bke::tests::TEST_F(), TEST_F(), and TEST_F().
| void * BKE_id_new_in_lib | ( | Main * | bmain, |
| std::optional< Library * > | owner_library, | ||
| short | type, | ||
| const char * | name ) |
Same as for BKE_id_new, but allows creating a data-block for (within) a given owner library.
| owner_library | the Library to 'assign' the newly created ID to. Use nullptr to make ID not use any library (i.e. become a local ID). Use std::nullopt for default behavior (i.e. behavior of the BKE_id_new function). |
Definition at line 1496 of file lib_id.cc.
References BKE_idtype_idcode_to_name(), BKE_libblock_alloc_in_lib(), BKE_libblock_init_empty(), BLI_assert, DATA_, and name.
Referenced by BKE_id_new(), blender::bke::blendfile::PartialWriteContext::id_create(), blender::bke::greasepencil::convert::legacy_gpencil_object(), and blender::bke::greasepencil::convert::legacy_main().
| IDNewNameResult BKE_id_new_name_validate | ( | Main & | bmain, |
| ListBase & | lb, | ||
| ID & | id, | ||
| const char * | newname, | ||
| IDNewNameMode | mode, | ||
| bool | do_linked_data ) |
Optionally set the given ID's name from given parameter, and ensure that the ID has a unique name in given listbase.
Uniqueness is only ensured within the ID's library (nullptr for local ones), libraries act as some kind of namespace for IDs.
| newname | The new name of the given ID, if nullptr the current given ID name is used instead. If the given ID has no name (or the given name is an empty string), the default matching data name is used as a fallback. |
| do_linked_data | if true, also ensure a unique name in case the given ID is linked (otherwise, just ensure that it is properly sorted). |
Definition at line 1903 of file lib_id.cc.
References BKE_id_name(), BKE_idtype_idcode_to_name(), BKE_libblock_find_name(), BKE_main_namemap_get_unique_name(), BLI_assert, BLI_str_utf8_invalid_strip(), BLI_string_split_name_number(), BLI_strncpy(), DATA_, ELEM, GS, ID_IS_LINKED, id_sort_by_name(), lib, MAX_ID_NAME, ID::name, name, IDNewNameResult::RENAMED_COLLISION_ADJUSTED, IDNewNameResult::RENAMED_COLLISION_FORCED, IDNewNameResult::RENAMED_NO_COLLISION, RenameExistingAlways, RenameExistingSameRoot, result, STREQ, STRNCPY(), STRNCPY_UTF8, IDNewNameResult::UNCHANGED, and IDNewNameResult::UNCHANGED_COLLISION.
Referenced by BKE_id_move_to_same_lib(), BKE_lib_id_clear_library_data(), BKE_libblock_alloc_in_lib(), BKE_libblock_management_main_add(), BKE_libblock_rename(), BKE_main_id_repair_duplicate_names_listbase(), long_id_names_ensure_unique_id_names(), main_namemap_validate_and_fix(), reuse_bmain_move_id(), and versions_gpencil_add_main().
Definition at line 211 of file BKE_lib_id.hh.
References BKE_id_new_nomain(), name, and T.
| void * BKE_id_new_nomain | ( | short | type, |
| const char * | name ) |
Generic helper to create a new temporary empty data-block of given type, outside of any Main database.
Definition at line 1519 of file lib_id.cc.
References BKE_idtype_idcode_to_name(), BKE_libblock_alloc(), BKE_libblock_init_empty(), DATA_, LIB_ID_CREATE_NO_DEG_TAG, LIB_ID_CREATE_NO_MAIN, LIB_ID_CREATE_NO_USER_REFCOUNT, and name.
Referenced by BKE_grease_pencil_new_nomain(), BKE_id_new_nomain(), BKE_mesh_from_bmesh_for_eval_nomain(), BKE_mesh_from_bmesh_nomain(), BKE_mesh_new_nomain_from_template_ex(), BKE_mesh_wrapper_from_editmesh(), BKE_volume_new_for_eval(), blender::ed::object::convert_grease_pencil_component_to_curves(), blender::ed::object::convert_grease_pencil_to_mesh(), blender::ed::sculpt_paint::greasepencil::create_fill_guide_brush(), blender::nodes::node_geo_mesh_primitive_ico_sphere_cc::create_ico_sphere_mesh(), blender::ed::transform::create_mesh(), blender::bke::curves_new_nomain(), blender::bke::curves_new_nomain(), blender::ed::spreadsheet::geometry_display_data_get(), blender::bke::CurveComponent::get_curve_for_render(), blender::eevee::LookdevWorld::LookdevWorld(), blender::nodes::geo_eval_log::ViewerNodeLog::main_geometry(), material_default_create(), blender::eevee::MaterialModule::MaterialModule(), mesh_new_from_mball_object(), mesh_to_volume(), blender::nodes::node_geo_import_vdb::node_geo_exec(), blender::nodes::node_geo_volume_cube_cc::node_geo_exec(), blender::bke::pointcloud_new_no_attributes(), blender::animrig::tests::TEST(), blender::bke::greasepencil::tests::TEST(), blender::bke::greasepencil::tests::TEST(), blender::bke::greasepencil::tests::TEST(), blender::animrig::tests::TEST_F(), blender::bke::tests::TEST_F(), blender::geometry::tests::TEST_F(), TEST_F(), and TEST_F().
| void BKE_id_newptr_and_tag_clear | ( | ID * | id | ) |
Definition at line 412 of file lib_id.cc.
References BKE_id_newptr_and_tag_clear(), BKE_key_from_id(), GS, bNodeTree::id, Collection::id, Key::id, ID_SCE, ID_TAG_NEW, and blender::bke::node_tree_from_id().
Referenced by BKE_id_newptr_and_tag_clear(), BKE_main_id_newptr_and_tag_clear(), blender::ed::outliner::id_local_fn(), and template_id_cb().
| blender::Vector< ID * > BKE_id_ordered_list | ( | const ListBase * | lb | ) |
Returns ordered list of data-blocks for display in the UI.
Definition at line 2576 of file lib_id.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), blender::Vector< T, InlineBufferCapacity, Allocator >::begin(), blender::Vector< T, InlineBufferCapacity, Allocator >::end(), i, id_order_compare(), id_order_get(), blender::Vector< T, InlineBufferCapacity, Allocator >::index_range(), and LISTBASE_FOREACH.
Referenced by ED_workspace_delete(), space_workspace_cycle_invoke(), and template_ID_tabs().
Return the owner ID of the given id, if any.
| debug_relationship_assert | True by default, whether to perform debug checks on validity of the pointers between owner and embedded IDs. In some cases, these relations are not yet (fully) valid, e.g. during ID copying. |
Definition at line 2511 of file lib_id.cc.
References BKE_idtype_get_info_from_id(), and IDTypeInfo::owner_pointer_get.
Referenced by BKE_lib_override_library_get(), blender::ed::outliner::collection_duplicate_exec(), blender::animrig::find_related_ids(), blender::animrig::id_action_ensure(), blender::bke::blendfile::PartialWriteContext::id_add(), lib_query_unused_ids_tag_recurse(), libblock_remap_data(), library_foreach_ID_link(), blender::ed::outliner::outliner_collection_delete(), RNA_find_real_ID_and_path(), and blender::bke::NodeTreeMainUpdater::update_rooted().
| IDNewNameResult BKE_id_rename | ( | Main & | bmain, |
| ID & | id, | ||
| blender::StringRefNull | name, | ||
| const IDNewNameMode | mode = IDNewNameMode::RenameExistingNever ) |
Like BKE_libblock_rename, but also performs additional higher-level updates like depsgraph tagging when renaming Meta-ball objects, etc.
Definition at line 2392 of file lib_id.cc.
References BKE_libblock_rename(), BLI_assert, DEG_id_tag_update(), GS, Object::id, ID_OB, ID_RECALC_GEOMETRY, ID_RECALC_SYNC_TO_EVAL, name, OB_MBALL, IDNewNameResult::RENAMED_COLLISION_ADJUSTED, IDNewNameResult::RENAMED_COLLISION_FORCED, IDNewNameResult::RENAMED_NO_COLLISION, result, Object::type, IDNewNameResult::UNCHANGED, and IDNewNameResult::UNCHANGED_COLLISION.
Referenced by blender::ed::animrig::create_pose_asset_local(), ED_id_rename(), blender::asset_system::tests::TEST_F(), and blender::asset_system::tests::TEST_F().
Reorder ID in the list, before or after the "relative" ID.
Definition at line 2595 of file lib_id.cc.
References BLI_listbase_count(), id_order_get(), and LISTBASE_FOREACH.
Referenced by workspace_append_activate_exec(), workspace_reorder_to_back_exec(), and workspace_reorder_to_front_exec().
| void BKE_id_tag_clear_atomic | ( | ID * | id, |
| int | tag ) |
Definition at line 2488 of file lib_id.cc.
References atomic_fetch_and_and_int32().
| void BKE_id_tag_set_atomic | ( | ID * | id, |
| int | tag ) |
Definition at line 2483 of file lib_id.cc.
References atomic_fetch_and_or_int32().
| char * BKE_id_to_unique_string_key | ( | const ID * | id | ) |
Generate a concatenation of ID name (including two-chars type code) and its lib name, if any.
Definition at line 2470 of file lib_id.cc.
References BKE_id_name(), BLI_sprintfN(), BLI_strdup(), and ID_IS_LINKED.
Pull an ID out of a library (make it local). Only call this for IDs that don't have other library users.
| flags | Same set of LIB_ID_MAKELOCAL_ flags as passed to BKE_lib_id_make_local. |
Definition at line 208 of file lib_id.cc.
References IDTypeInfo::asset_type_info, BKE_asset_metadata_free(), BKE_id_new_name_validate(), BKE_idtype_get_info_from_id(), BKE_key_from_id(), BKE_lib_id_clear_library_data(), BKE_lib_libblock_session_uid_renew(), BKE_library_foreach_ID_link(), BKE_main_namemap_remove_id(), DEG_id_tag_update_ex(), DEG_relations_tag_update(), ELEM, FOREACH_MAIN_ID_BEGIN, FOREACH_MAIN_ID_END, GS, Key::id, id_fake_user_clear(), id_fake_user_set(), ID_FLAG_EMBEDDED_DATA, ID_FLAG_INDIRECT_WEAK_LINK, ID_FLAG_LINKED_AND_PACKED, ID_IS_ASSET, ID_RECALC_SYNC_TO_EVAL, ID_TAG_EXTERN, ID_TAG_INDIRECT, ID_TAG_NO_MAIN, ID_TAG_TEMP_MAIN, IDWALK_READONLY, Main::is_memfile_undo_written, LIB_ID_MAKELOCAL_ASSET_DATA_CLEAR, AssetTypeInfo::on_clear_asset_fn, RenameExistingNever, result, IDNewNameResult::UNCHANGED, IDNewNameResult::UNCHANGED_COLLISION, and which_libbase().
Referenced by BKE_lib_id_clear_library_data(), BKE_lib_id_make_local_generic(), BKE_library_make_local(), brush_make_local(), and lib_id_expand_local_cb().
Expand ID usages of given id as 'extern' (and no more indirect) linked data. Used by ID copy/make_local functions.
Definition at line 481 of file lib_id.cc.
References BKE_library_foreach_ID_link(), IDWALK_READONLY, lib_id_expand_local_cb(), and POINTER_FROM_INT.
Referenced by BKE_lib_id_make_local_generic(), BKE_library_make_local(), brush_make_local(), and lib_id_copy_ensure_local().
Calls the appropriate make_local method for the block, unless test is set.
| flags | Special flag used when making a whole library's content local, it needs specific handling. |
Definition at line 598 of file lib_id.cc.
References BKE_idtype_get_info_from_id(), BKE_lib_id_make_local_generic(), BLI_assert, BLI_assert_msg, IDTypeInfo::flags, ID_TAG_INDIRECT, IDTYPE_FLAGS_NO_LIBLINKING, LIB_ID_MAKELOCAL_FULL_LIBRARY, LIB_ID_MAKELOCAL_INDIRECT, and IDTypeInfo::make_local.
Referenced by blender::bke::asset_edit_id_ensure_local(), BKE_blendfile_append(), BKE_library_make_local(), blender::ed::outliner::id_local_fn(), make_selected_objects_local(), template_id_cb(), and blender::bke::tests::TEST().
Generic 'make local' function, works for most of data-block types.
Definition at line 544 of file lib_id.cc.
References BKE_id_copy_ex(), BKE_key_from_id(), BKE_lib_id_clear_library_data(), BKE_lib_id_expand_local(), BKE_lib_id_make_local_generic_action_define(), BKE_lib_override_library_make_local(), BKE_libblock_remap(), GS, ID_IS_LINKED, ID_NEW_SET, ID_REMAP_SKIP_INDIRECT_USAGE, ID_SCE, LIB_ID_COPY_DEFAULT, LIB_ID_COPY_NO_LIB_OVERRIDE, LIB_ID_MAKELOCAL_FULL_LIBRARY, LIB_ID_MAKELOCAL_LIBOVERRIDE_CLEAR, blender::bke::node_tree_from_id(), and ID::us.
Referenced by BKE_lib_id_make_local().
| void BKE_lib_id_make_local_generic_action_define | ( | Main * | bmain, |
| ID * | id, | ||
| int | flags, | ||
| bool * | r_force_local, | ||
| bool * | r_force_copy ) |
Helper to decide whether given id can be directly made local, or needs to be copied. r_force_local and r_force_copy cannot be true together. But both can be false, in case no action should be performed.
Definition at line 502 of file lib_id.cc.
References BKE_library_ID_test_usages(), BLI_assert, LIB_ID_MAKELOCAL_FORCE_COPY, LIB_ID_MAKELOCAL_FORCE_LOCAL, and LIB_ID_MAKELOCAL_FULL_LIBRARY.
Referenced by BKE_lib_id_make_local_generic(), and brush_make_local().
| void BKE_lib_id_swap | ( | Main * | bmain, |
| ID * | id_a, | ||
| ID * | id_b, | ||
| const bool | do_self_remap, | ||
| const int | self_remap_flags ) |
Does a mere memory swap over the whole IDs data (including type-specific memory).
| bmain | May be NULL, in which case there is no guarantee that internal remapping of ID pointers to themselves will be complete (regarding depsgraph and/or runtime data updates). |
| do_self_remap | Whether to remap internal pointers to itself or not. |
| self_remap_flags | Flags controlling self remapping, see BKE_lib_remap.hh. |
Definition at line 1056 of file lib_id.cc.
References id_swap().
Referenced by lib_override_id_swap(), and palette_undo_preserve().
| void BKE_lib_id_swap_full | ( | Main * | bmain, |
| ID * | id_a, | ||
| ID * | id_b, | ||
| const bool | do_self_remap, | ||
| const int | self_remap_flags ) |
Does a mere memory swap over the whole IDs data (including type-specific memory).
For parameters description, see BKE_lib_id_swap above.
Definition at line 1062 of file lib_id.cc.
References id_swap().
Referenced by read_libblock_undo_restore_at_old_address(), and swap_wm_data_for_blendfile().
| void BKE_lib_libblock_session_uid_ensure | ( | ID * | id | ) |
Generate a session-wise UID for the given id.
Definition at line 1477 of file lib_id.cc.
References atomic_add_and_fetch_uint32(), BLI_assert, global_session_uid, ID_TAG_TEMP_MAIN, MAIN_ID_SESSION_UID_UNSET, and UNLIKELY.
Referenced by BKE_lib_libblock_session_uid_renew(), BKE_libblock_alloc_in_lib(), BKE_libblock_management_main_add(), create_placeholder(), direct_link_id_common(), and versions_gpencil_add_main().
| void BKE_lib_libblock_session_uid_renew | ( | ID * | id | ) |
Re-generate a new session-wise UID for the given id.
Definition at line 1490 of file lib_id.cc.
References BKE_lib_libblock_session_uid_ensure(), and MAIN_ID_SESSION_UID_UNSET.
Referenced by BKE_lib_id_clear_library_data(), reuse_bmain_move_id(), and swap_old_bmain_data_for_blendfile().
| void * BKE_libblock_alloc | ( | Main * | bmain, |
| short | type, | ||
| const char * | name, | ||
| int | flag ) |
Allocates and returns an ID block of the specified type, with the specified name (adjusted as necessary to ensure uniqueness), and appended to the specified list. The user count is set to 1, all other content (apart from name and links) being initialized to zero.
Definition at line 1447 of file lib_id.cc.
References BKE_libblock_alloc_in_lib(), flag, and name.
Referenced by BKE_curve_add(), BKE_gpencil_data_addnew(), BKE_id_new_nomain(), BKE_linestyle_new(), BKE_mesh_new_nomain(), BKE_object_add_only_object(), BKE_pointcloud_new_nomain(), BKE_sound_new_file(), BKE_text_load_ex(), BKE_vfont_load(), cachefile_open_exec(), mask_alloc(), screen_add(), and wm_add_default().
| void * BKE_libblock_alloc_in_lib | ( | Main * | bmain, |
| std::optional< Library * > | owner_library, | ||
| short | type, | ||
| const char * | name, | ||
| int | flag ) |
Same as for BKE_libblock_alloc, but allows creating a data-block for a given owner library.
| owner_library | the Library to 'assign' the newly created ID to. Use nullptr to make ID not use any library (i.e. become a local ID). Use std::nullopt for default behavior (i.e. behavior of the BKE_libblock_alloc function). |
Definition at line 1352 of file lib_id.cc.
References BKE_id_new_name_validate(), BKE_lib_libblock_session_uid_ensure(), BKE_libblock_alloc_notest(), BKE_libblock_runtime_ensure(), BKE_main_lock(), BKE_main_unlock(), BLI_addtail(), BLI_assert, BLI_strncpy(), Main::curlib, DEG_id_type_tag(), ELEM, flag, ID_GR, ID_NT, ID_TAG_LOCALIZED, ID_TAG_NO_MAIN, ID_TAG_NO_USER_REFCOUNT, ID_WS, Main::is_locked_for_linking, Main::is_memfile_undo_written, LIB_ID_CREATE_LOCAL, LIB_ID_CREATE_NO_ALLOCATE, LIB_ID_CREATE_NO_DEG_TAG, LIB_ID_CREATE_NO_MAIN, LIB_ID_CREATE_NO_USER_REFCOUNT, name, RenameExistingNever, Library::runtime, and which_libbase().
Referenced by BKE_collection_master_add(), BKE_id_new_in_lib(), BKE_libblock_alloc(), BKE_libblock_copy_in_lib(), image_alloc(), and blender::bke::node_tree_add_tree_do().
| ID * BKE_libblock_alloc_notest | ( | short | type | ) |
Allocates and returns memory of the right size for the specified block type, initialized to zero.
Definition at line 1340 of file lib_id.cc.
References BKE_libblock_get_alloc_info(), BLI_assert_msg, MEM_callocN(), name, and size().
Referenced by BKE_libblock_alloc_in_lib(), create_placeholder(), and blender::deg::IDNode::init_copy_on_write().
Used everywhere in blenkernel.
Definition at line 1699 of file lib_id.cc.
References BKE_libblock_copy_in_lib().
Definition at line 1694 of file lib_id.cc.
References BKE_libblock_copy_in_lib().
| void BKE_libblock_copy_in_lib | ( | Main * | bmain, |
| std::optional< Library * > | owner_library, | ||
| const ID * | id, | ||
| std::optional< const ID * > | new_owner_id, | ||
| ID ** | new_id_p, | ||
| int | orig_flag ) |
Same as BKE_libblock_copy_ex, but allows copying data into a library, and not as local data only.
| owner_library | the Library to 'assign' the newly created ID to. Use nullptr to make ID not use any library (i.e. become a local ID). Use #std::nullopt for default behavior (i.e. behavior of the BKE_libblock_copy_ex function). |
| new_owner_id | When copying an embedded ID, the owner ID of the new copy. Should be nullopt for regular ID copying, or in case the owner ID is not (yet) known. |
Definition at line 1535 of file lib_id.cc.
References IdAdtTemplate::adt, ID::asset_data, BKE_animdata_copy_in_lib(), BKE_asset_metadata_copy(), BKE_id_name(), BKE_idtype_get_info_from_id(), BKE_lib_override_library_copy(), BKE_libblock_alloc_in_lib(), BKE_libblock_get_alloc_info(), BKE_libblock_runtime_ensure(), BLI_assert, DEG_id_type_tag(), flag, ID::flag, GS, id_can_have_animdata(), ID_FLAG_EMBEDDED_DATA, ID_FLAG_EMBEDDED_DATA_LIB_OVERRIDE, ID_FLAG_LINKED_AND_PACKED, ID_IS_OVERRIDE_LIBRARY_REAL, ID_IS_OVERRIDE_LIBRARY_VIRTUAL, ID_NEW_SET, ID_TAG_COPIED_ON_EVAL, ID_TAG_EXTERN, ID_TAG_INDIRECT, ID_TAG_NO_MAIN, ID_TAG_NO_USER_REFCOUNT, ID_TAG_NOT_ALLOCATED, IDP_CopyProperty_ex(), ID::lib, LIB_ID_COPY_ACTIONS, LIB_ID_COPY_ASSET_METADATA, LIB_ID_COPY_ID_NEW_SET, LIB_ID_COPY_NO_ANIMDATA, LIB_ID_COPY_NO_LIB_OVERRIDE, LIB_ID_COPY_SET_COPIED_ON_WRITE, LIB_ID_CREATE_LOCAL, LIB_ID_CREATE_NO_ALLOCATE, LIB_ID_CREATE_NO_DEG_TAG, LIB_ID_CREATE_NO_MAIN, LIB_ID_CREATE_NO_USER_REFCOUNT, LIBRARY_FLAG_IS_ARCHIVE, ID::library_weak_reference, ID::name, IDTypeInfo::owner_pointer_get, ID::properties, size(), STRNCPY(), ID::system_properties, ID::tag, and ID::us.
Referenced by BKE_id_copy_in_lib(), BKE_libblock_copy(), and BKE_libblock_copy_ex().
| ID * BKE_libblock_find_name | ( | Main * | bmain, |
| short | type, | ||
| const char * | name, | ||
| const std::optional< Library * > | lib = std::nullopt ) |
Find an ID in bmain by its type, name, and library ID.
If lib is unset, the first ID matching the looked-up name is returned (local or linked). If lib is null, the ID is searched into local ones only.
Definition at line 1710 of file lib_id.cc.
References BLI_assert, BLI_findstring(), BLI_listbase_findafter_string(), lib, name, offsetof, and which_libbase().
Referenced by arg_handle_python_text_run(), BKE_id_new_name_validate(), BKE_libblock_find_name_and_library(), BKE_libblock_find_name_and_library_filepath(), BKE_scene_set_name(), blender::io::alembic::build_depsgraph(), blender::io::obj::exporter_main(), blender::io::ply::exporter_main(), blender::io::stl::exporter_main(), blender::ed::geometry::gather_input_ids(), blender::io::obj::get_or_create_material(), blender::ed::greasepencil::grease_pencil_stroke_material_set_exec(), blender::io::fbx::FbxImportContext::import_materials(), blender::ed::object::object_select_mirror_exec(), blender::ed::object::object_select_same_collection_exec(), palette_join_exec(), blender::io::usd::TEST_F(), unpack_item_exec(), update_duplicate_custom_bone_shapes(), blender::io::usd::USD_export(), wm_lib_relocate_exec_do(), wm_lib_relocate_invoke(), WM_operator_properties_id_lookup_from_name_or_session_uid(), and workspace_append_activate_exec().
| ID * BKE_libblock_find_name_and_library | ( | Main * | bmain, |
| short | type, | ||
| const char * | name, | ||
| const char * | lib_name ) |
Find an ID in bmain by its type, name, and library ID name.
If lib_name is null or empty, the ID is searched into local ones only.
Definition at line 1752 of file lib_id.cc.
References BKE_libblock_find_name(), ID_LI, and name.
Referenced by blender::bke::library::ensure_archive_library().
| ID * BKE_libblock_find_name_and_library_filepath | ( | Main * | bmain, |
| short | type, | ||
| const char * | name, | ||
| const char * | lib_filepath_abs ) |
Find an ID in bmain by its type, name, and absolute library file path.
If lib_filepath_abs is null or empty, the ID is searched into local ones only.
Definition at line 1767 of file lib_id.cc.
References BKE_libblock_find_name(), ID_LI, LISTBASE_FOREACH, name, Library::runtime, STREQ, and which_libbase().
Referenced by blender::bke::asset_edit_id_from_weak_reference(), and undosys_id_ref_resolve().
Definition at line 1728 of file lib_id.cc.
References BLI_assert, LISTBASE_FOREACH, and which_libbase().
Referenced by blender::ed::object::drop_geometry_nodes_invoke(), blender::ed::object::drop_geometry_nodes_tooltip(), blender::nodes::get_modifier_data(), view3d_geometry_nodes_drop_poll(), wm_id_linked_relocate_exec(), and WM_operator_properties_id_lookup_from_name_or_session_uid().
Definition at line 1740 of file lib_id.cc.
References FOREACH_MAIN_ID_BEGIN, FOREACH_MAIN_ID_END, and ID::session_uid.
| void BKE_libblock_free_data | ( | ID * | id, |
| bool | do_id_user ) |
Free generic ID data, including the runtime and animation data, but not the python data.
Definition at line 48 of file lib_id_delete.cc.
References BKE_animdata_free(), BKE_asset_metadata_free(), BKE_lib_override_library_free(), BKE_libblock_free_runtime_data(), IDP_FreePropertyContent_ex(), and MEM_freeN().
Referenced by BKE_collection_free_data(), BKE_object_free_derived_caches(), blender::deg::deg_free_eval_copy_datablock(), id_free(), blender::bke::node_tree_free_embedded_tree(), blender::bke::ntree_free_data(), particle_settings_free_local(), prefetch_freejob(), preview_id_copy_free(), and wm_file_read_setup_wm_use_new().
| void BKE_libblock_free_data_py | ( | ID * | id | ) |
Low-level ID freeing functions.
In most cases BKE_id_free_ex handles this, when lower level functions are called directly this function will need to be called too, if Python has access to the data.
ID data-blocks such as Material.nodetree are not stored in Main.
Definition at line 422 of file lib_id_delete.cc.
References BPY_DECREF_RNA_INVALIDATE(), BPY_id_release(), and UNUSED_VARS.
Referenced by blender::deg::deg_free_eval_copy_datablock(), id_free(), blender::bke::node_tree_free_embedded_tree(), scene_free_data(), and wm_file_read_setup_wm_use_new().
| void BKE_libblock_free_datablock | ( | ID * | id, |
| int | flag ) |
Free IDtype-specific data (does not free generic ID data, use BKE_libblock_free_data for that).
Definition at line 79 of file lib_id_delete.cc.
References BKE_idtype_get_info_from_id(), BLI_assert_msg, and IDTypeInfo::free_data.
Referenced by BKE_object_free_derived_caches(), blender::deg::deg_free_eval_copy_datablock(), id_free(), particle_settings_free_local(), prefetch_freejob(), preview_id_copy_free(), blender::animrig::tests::ArmatureBoneCollections::TearDown(), blender::animrig::tests::ArmatureBoneCollectionsLiboverrides::TearDown(), and blender::animrig::tests::ArmatureBoneCollectionsTestList::TearDown().
| void BKE_libblock_free_runtime_data | ( | ID * | id | ) |
Only free generic runtime data (ID::runtime).
In most cases BKE_libblock_free_data handles this, but in rare cases (currently in readfile, when freeing linked ID placeholders), it is necessary.
Definition at line 93 of file lib_id_delete.cc.
References BLO_readfile_id_runtime_data_free().
Referenced by BKE_libblock_free_data(), blender::bke::node_tree_free_tree(), and read_library_linked_ids().
| size_t BKE_libblock_get_alloc_info | ( | short | type, |
| const char ** | r_name ) |
Get allocation size of a given data-block type and optionally allocation r_name.
Definition at line 1323 of file lib_id.cc.
References BKE_idtype_get_info_from_idcode(), IDTypeInfo::name, and IDTypeInfo::struct_size.
Referenced by BKE_libblock_alloc_notest(), and BKE_libblock_copy_in_lib().
| void BKE_libblock_init_empty | ( | ID * | id | ) |
Initialize an ID of given type, such that it has valid 'empty' data. ID is assumed to be just calloc'ed.
Definition at line 1452 of file lib_id.cc.
References BKE_idtype_get_info_from_id(), BLI_assert_msg, and IDTypeInfo::init_data.
Referenced by BKE_id_new_in_lib(), BKE_id_new_nomain(), BKE_mesh_new_nomain(), BKE_pointcloud_new_nomain(), create_placeholder(), and blender::bke::node_tree_add_tree_do().
| void BKE_libblock_management_main_add | ( | Main * | bmain, |
| void * | idv ) |
Add a 'NO_MAIN' data-block to given main (also sets user-counts of its IDs if needed).
Definition at line 1123 of file lib_id.cc.
References BKE_id_new_name_validate(), BKE_lib_libblock_session_uid_ensure(), BKE_library_foreach_ID_link(), BKE_main_lock(), BKE_main_unlock(), BLI_addtail(), BLI_assert, GS, ID_TAG_NO_MAIN, ID_TAG_NO_USER_REFCOUNT, ID_TAG_NOT_ALLOCATED, IDWALK_NOP, Main::is_memfile_undo_written, libblock_management_us_plus(), RenameExistingNever, and which_libbase().
Referenced by BKE_main_merge(), do_versions_after_setup(), and lib_override_library_resync().
| void BKE_libblock_management_main_remove | ( | Main * | bmain, |
| void * | idv ) |
Remove a data-block from given main (set it to 'NO_MAIN' status).
Definition at line 1156 of file lib_id.cc.
References BKE_main_lock(), BKE_main_namemap_remove_id(), BKE_main_unlock(), BLI_assert, BLI_remlink(), GS, ID_TAG_NO_MAIN, Main::is_memfile_undo_written, and which_libbase().
Referenced by BKE_main_merge().
| void BKE_libblock_management_usercounts_clear | ( | Main * | bmain, |
| void * | idv ) |
Definition at line 1188 of file lib_id.cc.
References BKE_library_foreach_ID_link(), ID_TAG_NO_MAIN, ID_TAG_NO_USER_REFCOUNT, IDWALK_NOP, and libblock_management_us_min().
| void BKE_libblock_management_usercounts_set | ( | Main * | bmain, |
| void * | idv ) |
Definition at line 1176 of file lib_id.cc.
References BKE_library_foreach_ID_link(), ID_TAG_NO_USER_REFCOUNT, IDWALK_NOP, and libblock_management_us_plus().
| IDNewNameResult BKE_libblock_rename | ( | Main & | bmain, |
| ID & | id, | ||
| blender::StringRefNull | name, | ||
| const IDNewNameMode | mode = IDNewNameMode::RenameExistingNever ) |
Sets the name of a block to name, suitably adjusted for uniqueness.
Definition at line 2370 of file lib_id.cc.
References BKE_id_is_in_main(), BKE_id_name(), BKE_id_new_name_validate(), BKE_main_namemap_remove_id(), BLI_assert, ELEM, GS, Main::is_memfile_undo_written, name, result, STREQ, IDNewNameResult::UNCHANGED, IDNewNameResult::UNCHANGED_COLLISION, and which_libbase().
Referenced by blender::bke::asset_write_in_library(), BKE_id_rename(), BLO_update_defaults_startup_blend(), blender::ed::sculpt_paint::brush_asset_save_as_exec(), blender::bke::tests::change_name(), do_versions_rename_id(), blender::bke::tests::TEST(), wm_file_read_post(), and workspace_append_activate_exec().
| void BKE_libblock_runtime_ensure | ( | ID & | id | ) |
Ensure that the given ID does have a valid runtime data.
Low-level API, should not be needed in typical ID usages, where ID::runtime can always be assumed valid.
Definition at line 1316 of file lib_id.cc.
Referenced by BKE_libblock_alloc_in_lib(), BKE_libblock_copy_in_lib(), create_placeholder(), and direct_link_id_common().
| void BKE_libblock_runtime_reset_remapping_status | ( | ID * | id | ) |
Reset the runtime counters used by ID remapping.
Definition at line 1466 of file lib_id.cc.
Referenced by libblock_remap_foreach_idpair(), and libblock_remap_reset_remapping_status_fn().
| void BKE_library_make_local | ( | Main * | bmain, |
| const Library * | lib, | ||
| GHash * | old_to_new_ids, | ||
| bool | untagged_only, | ||
| bool | set_fake, | ||
| bool | clear_asset_data ) |
Make linked data-blocks local.
| bmain | Almost certainly global main. |
| lib | If not NULL, only make local data-blocks from this library. |
| untagged_only | If true, only make local data-blocks not tagged with ID_TAG_PRE_EXISTING. |
| set_fake | If true, set fake user on all localized data-blocks (except group and objects ones). |
| clear_asset_data | If true, clear the asset metadata on all localized data-blocks, making them normal non-asset data-blocks. |
Definition at line 2129 of file lib_id.cc.
References BKE_idtype_idcode_is_linkable(), BKE_lib_id_clear_library_data(), BKE_lib_id_expand_local(), BKE_lib_id_make_local(), BKE_lib_override_library_main_hierarchy_root_ensure(), BKE_lib_override_library_make_local(), BKE_libblock_remap(), BKE_main_id_newptr_and_tag_clear(), BKE_main_lists_get(), BKE_main_relations_create(), BKE_main_relations_free(), BKE_pose_rebuild(), BKE_rigidbody_ensure_local_object(), BLI_assert, BLI_ghash_insert(), BLI_gset_add(), BLI_gset_free(), BLI_gset_len(), BLI_gset_ptr_new(), BLI_linklist_prepend_arena(), BLI_linklist_prepend_nlink(), BLI_memarena_free(), BLI_memarena_new(), ELEM, ListBase::first, GS, id_fake_user_set(), ID_FLAG_INDIRECT_WEAK_LINK, ID_GR, ID_IS_LINKED, ID_IS_OVERRIDE_LIBRARY_REAL, ID_OB, ID_REMAP_SKIP_INDIRECT_USAGE, ID_TAG_DOIT, ID_TAG_EXTERN, ID_TAG_INDIRECT, ID_TAG_NEW, ID_TAG_PRE_EXISTING, id_us_ensure_real(), lib, LIB_ID_MAKELOCAL_ASSET_DATA_CLEAR, LIB_ID_MAKELOCAL_FULL_LIBRARY, library_make_local_copying_check(), LinkNode::next, blender::bke::node_tree_from_id(), OB_ARMATURE, Main::objects, POSE_RECALC, printf, Main::relations, ID::tag, TIMEIT_END, TIMEIT_START, and TIMEIT_VALUE_PRINT.
Referenced by blender::ed::object::make_local_exec(), and blender::bke::blendfile::PartialWriteContext::write().
| void BKE_main_id_flag_all | ( | Main * | bmain, |
| int | flag, | ||
| bool | value ) |
Clear or set given flags for all ids in bmain (persistent flags).
Definition at line 1249 of file lib_id.cc.
References BKE_main_id_flag_listbase(), BKE_main_lists_get(), and flag.
| void BKE_main_id_flag_listbase | ( | ListBase * | lb, |
| int | flag, | ||
| bool | value ) |
Clear or set given flags for all ids in listbase (persistent flags).
Definition at line 1233 of file lib_id.cc.
References ListBase::first, and flag.
Referenced by BKE_main_id_flag_all(), and id_search_cb_objects_from_scene().
| void BKE_main_id_newptr_and_tag_clear | ( | Main * | bmain | ) |
Next to indirect usage in readfile.cc / writefile.cc also in editobject.c, scene.cc.
Definition at line 2001 of file lib_id.cc.
References BKE_id_newptr_and_tag_clear(), FOREACH_MAIN_ID_BEGIN, and FOREACH_MAIN_ID_END.
Referenced by blender::ed::object::add_duplicate(), blender::ed::object::apply_objects_internal(), BKE_blendfile_append(), BKE_blendfile_link_pack(), BKE_brush_duplicate(), BKE_collection_duplicate(), BKE_lib_override_library_create(), BKE_library_make_local(), BKE_object_duplicate(), BKE_scene_duplicate(), blender::ed::object::copy_object_set_idnew(), blender::ed::object::duplicate_exec(), blender::ed::outliner::id_override_library_create_hierarchy(), lib_override_library_resync(), blender::ed::object::make_object_duplilist_real(), blender::ed::object::make_single_user_exec(), blender::ed::object::modifier_apply_exec_ex(), blender::ed::object::object_duplicates_make_real_exec(), blender::ed::object::object_single_user_make(), and blender::seq::seq_duplicate_postprocess().
| void BKE_main_id_refcount_recompute | ( | Main * | bmain, |
| bool | do_linked_only ) |
Definition at line 2035 of file lib_id.cc.
References BKE_library_foreach_ID_link(), ELEM, FOREACH_MAIN_ID_BEGIN, FOREACH_MAIN_ID_END, GS, ID_FAKE_USERS, ID_IS_LINKED, id_refcount_recompute_callback(), ID_SCE, ID_TAG_EXTRAUSER, ID_TAG_EXTRAUSER_SET, id_us_ensure_real(), ID_WM, ID_WS, IDWALK_INCLUDE_UI, IDWALK_READONLY, and POINTER_FROM_INT.
Referenced by BKE_blendfile_library_relocate(), blo_read_file_internal(), library_link_end(), setup_app_data(), and write_file_handle().
Only for repairing files via versioning, avoid for general use.
Definition at line 1258 of file lib_id.cc.
References BKE_id_name(), BKE_id_new_name_validate(), BLI_gset_add(), BLI_gset_free(), BLI_gset_str_new_ex(), i, ID_IS_LINKED, LISTBASE_FOREACH, MEM_freeN(), MEM_malloc_arrayN(), and RenameExistingNever.
Referenced by blo_do_versions_280(), blo_do_versions_290(), and blo_do_versions_300().
| void BKE_main_id_tag_all | ( | Main * | mainvar, |
| int | tag, | ||
| bool | value ) |
Clear or set given tags for all ids in bmain (runtime tags).
Definition at line 1224 of file lib_id.cc.
References BKE_main_id_tag_listbase(), and BKE_main_lists_get().
Referenced by BKE_blendfile_append(), BKE_blendfile_id_relocate(), BKE_blendfile_library_relocate(), BKE_lib_override_library_create(), BKE_lib_override_library_delete(), blo_read_file_internal(), bpy_lib_exit(), copybuffer_append(), blender::ed::outliner::id_override_library_create_hierarchy(), blender::ed::outliner::id_override_library_create_hierarchy_pre_process(), lib_override_library_main_resync_on_library_indirect_level(), lib_override_library_resync(), library_link_end(), blender::ed::object::make_local_exec(), blender::ed::object::make_override_library_exec(), blender::ed::object::object_delete_exec(), blender::ed::outliner::outliner_delete_exec(), blender::ed::outliner::outliner_id_delete_invoke(), blender::ed::outliner::outliner_id_operation_exec(), blender::ed::outliner::outliner_lib_operation_exec(), blender::ed::outliner::outliner_orphans_purge_cleanup(), previews_ensure_exec(), blender::ed::object::sorted_selected_editable_objects(), blender::ed::object::tag_localizable_objects(), wm_file_link_append_datablock_ex(), wm_id_linked_relocate_exec(), WM_lib_reload(), wm_lib_relocate_exec_do(), and wm_link_append_exec().
| void BKE_main_id_tag_idcode | ( | Main * | mainvar, |
| short | type, | ||
| int | tag, | ||
| bool | value ) |
Clear or set given tags for all ids of given type in bmain (runtime tags).
Definition at line 1217 of file lib_id.cc.
References BKE_main_id_tag_listbase(), and which_libbase().
Referenced by blender::ed::object::bake_objects_check(), blender::ed::object::bake_targets_init_image_textures(), blender::ed::outliner::id_delete_tag(), and sound_update_animation_flags_exec().
| void BKE_main_id_tag_listbase | ( | ListBase * | lb, |
| int | tag, | ||
| bool | value ) |
Clear or set given tags for all ids in listbase (runtime tags).
Definition at line 1201 of file lib_id.cc.
References ListBase::first.
Referenced by BKE_collection_object_cyclic_check(), BKE_main_id_tag_all(), BKE_main_id_tag_idcode(), BKE_workspace_id_tag_all_visible(), clean_viewport_memory(), blender::ed::object::object_delete_exec(), and previews_ensure_exec().
| void BKE_main_lib_objects_recalc_all | ( | Main * | bmain | ) |
Definition at line 1290 of file lib_id.cc.
References DEG_id_tag_update(), DEG_id_type_tag(), ListBase::first, Object::id, ID_IS_LINKED, ID_OB, ID_RECALC_ANIMATION, ID_RECALC_GEOMETRY, ID_RECALC_TRANSFORM, ID::next, and Main::objects.
Referenced by copybuffer_append(), blender::ed::outliner::outliner_id_remap_exec(), WM_lib_reload(), wm_lib_relocate_exec_do(), and wm_link_append_exec().
| void id_fake_user_clear | ( | ID * | id | ) |
Definition at line 404 of file lib_id.cc.
References ID_FLAG_FAKEUSER, and id_us_min().
Referenced by BKE_lib_id_clear_library_data(), blendfile_library_relocate_id_remap_finalize(), blender::ed::asset::clear_id(), blender::ed::outliner::collection_link_exec(), ED_animedit_unlink_action(), blender::ed::outliner::id_fake_user_clear_fn(), lib_id_fake_user_toggle_exec(), libblock_remap_data_update_tags(), and template_id_cb().
| void id_fake_user_set | ( | ID * | id | ) |
Definition at line 396 of file lib_id.cc.
References ID_FLAG_FAKEUSER, and id_us_plus().
Referenced by BKE_blendfile_append(), BKE_lib_id_clear_library_data(), BKE_library_make_local(), BKE_text_add(), BKE_text_load_ex(), blendfile_library_relocate_id_remap_finalize(), brush_copy_data(), brush_init_data(), brush_make_local(), blender::ed::object::collection_add_exec(), blender::ed::object::collection_create_exec(), do_versions_after_linking_280(), do_versions_after_linking_290(), do_versions_after_linking_300(), blender::io::usd::USDStageReader::fake_users_for_unused_materials(), blender::ed::outliner::id_fake_user_set_fn(), blender::io::fbx::import_animations(), blender::bke::greasepencil::convert::legacy_gpencil_to_grease_pencil(), lib_id_fake_user_toggle_exec(), lib_override_library_resync(), libblock_remap_data_update_tags(), blender::ed::asset::mark_id(), mask_alloc(), mask_copy_data(), blender::ed::asset::AssetClearHelper::operator()(), palette_init_data(), and blender::ed::outliner::unlink_collection_fn().
| void id_lib_extern | ( | ID * | id | ) |
Definition at line 290 of file lib_id.cc.
References BKE_idtype_idcode_is_linkable(), BLI_assert, GS, ID_FLAG_INDIRECT_WEAK_LINK, ID_IS_LINKED, ID_TAG_EXTERN, and ID_TAG_INDIRECT.
Referenced by con_extern_cb(), id_us_plus(), lib_id_expand_local_cb(), paste_material_nodetree_ids_relink_or_clear(), paste_mtex_copybuf(), write_file_handle(), and write_id_direct_linked_data_process_cb().
| void id_lib_indirect_weak_link | ( | ID * | id | ) |
Definition at line 303 of file lib_id.cc.
References BKE_idtype_idcode_is_linkable(), BLI_assert, GS, ID_FLAG_INDIRECT_WEAK_LINK, ID_IS_LINKED, and ID_TAG_INDIRECT.
Referenced by layer_collection_objects_sync(), layer_collection_sync(), and write_id_direct_linked_data_process_cb().
| bool id_single_user | ( | bContext * | C, |
| ID * | id, | ||
| PointerRNA * | ptr, | ||
| PropertyRNA * | prop ) |
Definition at line 1068 of file lib_id.cc.
References BKE_id_copy_ex(), C, CTX_data_main(), ID_REAL_USERS, id_us_min(), LIB_ID_COPY_ACTIONS, LIB_ID_COPY_DEFAULT, ptr, RNA_id_pointer_create(), RNA_property_editable(), RNA_property_pointer_set(), and RNA_property_update().
Referenced by blender::ed::outliner::singleuser_action_fn(), blender::ed::outliner::singleuser_world_fn(), and template_id_cb().
Sort given id into given lb list, using case-insensitive comparison of the id names.
| id_sorting_hint | Ignored if NULL. Otherwise, used to check if we can insert id immediately before or after that pointer. It must always be into given lb list. |
Definition at line 1790 of file lib_id.cc.
References BLI_addhead(), BLI_addtail(), BLI_assert, BLI_findindex(), BLI_insertlinkafter(), BLI_insertlinkbefore(), BLI_remlink(), BLI_strcasecmp(), ELEM, ListBase::first, ID_IS_LINKED, ID_SORT_STEP_SIZE, ListBase::last, ID::lib, ID::name, ID::next, and ID::prev.
Referenced by blender::bke::tests::add_id_in_library(), BKE_id_new_name_validate(), blendfile_library_relocate_id_remap_finalize(), blender::bke::tests::change_name_global(), create_placeholder(), lib_override_library_create_from(), link_named_part(), read_id_in_lib(), reuse_bmain_move_id(), sort_linked_ids(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), and blender::bke::tests::TEST().
| void id_us_clear_real | ( | ID * | id | ) |
Definition at line 331 of file lib_id.cc.
References BLI_assert, ID_FAKE_USERS, ID_TAG_EXTRAUSER, and ID_TAG_EXTRAUSER_SET.
Referenced by blender::animrig::action_add(), BKE_id_free_us(), libblock_remap_data_update_tags(), libblock_remap_foreach_idpair(), blender::bke::blendfile::PartialWriteContext::remove_unused(), and template_id_cb().
| void id_us_ensure_real | ( | ID * | id | ) |
Ensure we have a real user
Definition at line 313 of file lib_id.cc.
References CLOG_ERROR, ID_FAKE_USERS, ID_TAG_EXTRAUSER, ID_TAG_EXTRAUSER_SET, and LOG.
Referenced by add_archive_library(), blender::seq::add_mask_strip(), blender::seq::add_movieclip_strip(), blender::seq::add_scene_strip(), blender::bke::id::IDRemapper::apply(), BKE_image_ensure_viewer(), BKE_library_make_local(), BKE_library_update_ID_link_user(), BKE_main_id_refcount_recompute(), BKE_scene_add(), BKE_scene_duplicate(), BKE_workspace_add(), blo_add_main_for_library(), direct_link_library(), ED_node_tree_push(), ED_node_tree_start(), ED_space_clip_set_clip(), ED_space_clip_set_mask(), ED_space_image_set(), ED_space_image_set_mask(), foreach_libblock_make_usercounts_callback(), foreach_libblock_remap_callback_apply(), id_refcount_recompute_callback(), id_us_min(), libblock_management_us_plus(), blender::ed::space_node::node_id_remap(), pack_linked_id(), paste_material_nodetree_ids_relink_or_clear(), scene_blend_read_data(), blender::ed::space_node::tree_update(), window_manager_blend_read_data(), and workspace_blend_read_data().
| void id_us_min | ( | ID * | id | ) |
Definition at line 366 of file lib_id.cc.
References CLOG_ERROR, GS, ID_FAKE_USERS, ID_TAG_EXTRAUSER, ID_TYPE_IS_DEPRECATED, id_us_ensure_real(), and LOG.
Referenced by action_create_new(), blender::io::usd::USDMaterialReader::add_material(), blender::animrig::animdata_remove_empty_action(), blender::bke::id::IDRemapper::apply(), blender::ed::object::apply_objects_internal(), blender::io::alembic::utils::assign_materials(), BKE_collection_object_replace(), BKE_freestyle_config_free(), BKE_freestyle_lineset_delete(), BKE_gpencil_brush_material_set(), BKE_gpencil_palette_ensure(), BKE_grease_pencil_object_material_new(), BKE_id_copy_for_duplicate(), BKE_id_free_us(), BKE_id_material_assign(), BKE_id_material_clear(), BKE_id_material_pop(), BKE_id_material_resize(), BKE_lib_override_library_clear(), BKE_lib_override_library_main_proxy_convert(), BKE_lib_override_library_proxy_convert(), BKE_library_update_ID_link_user(), BKE_light_linking_collection_assign_only(), BKE_light_linking_delete(), BKE_main_mesh_legacy_convert_auto_smooth(), BKE_mesh_assign_object(), BKE_mesh_new_from_object_to_bmain(), BKE_mesh_nomain_to_mesh(), BKE_mesh_to_curve(), BKE_mesh_to_pointcloud(), BKE_nlastrip_free(), BKE_object_add_only_object(), BKE_object_material_from_eval_data(), BKE_object_material_resize(), BKE_object_material_slot_remove(), BKE_paint_palette_set(), BKE_pointcloud_to_mesh(), BKE_pose_channel_free_ex(), BKE_scene_add(), BKE_scene_duplicate(), BKE_text_add(), BKE_text_load_ex(), BKE_texture_mtex_add_id(), BKE_vfont_builtin_ensure(), BKE_workspace_layout_remove(), blendfile_library_relocate_id_remap_prepare(), brush_make_local(), cachefile_open_exec(), camera_background_image_remove_exec(), collection_add(), collection_child_remove(), collection_instance_fix_recursive(), collection_object_remove_no_gobject_hash(), con_unlink_refs_cb(), blender::ed::object::convert_mball_to_mesh(), blender::ed::object::convert_mesh_to_mesh(), copy_particle_systems_to_object(), blender::ed::greasepencil::undo::StepDrawingReference::decode(), do_version_layers_to_collections(), drop_world_exec(), blender::ed::object::duplibase_for_convert(), blender::seq::effect_text_font_unload(), blender::ui::greasepencil::eyedropper_add_palette_color(), font_open_exec(), foreach_libblock_remap_callback_apply(), FRS_paste_active_lineset(), blender::animrig::generic_assign_action(), blender::ed::object::geometry_node_tree_copy_assign_exec(), blender::ed::object::get_object_for_conversion(), blender::io::obj::get_or_create_material(), Freestyle::BlenderStrokeRenderer::GetStrokeShader(), gpencil_data_add_exec(), gpencil_data_unlink_exec(), blender::animrig::id_action_ensure(), blender::bke::blendfile::PartialWriteContext::id_create(), id_fake_user_clear(), id_single_user(), IDP_AssignID(), IDP_FreePropertyContent_ex(), image_new_exec(), image_open_exec(), import_file(), blender::io::fbx::import_material(), blender::io::usd::import_startjob(), blender::ed::mesh::join_objects_exec(), blender::bke::greasepencil::convert::legacy_gpencil_object(), blender::bke::greasepencil::convert::legacy_gpencil_sanitize_annotations(), blender::bke::greasepencil::convert::legacy_main(), lib_override_library_create_from(), lib_override_library_create_post_process(), libblock_management_us_min(), blender::ed::object::make_links_data_exec(), blender::ed::object::make_object_duplilist_real(), modifier_free_data_id_us_cb(), modifier_free_data_id_us_cb(), new_material_exec(), new_particle_settings_exec(), new_texture_exec(), new_world_exec(), nlaedit_apply_scale_exec(), nlaedit_make_single_user_exec(), blender::ed::space_node::node_duplicate_exec(), blender::ed::space_node::node_id_remap(), blender::bke::node_remove_node(), blender::ed::space_node::node_templateID_assign(), blender::nodes_modifier_data_block_destruct(), blender::ed::object::object_data_convert_curve_to_mesh(), blender::ed::object::object_image_add_invoke(), object_material_assign(), object_remove_particle_system(), blender::ed::object::object_unlink_data_exec(), open_exec(), pack_linked_id(), paste_material_nodetree_ids_decref(), paste_material_nodetree_ids_relink_or_clear(), paste_mtex_copybuf(), blender::ed::outliner::restrictbutton_id_user_toggle(), reuse_bmain_data_invalid_local_usages_fix_cb(), scene_foreach_toolsettings_id_pointer_process(), separate_exec(), blender::seq::seq_strip_free_ex(), set_current_brush_texture(), set_current_linestyle_texture(), set_current_particle_texture(), blender::io::usd::USDInstanceReader::set_instance_collection(), blender::animrig::tests::KeyframingTest::SetUp(), shaderfx_free_data_id_us_cb(), blender::ed::object::single_obdata_users(), blender::ed::object::single_object_users_collection(), blender::bke::node_interface::socket_types::socket_data_id_user_decrement(), blender::bke::node_interface::socket_types::socket_data_id_user_decrement(), blender::bke::node_interface::socket_types::socket_data_id_user_decrement(), blender::bke::node_interface::socket_types::socket_data_id_user_decrement(), blender::bke::node_interface::socket_types::socket_data_id_user_decrement(), blender::bke::socket_id_user_decrement(), solve_camera_freejob(), template_id_cb(), TEST_F(), TEST_F(), blender::ed::outliner::unlink_material_fn(), blender::ed::outliner::unlink_texture_fn(), and blender::ed::outliner::unlink_world_fn().
| void id_us_plus | ( | ID * | id | ) |
Definition at line 358 of file lib_id.cc.
References id_lib_extern(), and id_us_plus_no_lib().
Referenced by blender::io::usd::USDGeomReader::add_cache_modifier(), blender::ed::space_node::add_node_group_asset(), blender::io::alembic::AbcObjectReader::addCacheModifier(), blender::ed::object::apply_objects_internal(), BKE_animdata_copy_in_lib(), BKE_animdata_merge_copy(), BKE_camera_background_image_copy(), BKE_collection_object_replace(), BKE_gpencil_brush_material_set(), BKE_id_material_append(), BKE_id_material_assign(), BKE_id_materials_copy(), BKE_image_load_exists_in_lib(), BKE_lib_override_library_copy(), BKE_lib_override_library_init(), BKE_library_update_ID_link_user(), BKE_light_linking_collection_assign_only(), BKE_light_linking_copy(), BKE_linestyle_alpha_modifier_copy(), BKE_linestyle_color_modifier_copy(), BKE_linestyle_thickness_modifier_copy(), BKE_mesh_assign_object(), BKE_movieclip_file_add_exists_ex(), BKE_nla_tweakmode_enter(), BKE_nlastrip_copy(), BKE_object_add_for_data(), BKE_object_copy_particlesystem(), BKE_object_material_from_eval_data(), BKE_paint_copy(), BKE_paint_palette_set(), BKE_pose_channel_copy_data(), BKE_pose_copy_data_ex(), BKE_sound_new_file_exists_ex(), BKE_vfont_load_exists_ex(), BKE_view_layer_copy_data(), BKE_workspace_layout_add(), blender::nodes::decl::IDSocketDeclaration::build(), collection_child_add(), blender::ed::object::collection_drop_exec(), blender::ed::object::collection_instance_add_exec(), blender::ed::outliner::collection_instance_exec(), collection_object_add(), con_fix_copied_refs_cb(), blender::ed::object::convert_mball_to_mesh(), copy_lineset(), blender::ed::object::copy_materials_to_new_geometry_object(), blender::bke::create_auto_smooth_modifier(), blender::ed::greasepencil::undo::StepDrawingReference::decode(), blender::ed::object::drop_geometry_nodes_invoke(), drop_world_exec(), ED_rigidbody_constraint_add(), blender::seq::effect_text_font_load(), foreach_assign_id_to_orig_callback(), foreach_libblock_make_usercounts_callback(), FRS_paste_active_lineset(), Freestyle::BlenderStrokeRenderer::GenerateStrokeMesh(), blender::animrig::generic_assign_action(), id_copy_libmanagement_cb(), id_fake_user_set(), IDP_AssignID(), IDP_CopyID(), IDP_New(), blender::nodes::node_composite_movieclip_cc::init(), blender::nodes::node_composite_moviedistortion_cc::init(), blender::nodes::node_composite_planetrackdeform_cc::init(), blender::nodes::node_composite_stabilize2d_cc::init(), blender::nodes::node_composite_trackpos_cc::init(), blender::nodes::node_composite_switchview_cc::init_switch_view(), blender::ed::mesh::join_objects_exec(), blender::bke::greasepencil::convert::legacy_gpencil_object(), libblock_management_us_plus(), loose_data_instantiate_collection_process(), loose_data_instantiate_obdata_process(), blender::ed::object::make_links_data_exec(), blender::ed::object::make_local_all__instance_indirect_unused(), mesh_separate_material_assign_mat_nr(), blender::ed::object::modifier_add_asset_exec(), modifier_copy_data_id_us_cb(), blender::ed::space_node::node_add_collection_exec(), blender::ed::space_node::node_add_group_exec(), blender::ed::space_node::node_add_mask_exec(), blender::ed::space_node::node_add_material_exec(), blender::ed::space_node::node_add_object_exec(), blender::nodes::node_composite_keyingscreen_cc::node_composit_init_keyingscreen(), blender::nodes::node_composite_render_layer_cc::node_composit_init_rlayers(), blender::bke::node_copy_with_mapping(), blender::ed::space_node::node_duplicate_exec(), blender::ed::space_node::node_id_remap(), blender::bke::node_init(), blender::nodes::node_composite_cryptomatte_cc::node_init_api_cryptomatte(), blender::ed::space_node::node_link_item_apply(), node_socket_copy_default_value_data(), blender::ed::space_node::node_swap_group_asset_invoke(), object_add_or_copy_particle_system(), blender::ed::object::object_data_convert_curve_to_mesh(), blender::ed::object::object_grease_pencil_add_exec(), blender::ed::object::object_image_add_invoke(), object_material_assign(), blender::nodes::old_id_property_type_matches_socket_convert_to_new(), paste_material_nodetree_ids_relink_or_clear(), paste_mtex_copybuf(), blender::ed::space_node::NodeClipboard::paste_update_node_id_references(), blender::io::usd::USDXformReader::read_object_data(), blender::ed::outliner::restrictbutton_id_user_toggle(), blender::ed::space_node::search_link_ops_for_asset_metadata(), set_current_brush_texture(), set_current_linestyle_texture(), set_current_particle_texture(), blender::io::usd::USDInstanceReader::set_instance_collection(), blender::io::alembic::AbcObjectReader::setupObjectTransform(), blender::ed::object::shade_auto_smooth_exec(), shaderfx_copy_data_id_us_cb(), blender::bke::node_interface::socket_types::socket_data_id_user_increment(), blender::bke::node_interface::socket_types::socket_data_id_user_increment(), blender::bke::node_interface::socket_types::socket_data_id_user_increment(), blender::bke::node_interface::socket_types::socket_data_id_user_increment(), blender::bke::node_interface::socket_types::socket_data_id_user_increment(), blender::bke::socket_id_user_increment(), solve_camera_freejob(), blender::seq::strip_duplicate(), template_id_cb(), tracking_plane_tracks_copy(), tracking_tracks_copy(), txt_add_object(), WM_drag_free_imported_drag_ID(), and WM_operator_drop_load_path().
| void id_us_plus_no_lib | ( | ID * | id | ) |
Same as id_us_plus, but does not handle lib indirect -> extern. Only used by readfile.cc so far, but simpler/safer to keep it here nonetheless.
Definition at line 342 of file lib_id.cc.
References BLI_assert, ID_TAG_EXTRAUSER, and ID_TAG_EXTRAUSER_SET.
Referenced by blender::bke::id::IDRemapper::apply(), blendfile_library_relocate_id_remap_finalize(), foreach_libblock_remap_callback_apply(), id_copy_libmanagement_cb(), id_refcount_recompute_callback(), id_us_plus(), blender::bke::greasepencil::convert::legacy_gpencil_sanitize_annotations(), and scene_foreach_toolsettings_id_pointer_process().