|
Blender
V2.93
|
#include "BLI_compiler_attrs.h"Go to the source code of this file.
Macros | |
| #define | MAIN_ID_SESSION_UUID_UNSET 0 |
| #define | MAX_ID_FULL_NAME (64 + 64 + 3 + 1) /* 64 is MAX_ID_NAME - 2 */ |
| #define | MAX_ID_FULL_NAME_UI (MAX_ID_FULL_NAME + 3) /* Adds 'keycode' two letters at beginning. */ |
| #define | IS_TAGGED(_id) ((_id) && (((ID *)_id)->tag & LIB_TAG_DOIT)) |
Typedefs | |
| typedef enum eLibIDDuplicateFlags | eLibIDDuplicateFlags |
Functions | |
| size_t | BKE_libblock_get_alloc_info (short type, const char **name) |
| void * | BKE_libblock_alloc_notest (short type) ATTR_WARN_UNUSED_RESULT |
| void * | BKE_libblock_alloc (struct Main *bmain, short type, const char *name, const int flag) ATTR_WARN_UNUSED_RESULT |
| void | BKE_libblock_init_empty (struct ID *id) ATTR_NONNULL(1) |
| void | BKE_lib_libblock_session_uuid_ensure (struct ID *id) |
| void | BKE_lib_libblock_session_uuid_renew (struct ID *id) |
| void * | BKE_id_new (struct Main *bmain, const short type, const char *name) |
| void * | BKE_id_new_nomain (const short type, const char *name) |
| void | BKE_libblock_copy_ex (struct Main *bmain, const struct ID *id, struct ID **r_newid, const int orig_flag) |
| void * | BKE_libblock_copy (struct Main *bmain, const struct ID *id) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL() |
| void * | BKE_libblock_copy_for_localize (const struct ID *id) |
| void | BKE_libblock_rename (struct Main *bmain, struct ID *id, const char *name) ATTR_NONNULL() |
| void | BLI_libblock_ensure_unique_name (struct Main *bmain, const char *name) ATTR_NONNULL() |
| struct ID * | BKE_libblock_find_name (struct Main *bmain, const short type, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL() |
| void | BKE_libblock_free_datablock (struct ID *id, const int flag) ATTR_NONNULL() |
| void | BKE_libblock_free_data (struct ID *id, const bool do_id_user) ATTR_NONNULL() |
| void | BKE_libblock_free_data_py (struct ID *id) |
| void | BKE_id_free_ex (struct Main *bmain, void *idv, int flag, const bool use_flag_from_idtag) |
| void | BKE_id_free (struct Main *bmain, void *idv) |
| void | BKE_id_free_us (struct Main *bmain, void *idv) ATTR_NONNULL() |
| void | BKE_id_delete (struct Main *bmain, void *idv) ATTR_NONNULL() |
| size_t | BKE_id_multi_tagged_delete (struct Main *bmain) ATTR_NONNULL() |
| void | BKE_libblock_management_main_add (struct Main *bmain, void *idv) |
| void | BKE_libblock_management_main_remove (struct Main *bmain, void *idv) |
| void | BKE_libblock_management_usercounts_set (struct Main *bmain, void *idv) |
| void | BKE_libblock_management_usercounts_clear (struct Main *bmain, void *idv) |
| void | id_lib_extern (struct ID *id) |
| void | id_lib_indirect_weak_link (struct ID *id) |
| void | id_us_ensure_real (struct ID *id) |
| void | id_us_clear_real (struct ID *id) |
| void | id_us_plus_no_lib (struct ID *id) |
| void | id_us_plus (struct ID *id) |
| void | id_us_min (struct ID *id) |
| void | id_fake_user_set (struct ID *id) |
| void | id_fake_user_clear (struct ID *id) |
| void | BKE_id_clear_newpoin (struct ID *id) |
| void | BKE_lib_id_make_local_generic (struct Main *bmain, struct ID *id, const int flags) |
| bool | BKE_lib_id_make_local (struct Main *bmain, struct ID *id, const bool test, const int flags) |
| bool | id_single_user (struct bContext *C, struct ID *id, struct PointerRNA *ptr, struct PropertyRNA *prop) |
| bool | BKE_id_copy_is_allowed (const struct ID *id) |
| struct ID * | BKE_id_copy (struct Main *bmain, const struct ID *id) |
| struct ID * | BKE_id_copy_ex (struct Main *bmain, const struct ID *id, struct ID **r_newid, const int flag) |
| struct ID * | BKE_id_copy_for_duplicate (struct Main *bmain, struct ID *id, const uint duplicate_flags) |
| void | BKE_lib_id_swap (struct Main *bmain, struct ID *id_a, struct ID *id_b) |
| void | BKE_lib_id_swap_full (struct Main *bmain, struct ID *id_a, struct ID *id_b) |
| void | id_sort_by_name (struct ListBase *lb, struct ID *id, struct ID *id_sorting_hint) |
| void | BKE_lib_id_expand_local (struct Main *bmain, struct ID *id) |
| bool | BKE_id_new_name_validate (struct ListBase *lb, struct ID *id, const char *name) ATTR_NONNULL(1 |
| bool void | BKE_lib_id_clear_library_data (struct Main *bmain, struct ID *id) |
| void | BKE_main_id_tag_idcode (struct Main *mainvar, const short type, const int tag, const bool value) |
| void | BKE_main_id_tag_listbase (struct ListBase *lb, const int tag, const bool value) |
| void | BKE_main_id_tag_all (struct Main *mainvar, const int tag, const bool value) |
| void | BKE_main_id_flag_listbase (struct ListBase *lb, const int flag, const bool value) |
| void | BKE_main_id_flag_all (struct Main *bmain, const int flag, const bool value) |
| void | BKE_main_id_clear_newpoins (struct Main *bmain) |
| void | BKE_main_id_refcount_recompute (struct Main *bmain, const bool do_linked_only) |
| void | BKE_main_lib_objects_recalc_all (struct Main *bmain) |
| void | BKE_main_id_repair_duplicate_names_listbase (struct ListBase *lb) |
| void | BKE_id_full_name_get (char name[MAX_ID_FULL_NAME], const struct ID *id, char separator_char) |
| void | BKE_id_full_name_ui_prefix_get (char name[MAX_ID_FULL_NAME_UI], const struct ID *id, const bool add_lib_hint, char separator_char, int *r_prefix_len) |
| char * | BKE_id_to_unique_string_key (const struct ID *id) |
| void | BKE_library_make_local (struct Main *bmain, const struct Library *lib, struct GHash *old_to_new_ids, const bool untagged_only, const bool set_fake) |
| void | BKE_id_tag_set_atomic (struct ID *id, int tag) |
| void | BKE_id_tag_clear_atomic (struct ID *id, int tag) |
| bool | BKE_id_is_in_global_main (struct ID *id) |
| bool | BKE_id_can_be_asset (const struct ID *id) |
| void | BKE_id_ordered_list (struct ListBase *ordered_lb, const struct ListBase *lb) |
| void | BKE_id_reorder (const struct ListBase *lb, struct ID *id, struct ID *relative, bool after) |
| void | BKE_id_blend_write (struct BlendWriter *writer, struct ID *id) |
API to manage data-blocks inside of Blender's Main data-base, or as independent runtime-only data.
BKE_lib_ files are for operations over data-blocks themselves, although they might alter Main as well (when creating/renaming/deleting an ID e.g.).BKE_lib_id_ should be used for rather high-level operations, that involve Main database and relations with other IDs, and can be considered as 'safe' (as in, in themselves, they leave affected IDs/Main in a consistent status).BKE_lib_libblock_ should be used for lower level operations, that perform some parts of BKE_lib_id_ ones, but will generally not ensure caller that affected data is in a consistent state by their own execution alone.BKE_lib_main_ should be used for operations performed over all IDs of a given Main data-base.BKE_lib_libblock_ functions, except in some specific cases requiring advanced (and potentially dangerous) handling. Definition in file BKE_lib_id.h.
| #define IS_TAGGED | ( | _id | ) | ((_id) && (((ID *)_id)->tag & LIB_TAG_DOIT)) |
Definition at line 322 of file BKE_lib_id.h.
| #define MAIN_ID_SESSION_UUID_UNSET 0 |
Definition at line 73 of file BKE_lib_id.h.
| #define MAX_ID_FULL_NAME (64 + 64 + 3 + 1) /* 64 is MAX_ID_NAME - 2 */ |
Definition at line 293 of file BKE_lib_id.h.
| #define MAX_ID_FULL_NAME_UI (MAX_ID_FULL_NAME + 3) /* Adds 'keycode' two letters at beginning. */ |
Definition at line 294 of file BKE_lib_id.h.
| typedef enum eLibIDDuplicateFlags eLibIDDuplicateFlags |
Duplicate (a.k.a. deep copy) common processing options. See also eDupli_ID_Flags for options controlling what kind of IDs to duplicate.
| anonymous enum |
New ID creation/copying options.
| Enumerator | |
|---|---|
| LIB_ID_CREATE_NO_MAIN | Create datablock outside of any main database - similar to 'localize' functions of materials etc. |
| LIB_ID_CREATE_NO_USER_REFCOUNT | Do not affect user refcount of datablocks used by new one (which also gets zero usercount then). Implies LIB_ID_CREATE_NO_MAIN. |
| LIB_ID_CREATE_NO_ALLOCATE | Assume given 'newid' already points to allocated memory for whole datablock (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 LIB_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 LIB_TAG_COPIED_ON_WRITE must be set. Internally this is used to share some pointers instead of duplicating them. |
| 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 datablock localization routines. |
| LIB_ID_COPY_CD_REFERENCE | Mesh: Reference CD data layers instead of doing real copy - USE WITH CAUTION! |
| LIB_ID_COPY_NO_LIB_OVERRIDE | Do not copy id->override_library, used by ID datablock override routines. |
| LIB_ID_COPY_ACTIONS | EXCEPTION! Deep-copy actions used by animdata of copied ID. |
| LIB_ID_COPY_KEEP_LIB | Keep the library pointer when copying datablock outside of bmain. |
| LIB_ID_COPY_SHAPEKEY | EXCEPTION! Deep-copy shapekeys 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_DEFAULT | Shapekeys 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 COW e.g.). |
Definition at line 84 of file BKE_lib_id.h.
| 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 refcount of datablocks used by freed one. Implies LIB_ID_FREE_NO_MAIN. |
| LIB_ID_FREE_NOT_ALLOCATED | Assume freed ID datablock 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/... |
Definition at line 185 of file BKE_lib_id.h.
| 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. |
| LIB_ID_MAKELOCAL_OBJECT_NO_PROXY_CLEARING | For Objects, do not clear the proxy pointers while making the data-block local. |
Definition at line 238 of file BKE_lib_id.h.
| 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 |
| 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 169 of file BKE_lib_id.h.
| void BKE_id_blend_write | ( | struct BlendWriter * | writer, |
| struct ID * | id | ||
| ) |
Definition at line 2395 of file lib_id.c.
References ID::asset_data, BKE_asset_metadata_write(), BLO_write_string(), BLO_write_struct, BLO_write_struct_list, ELEM, GS, id, ID_WM, IDP_BlendWrite(), LISTBASE_FOREACH, ID::name, ID::override_library, IDOverrideLibrary::properties, and ID::properties.
Referenced by action_blend_write(), armature_blend_write(), BKE_collection_blend_write_nolib(), brush_blend_write(), cache_file_blend_write(), camera_blend_write(), curve_blend_write(), greasepencil_blend_write(), hair_blend_write(), image_blend_write(), lattice_blend_write(), light_blend_write(), lightprobe_blend_write(), linestyle_blend_write(), mask_blend_write(), material_blend_write(), mesh_blend_write(), metaball_blend_write(), movieclip_blend_write(), ntreeBlendWrite(), 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(), simulation_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(), world_blend_write(), and write_libraries().
| bool BKE_id_can_be_asset | ( | const struct ID * | id | ) |
Referenced by ED_asset_mark_id().
| void BKE_id_clear_newpoin | ( | struct ID * | id | ) |
Referenced by action_create_new(), animdata_copy_id_action(), BCAnimation::BCAnimation(), BKE_animdata_merge_copy(), BKE_gpencil_data_duplicate(), BKE_lib_override_library_operations_store_start(), BKE_lib_override_library_update(), BKE_scene_duplicate(), brush_add_exec(), brush_add_gpencil_exec(), brush_make_local(), copy_particle_systems_to_object(), DocumentImporter::create_instance_node(), duplibase_for_convert(), ED_mesh_join_objects_exec(), geometry_extract_apply(), make_object_duplilist_real(), new_particle_settings_exec(), new_texture_exec(), nlaedit_apply_scale_exec(), nlaedit_make_single_user_exec(), node_group_ungroup(), object_convert_exec(), object_make_local(), paint_mask_slice_exec(), separate_exec(), single_mat_users(), single_obdata_users(), and single_object_users_collection().
| struct ID* BKE_id_copy_ex | ( | struct Main * | bmain, |
| const struct ID * | id, | ||
| struct ID ** | r_newid, | ||
| const int | flag | ||
| ) |
Referenced by bc_get_mesh_copy(), BKE_animdata_copy(), BKE_hair_copy_for_eval(), BKE_lattice_modifiers_calc(), BKE_mesh_copy_for_eval(), BKE_mesh_create_derived_for_modifier(), BKE_nlastrip_copy(), BKE_pointcloud_copy_for_eval(), BKE_volume_copy_for_eval(), clip_start_prefetch_job(), curve_calc_modifiers_post(), curve_copy_data(), curve_from_curve_object(), curve_from_font_object(), deformVerts(), do_hair_dynamics(), duplicate_ids(), get_quick_mesh(), gpencil_copy_for_eval(), blender::compositor::MaskOperation::initExecution(), lattice_copy_data(), lib_override_library_create_from(), light_copy_data(), linestyle_copy_data(), material_copy_data(), mesh_copy_data(), mesh_new_from_mesh(), MOD_deform_mesh_eval_get(), modifyMesh(), new_material_exec(), new_world_exec(), normalEditModifier_do(), ntreeCopyTree_ex(), ntreeLocalize(), object_for_curve_to_mesh_create(), particle_settings_localize(), preview_get_localized_world(), psys_thread_context_init_distribute(), remap_hair_emitter(), scene_copy_data(), seq_render_mask(), simulation_copy_data(), texture_copy_data(), undomesh_from_editmesh(), and world_copy_data().
| struct ID* BKE_id_copy_for_duplicate | ( | struct Main * | bmain, |
| struct ID * | id, | ||
| const uint | duplicate_flags | ||
| ) |
Referenced by BKE_object_duplicate(), BKE_scene_duplicate(), and collection_duplicate_recursive().
| bool BKE_id_copy_is_allowed | ( | const struct ID * | id | ) |
Referenced by template_ID().
| void BKE_id_delete | ( | Main * | bmain, |
| void * | idv | ||
| ) |
Properly delete a single ID from given bmain database.
Definition at line 380 of file lib_id_delete.c.
References BKE_main_id_tag_all(), id_delete(), and LIB_TAG_DOIT.
Referenced by BKE_blendfile_read_make_empty(), BKE_brush_delete(), BKE_collection_delete(), BKE_lib_override_library_create_from_tag(), BLO_main_validate_shapekeys(), BLO_update_defaults_startup_blend(), collection_unlink_exec(), ED_scene_delete(), id_delete(), Freestyle::PythonInterpreter::interpretFile(), outliner_object_delete_fn(), text_unlink_exec(), trace_end_job(), volume_import_exec(), WM_drag_free_imported_drag_ID(), and BCAnimation::~BCAnimation().
| 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 199 of file lib_id_delete.c.
References BKE_id_free_ex().
Referenced by bake(), BKE_crazyspace_build_sculpt(), BKE_crazyspace_get_first_deform_matrices_editbmesh(), BKE_editmesh_free_derivedmesh(), BKE_fluid_modifier_freeEffector(), BKE_fluid_modifier_freeFlow(), BKE_id_free_us(), BKE_image_merge(), BKE_mesh_create_derived_for_modifier(), BKE_mesh_eval_geometry(), BKE_mesh_from_nurbs_displist(), BKE_mesh_mirror_apply_mirror_on_axis_for_modifier(), BKE_mesh_nomain_to_mesh(), BKE_mesh_remesh_voxel_fix_poles(), BKE_mesh_runtime_clear_cache(), BKE_object_free_caches(), BKE_object_to_curve_clear(), BKE_object_to_mesh_clear(), BKE_sculpt_get_first_deform_matrices(), BKE_workspace_layout_remove(), BKE_workspace_remove(), bpy_bmesh_from_object(), C_BVHTree_FromObject(), canvas_copyMesh(), MeshComponent::clear(), PointCloudComponent::clear(), VolumeComponent::clear(), cloth_build_springs(), construct_param_handle_subsurfed(), curve_calc_modifiers_post(), deformMatrices(), deformVerts(), deformVertsEM(), distribute_particles_on_dm(), do_hair_dynamics(), dynamicPaint_brushMeshCalculateVelocity(), dynamicPaint_Modifier_apply(), dynamicPaint_Modifier_free_runtime(), dynamicPaint_paintMesh(), ED_workspace_delete(), editbmesh_calc_modifiers(), EEVEE_shaders_free(), final_skin(), blender::io::alembic::ABCGenericMeshWriter::free_export_mesh(), blender::io::usd::USDGenericMeshWriter::free_export_mesh(), blender::io::alembic::ABCMetaballWriter::free_export_mesh(), blender::io::usd::USDMetaballWriter::free_export_mesh(), free_hair(), freeData(), geometry_extract_apply(), gpencil_do_frame_fill(), hair_evaluate_modifiers(), blender::compositor::MaskOperation::initExecution(), knifeproject_poly_from_object(), lib_relocate_do(), mesh_calc_modifiers(), mesh_new_from_curve_type_object(), mirrorModifier__doMirror(), MOD_deform_mesh_eval_get(), modifier_apply_shape(), modifier_modify_mesh_and_geometry_set(), modifyMesh(), multiresModifier_reshapeFromDeformModifier(), node_group_ungroup(), GeometryExporter::operator()(), paint_mask_slice_exec(), psys_thread_context_init_distribute(), quadriflow_start_job(), RE_bake_normal_world_to_tangent(), RE_bake_pixels_populate_from_objects(), read_libblock(), remap_hair_emitter(), remesh_symmetry_bisect(), remesh_symmetry_mirror(), MeshComponent::replace_mesh_but_keep_vertex_group_names(), sculpt_gesture_trim_geometry_free(), sculpt_gesture_trim_normals_update(), seq_render_mask(), and volume_evaluate_modifiers().
| void BKE_id_free_ex | ( | Main * | bmain, |
| void * | idv, | ||
| int | flag, | ||
| const 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 LIB_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 | 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 datablock, even if some overriding ones are passed in flag parameter. |
Definition at line 106 of file lib_id_delete.c.
References BKE_id_free_ex(), BKE_key_from_id(), BKE_libblock_free_data(), BKE_libblock_free_data_py(), BKE_libblock_free_datablock(), BKE_libblock_relink_ex(), BKE_main_lock(), BKE_main_unlock(), BLI_assert, BLI_remlink(), DEG_id_type_tag(), free_notifier_reference_cb, GS, id, Key::id, Main::is_locked_for_linking, LIB_ID_FREE_NO_DEG_TAG, LIB_ID_FREE_NO_MAIN, LIB_ID_FREE_NO_UI_USER, LIB_ID_FREE_NO_USER_REFCOUNT, LIB_ID_FREE_NOT_ALLOCATED, LIB_TAG_NO_MAIN, LIB_TAG_NO_USER_REFCOUNT, LIB_TAG_NOT_ALLOCATED, MEM_freeN, ID::name, NULL, remap_editor_id_reference_cb, ID::tag, type, and which_libbase().
Referenced by BKE_id_free(), BKE_id_free_ex(), BKE_lib_override_library_operations_store_finalize(), BKE_lib_override_library_operations_store_start(), BKE_lib_override_library_update(), BKE_main_free(), ED_mesh_join_objects_exec(), and id_delete().
| void BKE_id_free_us | ( | Main * | bmain, |
| void * | idv | ||
| ) |
Not really a freeing function by itself, it decrements usercount of given id, and only frees it if it reaches 0.
Definition at line 208 of file lib_id_delete.c.
References BKE_id_free(), BKE_libblock_unlink(), GS, id, ID_OB, id_us_clear_real(), id_us_min(), ID::lib, ID::name, NULL, and ID::us.
Referenced by BKE_mesh_from_nurbs_displist(), BKE_object_shapekey_free(), collection_object_remove(), DocumentImporter::create_camera_object(), DocumentImporter::create_light_object(), MeshImporter::create_mesh_object(), and import_endjob().
| void BKE_id_full_name_get | ( | char | name[MAX_ID_FULL_NAME], |
| const struct ID * | id, | ||
| char | separator_char | ||
| ) |
| void BKE_id_full_name_ui_prefix_get | ( | char | name[MAX_ID_FULL_NAME_UI], |
| const struct ID * | id, | ||
| const bool | add_lib_hint, | ||
| char | separator_char, | ||
| int * | r_prefix_len | ||
| ) |
Referenced by add_collection_search_item(), id_search_add(), and ui_rna_collection_search_update_fn().
| 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 2287 of file lib_id.c.
References BLI_findindex(), G_MAIN, GS, id, ID::name, NULL, and which_libbase().
Referenced by bpy_bmesh_to_mesh(), pygpu_offscreen_draw_view3d(), and pyrna_struct_keyframe_insert().
| size_t BKE_id_multi_tagged_delete | ( | Main * | bmain | ) |
Properly delete all IDs tagged with LIB_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 398 of file lib_id_delete.c.
References id_delete().
Referenced by BKE_lib_override_library_delete(), BKE_lib_override_library_resync(), bpy_batch_remove(), bpy_orphans_purge(), object_delete_exec(), outliner_delete_exec(), and outliner_orphans_purge_exec().
| void* BKE_id_new | ( | Main * | bmain, |
| const short | type, | ||
| const char * | name | ||
| ) |
Generic helper to create a new empty data-block of given type in given bmain database.
| name | can be NULL, in which case we get default name for this ID type. |
Definition at line 1177 of file lib_id.c.
References BKE_idtype_idcode_to_name(), BKE_libblock_alloc(), BKE_libblock_init_empty(), BLI_assert, DATA_, id, NULL, and type.
Referenced by BKE_action_add(), BKE_armature_add(), BKE_brush_add(), BKE_cachefile_add(), BKE_camera_add(), BKE_hair_add(), 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_simulation_add(), BKE_speaker_add(), BKE_text_add(), BKE_texture_add(), BKE_volume_add(), BKE_workspace_add(), BKE_world_add(), collection_add(), and movieclip_alloc().
Referenced by versions_gpencil_add_main().
| void* BKE_id_new_nomain | ( | const short | type, |
| const char * | name | ||
| ) |
Generic helper to create a new temporary empty data-block of given type, outside of any Main database.
| name | can be NULL, in which case we get default name for this ID type. |
Definition at line 1196 of file lib_id.c.
References BKE_idtype_idcode_to_name(), BKE_libblock_alloc(), BKE_libblock_init_empty(), DATA_, id, LIB_ID_CREATE_NO_DEG_TAG, LIB_ID_CREATE_NO_MAIN, LIB_ID_CREATE_NO_USER_REFCOUNT, NULL, and type.
Referenced by BKE_hair_new_for_eval(), BKE_mesh_from_bmesh_for_eval_nomain(), BKE_mesh_from_bmesh_nomain(), BKE_mesh_from_nurbs_displist(), BKE_mesh_new_nomain_from_template_ex(), BKE_mesh_wrapper_from_editmesh_with_coords(), BKE_pointcloud_new_for_eval(), BKE_volume_new_for_eval(), blender::nodes::create_cube_mesh(), blender::nodes::create_ico_sphere_mesh(), EEVEE_material_default_diffuse_get(), EEVEE_material_default_error_get(), EEVEE_material_default_glossy_get(), EEVEE_world_default_get(), blender::ed::spreadsheet::get_display_geometry_set(), and mesh_new_from_mball_object().
Referenced by ED_workspace_delete(), space_workspace_cycle_invoke(), and template_ID_tabs().
| void BKE_id_tag_clear_atomic | ( | struct ID * | id, |
| int | tag | ||
| ) |
Definition at line 2278 of file lib_id.c.
References atomic_fetch_and_and_int32(), id, and ID::tag.
| void BKE_id_tag_set_atomic | ( | struct ID * | id, |
| int | tag | ||
| ) |
Definition at line 2273 of file lib_id.c.
References atomic_fetch_and_or_int32(), id, and ID::tag.
| char* BKE_id_to_unique_string_key | ( | const struct ID * | id | ) |
Generate a concatenation of ID name (including two-chars type code) and its lib name, if any.
Definition at line 2260 of file lib_id.c.
References BLI_sprintfN(), BLI_strdup(), id, Library::id, ID::lib, ID::name, and NULL.
Referenced by gpencil_strokes_copypastebuf_colors_material_to_name_create(), and gpencil_strokes_copypastebuf_colors_name_to_material_create().
Definition at line 202 of file lib_id.c.
References lib_id_clear_library_data_ex().
Referenced by brush_make_local(), id_local_fn(), and object_make_local().
Expand ID usages of given id as 'extern' (and no more indirect) linked data. Used by ID copy/make_local functions.
Definition at line 393 of file lib_id.c.
References BKE_library_foreach_ID_link(), IDWALK_READONLY, and lib_id_expand_local_cb().
Referenced by BKE_lib_id_make_local_generic(), BKE_library_make_local(), brush_make_local(), lib_id_copy_ensure_local(), and object_make_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 479 of file lib_id.c.
References BKE_idtype_get_info_from_id(), BKE_lib_id_make_local_generic(), BLI_assert, IDTypeInfo::flags, id, IDTYPE_FLAGS_NO_MAKELOCAL, LIB_ID_MAKELOCAL_FULL_LIBRARY, LIB_TAG_INDIRECT, IDTypeInfo::make_local, NULL, and ID::tag.
Referenced by BKE_library_make_local(), brush_make_local(), id_local_fn(), template_ID(), and template_id_cb().
Generic 'make local' function, works for most of data-block types...
Definition at line 412 of file lib_id.c.
References BKE_id_copy(), BKE_key_from_id(), BKE_lib_id_expand_local(), BKE_libblock_remap(), BKE_library_ID_test_usages(), GS, id, ID_IS_LINKED, ID_NEW_SET, ID_REMAP_SKIP_INDIRECT_USAGE, ID_SCE, lib_id_clear_library_data_ex(), LIB_ID_MAKELOCAL_FULL_LIBRARY, ID::name, ntree, ntreeFromID(), NULL, and ID::us.
Referenced by BKE_lib_id_make_local(), and camera_make_local().
Does a mere memory swap over the whole IDs data (including type-specific memory).
| bmain | May be NULL, in which case there will be no remapping of internal pointers to itself. |
Definition at line 729 of file lib_id.c.
References id_swap().
Referenced by brush_undo_preserve(), lib_override_id_swap(), and palette_undo_preserve().
Does a mere memory swap over the whole IDs data (including type-specific memory).
| bmain | May be NULL, in which case there will be no remapping of internal pointers to itself. |
Definition at line 741 of file lib_id.c.
References id_swap().
Referenced by read_libblock_undo_restore_at_old_address().
| void BKE_lib_libblock_session_uuid_ensure | ( | ID * | id | ) |
Generate a session-wise uuid for the given id.
Definition at line 1145 of file lib_id.c.
References atomic_add_and_fetch_uint32(), BLI_assert, global_session_uuid, id, LIB_TAG_TEMP_MAIN, MAIN_ID_SESSION_UUID_UNSET, ID::session_uuid, ID::tag, and UNLIKELY.
Referenced by BKE_lib_libblock_session_uuid_renew(), BKE_libblock_alloc(), BKE_libblock_management_main_add(), create_placeholder(), direct_link_id_common(), and versions_gpencil_add_main().
| void BKE_lib_libblock_session_uuid_renew | ( | ID * | id | ) |
Re-generate a new session-wise uuid for the given id.
Definition at line 1166 of file lib_id.c.
References BKE_lib_libblock_session_uuid_ensure(), and MAIN_ID_SESSION_UUID_UNSET.
Referenced by lib_id_clear_library_data_ex(), and setup_app_data().
| void* BKE_libblock_alloc | ( | Main * | bmain, |
| short | type, | ||
| const char * | name, | ||
| const int | flag | ||
| ) |
Allocates and returns a 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 1062 of file lib_id.c.
References BKE_id_new_name_validate(), BKE_lib_libblock_session_uuid_ensure(), BKE_libblock_alloc_notest(), BKE_main_lock(), BKE_main_unlock(), BLI_addtail(), BLI_assert, BLI_strncpy(), DEG_id_type_tag(), ELEM, IDCopyLibManagementData::flag, id, ID_GR, 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, LIB_TAG_LOCALIZED, LIB_TAG_NO_MAIN, LIB_TAG_NO_USER_REFCOUNT, ID::name, NULL, type, and which_libbase().
Referenced by BKE_collection_master_add(), BKE_curve_add(), BKE_gpencil_data_addnew(), BKE_id_new(), BKE_id_new_nomain(), BKE_libblock_copy_ex(), BKE_linestyle_new(), BKE_mesh_new_nomain(), BKE_object_add_only_object(), BKE_pointcloud_add_default(), BKE_pointcloud_new_nomain(), BKE_sound_new_file(), BKE_text_load_ex(), BKE_vfont_load(), blo_find_main(), cachefile_open_exec(), image_alloc(), mask_alloc(), ntreeAddTree(), screen_add(), and wm_add_default().
| void* 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 1045 of file lib_id.c.
References BKE_libblock_get_alloc_info(), BLI_assert, MEM_callocN, NULL, size(), and type.
Referenced by BKE_libblock_alloc(), create_placeholder(), and blender::deg::IDNode::init_copy_on_write().
| void BKE_libblock_copy_ex | ( | struct Main * | bmain, |
| const struct ID * | id, | ||
| struct ID ** | r_newid, | ||
| const int | orig_flag | ||
| ) |
| void* BKE_libblock_copy_for_localize | ( | const struct ID * | id | ) |
Definition at line 1333 of file lib_id.c.
References BLI_assert, BLI_findstring(), NULL, type, and which_libbase().
Referenced by arg_handle_python_text_run(), BKE_scene_set_name(), collection_instance_add_exec(), drop_named_material_invoke(), gpencil_stroke_change_color_exec(), node_add_collection_get_and_poll_collection_node_tree(), node_add_group_get_and_poll_group_node_tree(), node_add_mask_exec(), node_add_object_get_and_poll_object_node_tree(), node_add_texture_get_and_poll_texture_node_tree(), object_add_named_exec(), object_data_instance_add_exec(), object_select_mirror_exec(), object_select_same_collection_exec(), palette_join_exec(), read_libblock_undo_restore_linked(), sculpt_stroke_done(), sculpt_update_cache_invariants(), toolsystem_ref_link(), unpack_item_exec(), updateDuplicateCustomBoneShapes(), WM_drag_free_imported_drag_ID(), wm_lib_relocate_exec_do(), wm_lib_relocate_invoke(), and WM_operator_drop_load_path().
| void BKE_libblock_free_data | ( | struct ID * | id, |
| const bool | do_id_user | ||
| ) |
Definition at line 55 of file lib_id_delete.c.
References ID::asset_data, BKE_animdata_free(), BKE_asset_metadata_free(), BKE_lib_override_library_free(), id, IDP_FreePropertyContent_ex(), MEM_freeN, NULL, ID::override_library, and ID::properties.
Referenced by BKE_collection_free(), BKE_gpencil_eval_delete(), BKE_id_free_ex(), BKE_mesh_eval_delete(), blender::deg::deg_free_copy_on_write_datablock(), ntree_free_data(), ntreeFreeEmbeddedTree(), ntreeFreeLocalTree(), particle_settings_free_local(), prefetch_freejob(), and wm_close_and_free_all().
| void BKE_libblock_free_data_py | ( | ID * | id | ) |
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 413 of file lib_id_delete.c.
References BPY_DECREF_RNA_INVALIDATE(), BPY_id_release(), id, ID::py_instance, and UNUSED_VARS.
Referenced by BKE_id_free_ex(), ntreeFreeEmbeddedTree(), scene_free_data(), and wm_close_and_free_all().
| void BKE_libblock_free_datablock | ( | struct ID * | id, |
| const int | flag | ||
| ) |
| size_t BKE_libblock_get_alloc_info | ( | short | type, |
| const char ** | name | ||
| ) |
Get allocation size of a given data-block type and optionally allocation name.
Definition at line 1024 of file lib_id.c.
References BKE_idtype_get_info_from_idcode(), IDTypeInfo::name, NULL, IDTypeInfo::struct_size, and type.
Referenced by BKE_id_copy_ex(), BKE_libblock_alloc_notest(), and BKE_libblock_copy_ex().
| 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 1122 of file lib_id.c.
References BKE_idtype_get_info_from_id(), BLI_assert, IDTypeInfo::init_data, and NULL.
Referenced by BKE_id_new(), BKE_id_new_nomain(), BKE_mesh_new_nomain(), and create_placeholder().
| void BKE_libblock_management_main_add | ( | Main * | bmain, |
| void * | idv | ||
| ) |
Add a 'NO_MAIN' data-block to given main (also sets usercounts of its IDs if needed).
Definition at line 812 of file lib_id.c.
References BKE_id_new_name_validate(), BKE_lib_libblock_session_uuid_ensure(), BKE_library_foreach_ID_link(), BKE_main_lock(), BKE_main_unlock(), BLI_addtail(), BLI_assert, GS, id, IDWALK_NOP, Main::is_memfile_undo_written, LIB_TAG_NO_MAIN, LIB_TAG_NO_USER_REFCOUNT, LIB_TAG_NOT_ALLOCATED, libblock_management_us_plus(), ID::name, NULL, ID::tag, and which_libbase().
| 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 844 of file lib_id.c.
References BKE_main_lock(), BKE_main_unlock(), BLI_assert, BLI_remlink(), GS, id, Main::is_memfile_undo_written, LIB_TAG_NO_MAIN, ID::name, NULL, ID::tag, and which_libbase().
| void BKE_libblock_management_usercounts_clear | ( | struct Main * | bmain, |
| void * | idv | ||
| ) |
Definition at line 875 of file lib_id.c.
References BKE_library_foreach_ID_link(), id, IDWALK_NOP, LIB_TAG_NO_MAIN, LIB_TAG_NO_USER_REFCOUNT, libblock_management_us_min(), NULL, and ID::tag.
| void BKE_libblock_management_usercounts_set | ( | struct Main * | bmain, |
| void * | idv | ||
| ) |
Definition at line 863 of file lib_id.c.
References BKE_library_foreach_ID_link(), id, IDWALK_NOP, LIB_TAG_NO_USER_REFCOUNT, libblock_management_us_plus(), NULL, and ID::tag.
Sets the name of a block to name, suitably adjusted for uniqueness.
Definition at line 2187 of file lib_id.c.
References BKE_id_new_name_validate(), GS, id, Main::is_memfile_undo_written, ID::name, and which_libbase().
Referenced by DocumentImporter::write_node().
| void BKE_main_id_clear_newpoins | ( | struct Main * | bmain | ) |
Definition at line 1738 of file lib_id.c.
References FOREACH_MAIN_ID_BEGIN, FOREACH_MAIN_ID_END, id, LIB_TAG_NEW, and NULL.
Referenced by BKE_collection_duplicate(), BKE_lib_override_library_create(), BKE_lib_override_library_resync(), BKE_library_make_local(), BKE_object_duplicate(), BKE_scene_duplicate(), copy_object_set_idnew(), duplicate_exec(), ED_object_add_duplicate(), ED_object_single_user(), id_local_fn(), id_override_library_create_fn(), make_object_duplilist_real(), make_single_user_exec(), object_duplicates_make_real_exec(), outliner_build_tree(), and template_id_cb().
| void BKE_main_id_flag_all | ( | Main * | bmain, |
| const int | flag, | ||
| const bool | value | ||
| ) |
Clear or set given flags for all ids in bmain (persistent flags).
Definition at line 956 of file lib_id.c.
References Freestyle::a, BKE_main_id_flag_listbase(), IDCopyLibManagementData::flag, INDEX_ID_MAX, and set_listbasepointers().
| void BKE_main_id_flag_listbase | ( | ListBase * | lb, |
| const int | flag, | ||
| const bool | value | ||
| ) |
Clear or set given flags for all ids in listbase (persistent flags).
Definition at line 937 of file lib_id.c.
References ListBase::first, IDCopyLibManagementData::flag, id, ID::next, and ID::tag.
Referenced by BKE_main_id_flag_all(), and id_search_cb_objects_from_scene().
| void BKE_main_id_refcount_recompute | ( | struct Main * | bmain, |
| const bool | do_linked_only | ||
| ) |
Definition at line 1773 of file lib_id.c.
References BKE_library_foreach_ID_link(), FOREACH_MAIN_ID_BEGIN, FOREACH_MAIN_ID_END, id, ID_FAKE_USERS, ID_IS_LINKED, id_refcount_recompute_callback(), id_us_ensure_real(), IDWALK_INCLUDE_UI, IDWALK_READONLY, LIB_TAG_EXTRAUSER, LIB_TAG_EXTRAUSER_SET, POINTER_FROM_INT, and ID::tag.
Referenced by blo_read_file_internal(), lib_relocate_do(), library_link_end(), and setup_app_data().
| void BKE_main_id_repair_duplicate_names_listbase | ( | struct ListBase * | lb | ) |
Definition at line 966 of file lib_id.c.
References BKE_id_new_name_validate(), BLI_gset_add(), BLI_gset_free(), BLI_gset_str_new_ex(), id, ID::lib, LISTBASE_FOREACH, MEM_freeN, MEM_mallocN, and NULL.
Referenced by blo_do_versions_280(), and blo_do_versions_290().
| void BKE_main_id_tag_all | ( | struct Main * | mainvar, |
| const int | tag, | ||
| const bool | value | ||
| ) |
Clear or set given tags for all ids in bmain (runtime tags).
Definition at line 923 of file lib_id.c.
References Freestyle::a, BKE_main_id_tag_listbase(), INDEX_ID_MAX, and set_listbasepointers().
Referenced by BKE_blendfile_write_partial_begin(), BKE_blendfile_write_partial_end(), BKE_collection_duplicate(), BKE_copybuffer_paste(), BKE_copybuffer_read(), BKE_id_delete(), BKE_lib_override_library_create(), BKE_lib_override_library_delete(), BKE_lib_override_library_main_resync(), BKE_lib_override_library_resync(), BKE_object_duplicate(), BKE_scene_duplicate(), blo_read_file_internal(), bpy_batch_remove(), bpy_lib_exit(), convert_proxy_to_override_exec(), copy_object_set_idnew(), duplicate_exec(), id_override_library_create_fn(), lib_relocate_do(), library_link_end(), make_local_exec(), make_override_library_exec(), object_delete_exec(), outliner_delete_exec(), previews_ensure_exec(), sorted_selected_editable_objects(), tag_localizable_objects(), WM_file_append_datablock(), and wm_link_append_exec().
| void BKE_main_id_tag_idcode | ( | struct Main * | mainvar, |
| const short | type, | ||
| const int | tag, | ||
| const bool | value | ||
| ) |
Clear or set given tags for all ids of given type in bmain (runtime tags).
Definition at line 910 of file lib_id.c.
References BKE_main_id_tag_listbase(), type, and which_libbase().
Referenced by bake_objects_check(), bake_targets_init_image_textures(), lib_relocate_do(), library_link_clear_tag(), and sound_update_animation_flags_exec().
| void BKE_main_id_tag_listbase | ( | ListBase * | lb, |
| const int | tag, | ||
| const bool | value | ||
| ) |
Clear or set given tags for all ids in listbase (runtime tags).
Definition at line 891 of file lib_id.c.
References ListBase::first, id, ID::next, and ID::tag.
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(), node_group_has_output(), object_delete_exec(), and previews_ensure_exec().
| void BKE_main_lib_objects_recalc_all | ( | struct Main * | bmain | ) |
Definition at line 997 of file lib_id.c.
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 BKE_copybuffer_paste(), BKE_copybuffer_read(), bpy_lib_exit(), lib_relocate_do(), outliner_id_remap_exec(), and wm_link_append_exec().
| void BLI_libblock_ensure_unique_name | ( | Main * | bmain, |
| const char * | name | ||
| ) |
Use after setting the ID's name When name exists: call 'new_id'
Definition at line 2165 of file lib_id.c.
References BKE_id_new_name_validate(), BLI_findstring(), GS, Main::is_memfile_undo_written, NULL, and which_libbase().
Referenced by BLO_update_defaults_startup_blend(), namebutton_fn(), and rename_id_for_versioning().
| void id_fake_user_clear | ( | struct ID * | id | ) |
Definition at line 336 of file lib_id.c.
References ID::flag, id, id_us_min(), and LIB_FAKEUSER.
Referenced by collection_link_exec(), ED_animedit_unlink_action(), id_fake_user_clear_fn(), lib_id_clear_library_data_ex(), lib_id_fake_user_toggle_exec(), lib_relocate_do_remap(), libblock_remap_data(), and template_id_cb().
| void id_fake_user_set | ( | struct ID * | id | ) |
Definition at line 328 of file lib_id.c.
References ID::flag, id, id_us_plus(), and LIB_FAKEUSER.
Referenced by BKE_lib_override_library_resync(), BKE_library_make_local(), BKE_text_add(), BKE_text_load_ex(), brush_copy_data(), brush_init_data(), brush_make_local(), collection_add_exec(), collection_create_exec(), do_versions_after_linking_280(), do_versions_after_linking_290(), ED_asset_mark_id(), ED_rigidbody_constraint_add(), id_fake_user_set_fn(), lib_id_fake_user_toggle_exec(), lib_relocate_do_remap(), libblock_remap_data(), mask_alloc(), mask_copy_data(), palette_init_data(), and unlink_collection_fn().
| void id_lib_extern | ( | struct ID * | id | ) |
Definition at line 207 of file lib_id.c.
References BKE_idtype_idcode_is_linkable(), BLI_assert, GS, id, ID_IS_LINKED, LIB_INDIRECT_WEAK_LINK, LIB_TAG_EXTERN, LIB_TAG_INDIRECT, ID::name, NULL, and ID::tag.
Referenced by armature_set_id_extern(), BKE_object_copy_proxy_drivers(), collection_instance_exec(), con_extern_cb(), id_us_plus(), and lib_id_expand_local_cb().
| void id_lib_indirect_weak_link | ( | struct ID * | id | ) |
Definition at line 220 of file lib_id.c.
References BKE_idtype_idcode_is_linkable(), BLI_assert, GS, id, ID_IS_LINKED, LIB_INDIRECT_WEAK_LINK, LIB_TAG_INDIRECT, ID::name, and ID::tag.
Referenced by layer_collection_sync().
| bool id_single_user | ( | bContext * | C, |
| ID * | id, | ||
| PointerRNA * | ptr, | ||
| PropertyRNA * | prop | ||
| ) |
Does not set ID->newid pointer.
Definition at line 747 of file lib_id.c.
References BKE_id_copy_ex(), C, CTX_data_main(), DEG_id_tag_update(), bGPdata::flag, GP_DATA_SHOW_ONIONSKINS, GS, id, ID_GD, ID_RECALC_GEOMETRY, ID_RECALC_TRANSFORM, id_us_min(), LIB_ID_COPY_ACTIONS, LIB_ID_COPY_DEFAULT, ID::name, NULL, ptr, RNA_id_pointer_create(), RNA_property_editable(), RNA_property_pointer_set(), and RNA_property_update().
Referenced by singleuser_action_fn(), 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 1348 of file lib_id.c.
References BLI_addhead(), BLI_assert, BLI_findindex(), BLI_insertlinkafter(), BLI_insertlinkbefore(), BLI_remlink(), BLI_strcasecmp(), ELEM, ListBase::first, id, ID_SORT_STEP_SIZE, ListBase::last, ID::lib, ID::name, ID::next, NULL, and ID::prev.
Referenced by BKE_blendfile_write_partial(), BKE_id_new_name_validate(), BLO_library_link_copypaste(), create_placeholder(), lib_relocate_do_remap(), and link_named_part().
| void id_us_clear_real | ( | struct ID * | id | ) |
Definition at line 257 of file lib_id.c.
References BLI_assert, id, ID_FAKE_USERS, LIB_TAG_EXTRAUSER, LIB_TAG_EXTRAUSER_SET, ID::tag, and ID::us.
Referenced by BKE_id_free_us(), BKE_libblock_remap_locked(), lib_relocate_do(), libblock_remap_data(), and template_id_cb().
| void id_us_ensure_real | ( | ID * | id | ) |
Ensure we have a real user
Definition at line 238 of file lib_id.c.
References BLI_assert, CLOG_ERROR, Library::filepath_abs, id, ID_FAKE_USERS, ID::lib, LIB_TAG_EXTRAUSER, LIB_TAG_EXTRAUSER_SET, LOG, ID::name, ID::tag, and ID::us.
Referenced by 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_find_main(), clip_id_remap(), direct_link_library(), ED_node_tree_push(), ED_node_tree_start(), ED_node_tree_update(), 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(), id_refcount_recompute_callback(), id_us_min(), image_id_remap(), libblock_management_us_plus(), node_id_remap(), restore_pointer_user(), scene_blend_read_data(), SEQ_add_mask_strip(), SEQ_add_movieclip_strip(), SEQ_add_scene_strip(), text_id_remap(), window_manager_blend_read_data(), and workspace_blend_read_data().
| void id_us_min | ( | struct ID * | id | ) |
Definition at line 297 of file lib_id.c.
References BLI_assert, CLOG_ERROR, Library::filepath_abs, GS, id, ID_FAKE_USERS, ID_IP, id_us_ensure_real(), ID::lib, LIB_TAG_EXTRAUSER, LOG, ID::name, ID::tag, and ID::us.
Referenced by action_create_new(), action_to_animato(), ANIM_remove_empty_action_from_animdata(), animdata_copy_id_action(), animrecord_check_state(), background_image_remove_exec(), BCAnimation::BCAnimation(), BKE_animdata_free(), BKE_animdata_set_action(), BKE_animdata_transfer_by_basepath(), BKE_brush_add_gpencil(), BKE_freestyle_config_free(), BKE_freestyle_lineset_delete(), BKE_gpencil_brush_material_set(), BKE_gpencil_brush_preset_set(), BKE_gpencil_object_material_new(), BKE_gpencil_palette_ensure(), 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_init(), BKE_library_update_ID_link_user(), BKE_mesh_assign_object(), BKE_mesh_from_nurbs_displist(), BKE_mesh_new_from_object_to_bmain(), BKE_mesh_nomain_to_mesh(), BKE_mesh_to_curve(), BKE_mesh_to_pointcloud(), BKE_nla_action_pushdown(), BKE_nla_tweakmode_exit(), BKE_nlastrip_free(), BKE_object_add_only_object(), BKE_object_material_assign(), BKE_object_material_resize(), BKE_object_material_slot_remove(), BKE_paint_brush_set(), BKE_paint_curve_set(), BKE_paint_init(), BKE_paint_palette_set(), BKE_paint_toolslots_brush_update_ex(), BKE_paint_toolslots_brush_validate(), 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_workspace_layout_remove(), BLO_update_defaults_startup_blend(), brush_add_exec(), brush_add_gpencil_exec(), brush_generic_tool_set(), brush_undo_preserve_cb(), cachefile_open_exec(), collection_add(), collection_child_remove(), collection_instance_fix_recursive(), collection_object_remove(), con_unlink_refs_cb(), copy_particle_systems_to_object(), DocumentImporter::create_instance_node(), do_version_layers_to_collections(), do_versions_ipos_to_animato(), duplibase_for_convert(), ED_mesh_join_objects_exec(), empty_drop_named_image_invoke(), eyedropper_add_palette_color(), font_open_exec(), foreach_libblock_remap_callback(), FRS_paste_active_lineset(), Freestyle::BlenderStrokeRenderer::GetStrokeShader(), gpencil_data_add_exec(), gpencil_data_unlink_exec(), gpencil_stroke_separate_exec(), id_fake_user_clear(), id_single_user(), IDP_AssignID(), IDP_FreePropertyContent_ex(), image_id_remap(), image_new_exec(), image_open_exec(), import_startjob(), ipo_to_animato(), lib_override_library_create_from(), lib_relocate_do(), libblock_management_us_min(), make_links_data_exec(), make_object_duplilist_real(), modifier_free_data_id_us_cb(), new_material_exec(), new_node_tree_exec(), new_particle_settings_exec(), new_texture_exec(), new_world_exec(), nlaedit_apply_scale_exec(), nlaedit_make_single_user_exec(), node_id_remap(), nodeRemoveNode(), object_convert_exec(), object_data_convert_curve_to_mesh(), object_make_local(), object_remove_particle_system(), object_unlink_data_exec(), open_exec(), paste_mtex_copybuf(), poselib_init_new(), poselib_unlink_exec(), restrictbutton_id_user_toggle(), scene_foreach_toolsettings_id_pointer_process(), separate_exec(), SEQ_effect_text_font_unload(), seq_sequence_free_ex(), sequencer_id_remap(), set_current_brush_texture(), set_current_linestyle_texture(), set_current_particle_texture(), shaderfx_free_data_id_us_cb(), single_obdata_users(), single_object_users_collection(), socket_id_user_decrement(), solve_camera_freejob(), template_id_cb(), unlink_material_fn(), unlink_texture_fn(), unlink_world_fn(), and MeshImporter::write_geometry().
| void id_us_plus | ( | struct ID * | id | ) |
Definition at line 288 of file lib_id.c.
References id_lib_extern(), and id_us_plus_no_lib().
Referenced by add_collections_to_scene(), add_loose_object_data_to_scene(), blender::io::alembic::AbcObjectReader::addCacheModifier(), BKE_animdata_copy(), BKE_animdata_merge_copy(), BKE_animdata_set_action(), BKE_gpencil_brush_material_set(), BKE_id_material_append(), BKE_id_material_assign(), BKE_id_materials_copy(), BKE_image_load_exists_ex(), BKE_lib_override_library_copy(), BKE_lib_override_library_init(), BKE_library_update_ID_link_user(), BKE_linestyle_alpha_modifier_copy(), BKE_linestyle_color_modifier_copy(), BKE_linestyle_thickness_modifier_copy(), BKE_mesh_assign_object(), BKE_mesh_from_nurbs_displist(), BKE_movieclip_file_add_exists_ex(), BKE_nla_tweakmode_enter(), BKE_nlastrip_copy(), BKE_nlastrip_new(), BKE_node_copy_ex(), BKE_object_add_for_data(), BKE_object_copy_particlesystem(), BKE_object_make_proxy(), BKE_object_material_assign(), BKE_paint_brush_set(), BKE_paint_copy(), BKE_paint_curve_set(), BKE_paint_palette_set(), BKE_paint_toolslots_brush_update_ex(), 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(), collection_child_add(), collection_instance_add_exec(), collection_instance_exec(), collection_object_add(), con_fix_copied_refs_cb(), copy_lineset(), MeshImporter::create_mesh_object(), ED_mesh_join_objects_exec(), empty_drop_named_image_invoke(), foreach_libblock_make_usercounts_callback(), FRS_paste_active_lineset(), Freestyle::BlenderStrokeRenderer::GenerateStrokeMesh(), gpencil_modifier_copy_data_id_us_cb(), id_copy_libmanagement_cb(), id_fake_user_set(), IDP_AssignID(), IDP_CopyID(), IDP_New(), image_id_remap(), init(), init_switch_view(), libblock_management_us_plus(), make_links_data_exec(), make_local_all__instance_indirect_unused(), mesh_separate_material_assign_mat_nr(), modifier_copy_data_id_us_cb(), node_add_collection_exec(), node_add_group_exec(), node_add_mask_exec(), node_add_object_exec(), node_add_texture_exec(), node_composit_init_rlayers(), node_id_remap(), node_init(), node_init_api_cryptomatte(), node_link_item_apply(), node_socket_copy_default_value(), object_add_or_copy_particle_system(), object_convert_exec(), object_data_convert_curve_to_mesh(), object_gpencil_add_exec(), paint_toolslots_init(), paste_mtex_copybuf(), pose_proxy_sync(), restrictbutton_id_user_toggle(), seq_dupli(), SEQ_effect_text_font_load(), sequencer_id_remap(), set_current_brush_texture(), set_current_linestyle_texture(), set_current_particle_texture(), blender::io::alembic::AbcObjectReader::setupObjectTransform(), shaderfx_copy_data_id_us_cb(), socket_id_user_increment(), solve_camera_freejob(), template_id_cb(), tracking_plane_tracks_copy(), tracking_tracks_copy(), txt_add_object(), 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.c so far, but simpler/safer to keep it here nonetheless.
Definition at line 272 of file lib_id.c.
References BLI_assert, id, LIB_TAG_EXTRAUSER, LIB_TAG_EXTRAUSER_SET, ID::tag, and ID::us.
Referenced by BKE_object_modifiers_lib_link_common(), brush_undo_preserve_cb(), id_refcount_recompute_callback(), id_us_plus(), lib_relocate_do(), scene_blend_read_lib(), and scene_foreach_toolsettings_id_pointer_process().