Blender
V3.3
|
#include <ctype.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "CLG_log.h"
#include "MEM_guardedalloc.h"
#include "DNA_ID.h"
#include "DNA_anim_types.h"
#include "DNA_collection_types.h"
#include "DNA_gpencil_types.h"
#include "DNA_key_types.h"
#include "DNA_node_types.h"
#include "DNA_workspace_types.h"
#include "BLI_utildefines.h"
#include "BLI_alloca.h"
#include "BLI_blenlib.h"
#include "BLI_ghash.h"
#include "BLI_linklist.h"
#include "BLI_memarena.h"
#include "BLI_string_utils.h"
#include "BLT_translation.h"
#include "BKE_anim_data.h"
#include "BKE_armature.h"
#include "BKE_asset.h"
#include "BKE_bpath.h"
#include "BKE_context.h"
#include "BKE_global.h"
#include "BKE_gpencil.h"
#include "BKE_idprop.h"
#include "BKE_idtype.h"
#include "BKE_key.h"
#include "BKE_lib_id.h"
#include "BKE_lib_override.h"
#include "BKE_lib_query.h"
#include "BKE_lib_remap.h"
#include "BKE_main.h"
#include "BKE_main_namemap.h"
#include "BKE_node.h"
#include "BKE_rigidbody.h"
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_build.h"
#include "RNA_access.h"
#include "BLO_read_write.h"
#include "atomic_ops.h"
Go to the source code of this file.
Classes | |
struct | IDCopyLibManagementData |
Macros | |
#define | LIB_ID_TYPES_NOCOPY ID_LI, ID_SCR, ID_WM, ID_WS /* Not supported */ |
#define | ID_SORT_STEP_SIZE 512 |
Variables | |
static CLG_LogRef | LOG = {.identifier = "bke.lib_id"} |
IDTypeInfo | IDType_ID_LINK_PLACEHOLDER |
static uint | global_session_uuid = 0 |
Contains management of ID's and libraries allocate and free of all library data
Definition in file lib_id.c.
#define ID_SORT_STEP_SIZE 512 |
void BKE_id_blend_write | ( | BlendWriter * | writer, |
ID * | id | ||
) |
Definition at line 2008 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(), ID::library_weak_reference, LISTBASE_FOREACH, ID::name, NULL, 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(), curves_blend_write(), greasepencil_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().
Definition at line 1909 of file lib_id.c.
References BKE_idtype_idcode_is_linkable(), GS, id, ID_IS_LINKED, ID_IS_OVERRIDE_LIBRARY, and ID::name.
Definition at line 667 of file lib_id.c.
References BKE_id_copy_ex(), LIB_ID_COPY_DEFAULT, and NULL.
Referenced by BKE_lib_id_make_local_generic().
Definition at line 605 of file lib_id.c.
References BKE_idtype_get_info_from_id(), BKE_libblock_copy_ex(), BKE_libblock_get_alloc_info(), BKE_library_foreach_ID_link(), BLI_assert, BLI_assert_msg, IDTypeInfo::copy_data, data, IDCopyLibManagementData::flag, ID::flag, IDTypeInfo::flags, GS, id, id_copy_libmanagement_cb(), IDTYPE_FLAGS_NO_COPY, IDWALK_NOP, ID::lib, lib_id_copy_ensure_local(), LIB_ID_COPY_KEEP_LIB, LIB_ID_CREATE_NO_ALLOCATE, LIB_ID_CREATE_NO_MAIN, ID::name, NULL, and size().
Referenced by BKE_id_copy(), BKE_id_copy_for_duplicate(), and id_single_user().
ID* BKE_id_copy_for_duplicate | ( | Main * | bmain, |
ID * | id, | ||
const eDupli_ID_Flags | duplicate_flags, | ||
const int | copy_flags | ||
) |
Definition at line 672 of file lib_id.c.
References BKE_animdata_duplicate_id_action(), BKE_id_copy_ex(), BKE_key_from_id(), id, ID_IS_LINKED, ID_NEW_SET, id_us_min(), ID::newid, NULL, and USER_DUP_LINKED_ID.
Definition at line 596 of file lib_id.c.
References ELEM, GS, id, ID_TYPE_IS_DEPRECATED, LIB_ID_TYPES_NOCOPY, and ID::name.
Definition at line 1842 of file lib_id.c.
References id, Library::id, ID_IS_LINKED, ID::lib, and ID::name.
Referenced by BKE_id_full_name_ui_prefix_get().
void BKE_id_full_name_ui_prefix_get | ( | char | name[MAX_ID_FULL_NAME_UI], |
const ID * | id, | ||
const bool | add_lib_hint, | ||
char | separator_char, | ||
int * | r_prefix_len | ||
) |
Definition at line 1858 of file lib_id.c.
References BKE_id_full_name_get(), id, ID_IS_OVERRIDE_LIBRARY, ID_MISSING, LIB_FAKEUSER, ID::name, and ID::us.
Definition at line 1915 of file lib_id.c.
References BKE_lib_override_library_is_system_defined(), and ID_IS_LINKED.
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 1902 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().
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 1159 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 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_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(), lib_override_library_create_post_process(), movieclip_alloc(), object_convert_exec(), blender::bke::tests::BPathTest::SetUp(), and blender::bke::tests::TEST().
bool BKE_id_new_name_validate | ( | struct Main * | bmain, |
ListBase * | lb, | ||
ID * | id, | ||
const char * | tname, | ||
const bool | do_linked_data | ||
) |
Definition at line 1427 of file lib_id.c.
References BKE_idtype_idcode_to_name(), BKE_main_namemap_get_name(), BLI_str_utf8_invalid_strip(), BLI_strncpy(), DATA_, GS, id, ID_IS_LINKED, id_sort_by_name(), MAX_ID_NAME, ID::name, NULL, and result.
Referenced by BKE_lib_id_clear_library_data(), BKE_libblock_alloc(), BKE_libblock_management_main_add(), BKE_libblock_rename(), BKE_main_id_repair_duplicate_names_listbase(), and BLI_libblock_ensure_unique_name().
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.
name | can be NULL, in which case we get default name for this ID type. |
Definition at line 1173 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_mesh_from_bmesh_for_eval_nomain(), BKE_mesh_from_bmesh_nomain(), 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::node_geo_mesh_primitive_ico_sphere_cc::create_ico_sphere_mesh(), blender::bke::curves_new_nomain(), EEVEE_material_default_diffuse_get(), EEVEE_material_default_error_get(), EEVEE_material_default_glossy_get(), EEVEE_world_default_get(), CurveComponent::get_curve_for_render(), blender::eevee::MaterialModule::MaterialModule(), mesh_new_from_mball_object(), mesh_to_volume(), blender::ed::spreadsheet::spreadsheet_get_display_geometry_set(), and blender::bke::tests::TEST().
Definition at line 359 of file lib_id.c.
References BKE_id_newptr_and_tag_clear(), BKE_key_from_id(), GS, id, Collection::id, Key::id, bNodeTree::id, ID_SCE, LIB_TAG_NEW, ID::name, ID::newid, ntree, ntreeFromID(), and NULL.
Referenced by BKE_id_newptr_and_tag_clear(), BKE_main_id_newptr_and_tag_clear(), id_local_fn(), and template_id_cb().
Definition at line 1953 of file lib_id.c.
References BLI_addtail(), BLI_genericNodeN(), BLI_listbase_clear(), BLI_listbase_sort(), id_order_compare(), id_order_get(), LISTBASE_FOREACH, and order.
Definition at line 1972 of file lib_id.c.
References BLI_listbase_count(), id_order_get(), LISTBASE_FOREACH, and order.
Definition at line 1897 of file lib_id.c.
References atomic_fetch_and_and_int32(), id, and ID::tag.
Definition at line 1892 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 1879 of file lib_id.c.
References BLI_sprintfN(), BLI_strdup(), id, Library::id, ID_IS_LINKED, ID::lib, and ID::name.
Referenced by gpencil_strokes_copypastebuf_colors_material_to_name_create(), and gpencil_strokes_copypastebuf_colors_name_to_material_create().
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 177 of file lib_id.c.
References ID::asset_data, BKE_asset_metadata_free(), BKE_id_new_name_validate(), BKE_key_from_id(), BKE_lib_id_clear_library_data(), BKE_lib_libblock_session_uuid_renew(), BKE_library_foreach_ID_link(), BKE_main_namemap_remove_name(), DEG_id_tag_update_ex(), DEG_relations_tag_update(), ID::flag, FOREACH_MAIN_ID_BEGIN, FOREACH_MAIN_ID_END, GS, id, Key::id, id_fake_user_clear(), id_fake_user_set(), ID_IS_ASSET, ID_RECALC_COPY_ON_WRITE, IDWALK_READONLY, Main::is_memfile_undo_written, ID::lib, LIB_EMBEDDED_DATA, lib_id_clear_library_data_users_update_cb(), lib_id_library_local_paths(), LIB_ID_MAKELOCAL_ASSET_DATA_CLEAR, LIB_INDIRECT_WEAK_LINK, LIB_TAG_EXTERN, LIB_TAG_INDIRECT, LIB_TAG_NO_MAIN, LIB_TAG_TEMP_MAIN, ID::name, NULL, ID::tag, 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 427 of file lib_id.c.
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 533 of file lib_id.c.
References BKE_idtype_get_info_from_id(), BKE_lib_id_make_local_generic(), BLI_assert, BLI_assert_msg, IDTypeInfo::flags, id, IDTYPE_FLAGS_NO_LIBLINKING, LIB_ID_MAKELOCAL_FULL_LIBRARY, LIB_TAG_INDIRECT, IDTypeInfo::make_local, NULL, and ID::tag.
Referenced by BKE_blendfile_append(), BKE_library_make_local(), brush_make_local(), id_local_fn(), and template_id_cb().
Generic 'make local' function, works for most of data-block types.
Definition at line 486 of file lib_id.c.
References BKE_id_copy(), BKE_key_from_id(), BKE_lib_id_clear_library_data(), BKE_lib_id_expand_local(), BKE_lib_id_make_local_generic_action_define(), BKE_libblock_remap(), GS, id, ID_IS_LINKED, ID_NEW_SET, ID_REMAP_SKIP_INDIRECT_USAGE, ID_SCE, LIB_ID_MAKELOCAL_FULL_LIBRARY, ID::name, ntree, ntreeFromID(), NULL, and ID::us.
Referenced by BKE_lib_id_make_local().
void BKE_lib_id_make_local_generic_action_define | ( | struct Main * | bmain, |
struct 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.
BKE_lib_id_make_local_generic
and the specific corner-cases implementations needed for objects and brushes. Definition at line 444 of file lib_id.c.
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().
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 752 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 757 of file lib_id.c.
References id_swap().
Referenced by read_libblock_undo_restore_at_old_address().
Generate a session-wise uuid for the given id.
Definition at line 1140 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().
Re-generate a new session-wise uuid for the given id.
Definition at line 1153 of file lib_id.c.
References BKE_lib_libblock_session_uuid_ensure(), and MAIN_ID_SESSION_UUID_UNSET.
Referenced by BKE_lib_id_clear_library_data(), and setup_app_data().
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 1050 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(), Main::curlib, DEG_id_type_tag(), ELEM, IDCopyLibManagementData::flag, id, ID_GR, ID_NT, 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, Library_Runtime::name_map, NULL, Library::runtime, 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 1039 of file lib_id.c.
References BKE_libblock_get_alloc_info(), BLI_assert_msg, MEM_callocN, NULL, size(), and type.
Referenced by BKE_libblock_alloc(), create_placeholder(), and blender::deg::IDNode::init_copy_on_write().
Definition at line 1286 of file lib_id.c.
References BKE_libblock_copy_ex().
Definition at line 1189 of file lib_id.c.
References IdAdtTemplate::adt, BKE_animdata_copy(), BKE_lib_override_library_copy(), BKE_libblock_alloc(), BKE_libblock_get_alloc_info(), BLI_assert, BLI_strncpy(), DEG_id_type_tag(), IDCopyLibManagementData::flag, ID::flag, GS, id, id_can_have_animdata(), ID_IS_OVERRIDE_LIBRARY_REAL, ID_IS_OVERRIDE_LIBRARY_VIRTUAL, IDP_CopyProperty_ex(), LIB_EMBEDDED_DATA, LIB_EMBEDDED_DATA_LIB_OVERRIDE, LIB_ID_COPY_ACTIONS, 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, LIB_TAG_COPIED_ON_WRITE, LIB_TAG_NO_MAIN, LIB_TAG_NO_USER_REFCOUNT, LIB_TAG_NOT_ALLOCATED, ID::library_weak_reference, ID::name, NULL, ID::properties, ID::tag, and ID::us.
Referenced by BKE_id_copy_ex(), and BKE_libblock_copy().
Definition at line 1297 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(), gpencil_stroke_change_color_exec(), object_select_mirror_exec(), object_select_same_collection_exec(), palette_join_exec(), read_libblock_undo_restore_linked(), smooth_brush_toggle_off(), toolsystem_ref_link(), unpack_item_exec(), updateDuplicateCustomBoneShapes(), wm_lib_relocate_exec_do(), wm_lib_relocate_invoke(), and WM_operator_properties_id_lookup_from_name_or_session_uuid().
struct ID* BKE_libblock_find_session_uuid | ( | Main * | bmain, |
const short | type, | ||
const uint32_t | session_uuid | ||
) |
Definition at line 1304 of file lib_id.c.
References BLI_assert, id, LISTBASE_FOREACH, NULL, ID::session_uuid, type, and which_libbase().
Referenced by get_modifier_data(), and WM_operator_properties_id_lookup_from_name_or_session_uuid().
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 1022 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().
Initialize an ID of given type, such that it has valid 'empty' data. ID is assumed to be just calloc'ed.
Definition at line 1115 of file lib_id.c.
References BKE_idtype_get_info_from_id(), BLI_assert_msg, IDTypeInfo::init_data, and NULL.
Referenced by BKE_id_new(), BKE_id_new_nomain(), BKE_mesh_new_nomain(), create_placeholder(), and ntreeAddTree().
Add a 'NO_MAIN' data-block to given main (also sets usercounts of its IDs if needed).
Definition at line 826 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().
Referenced by lib_override_library_resync().
Remove a data-block from given main (set it to 'NO_MAIN' status).
Definition at line 859 of file lib_id.c.
References BKE_main_lock(), BKE_main_namemap_remove_name(), 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().
Definition at line 891 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.
Definition at line 879 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 1832 of file lib_id.c.
References BKE_id_new_name_validate(), BKE_main_namemap_remove_name(), BLI_assert, GS, id, ID_IS_LINKED, Main::is_memfile_undo_written, ID::name, and which_libbase().
Referenced by blender::bke::tests::TEST(), and DocumentImporter::write_node().
Reset the runtime counters used by ID remapping.
Definition at line 1129 of file lib_id.c.
Referenced by libblock_remap_foreach_idpair_cb(), and libblock_remap_reset_remapping_status_callback().
void BKE_library_make_local | ( | Main * | bmain, |
const Library * | lib, | ||
GHash * | old_to_new_ids, | ||
const bool | untagged_only, | ||
const bool | set_fake | ||
) |
Definition at line 1594 of file lib_id.c.
References Freestyle::a, 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_make_local(), BKE_libblock_remap(), BKE_main_id_newptr_and_tag_clear(), 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, id_fake_user_set(), ID_GR, ID_IS_LINKED, ID_IS_OVERRIDE_LIBRARY_REAL, ID_OB, ID_REMAP_SKIP_INDIRECT_USAGE, id_us_ensure_real(), INDEX_ID_MAX, lib, ID::lib, LIB_ID_MAKELOCAL_FULL_LIBRARY, LIB_INDIRECT_WEAK_LINK, LIB_TAG_DOIT, LIB_TAG_EXTERN, LIB_TAG_INDIRECT, LIB_TAG_NEW, LIB_TAG_PRE_EXISTING, library_make_local_copying_check(), ID::name, ID::newid, LinkNode::next, ID::next, ntree, ntreeFromID(), NULL, OB_ARMATURE, Main::objects, ID::override_library, POSE_RECALC, IDOverrideLibrary::reference, Main::relations, set_listbasepointers(), ID::tag, TIMEIT_END, TIMEIT_START, and TIMEIT_VALUE_PRINT.
Clear or set given flags for all ids in bmain (persistent flags).
Definition at line 957 of file lib_id.c.
References Freestyle::a, BKE_main_id_flag_listbase(), IDCopyLibManagementData::flag, INDEX_ID_MAX, and set_listbasepointers().
Clear or set given flags for all ids in listbase (persistent flags).
Definition at line 941 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().
Next to indirect usage in readfile.c/writefile.c
also in editobject.c
, scene.cc
.
Definition at line 1465 of file lib_id.c.
References BKE_id_newptr_and_tag_clear(), FOREACH_MAIN_ID_BEGIN, FOREACH_MAIN_ID_END, and id.
Referenced by apply_objects_internal(), BKE_blendfile_append(), BKE_collection_duplicate(), BKE_lib_override_library_create(), 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_override_library_create_hierarchy(), lib_override_library_resync(), make_object_duplilist_real(), make_single_user_exec(), modifier_apply_exec_ex(), and object_duplicates_make_real_exec().
Definition at line 1499 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 BKE_blendfile_library_relocate(), blo_read_file_internal(), library_link_end(), and setup_app_data().
Only for repairing files via versioning, avoid for general use.
Definition at line 967 of file lib_id.c.
References BKE_id_new_name_validate(), BLI_gset_add(), BLI_gset_free(), BLI_gset_str_new_ex(), id, ID_IS_LINKED, LISTBASE_FOREACH, MEM_freeN, MEM_mallocN, and NULL.
Referenced by blo_do_versions_280(), blo_do_versions_290(), and blo_do_versions_300().
Clear or set given tags for all ids in bmain (runtime tags).
Definition at line 930 of file lib_id.c.
References Freestyle::a, BKE_main_id_tag_listbase(), INDEX_ID_MAX, and set_listbasepointers().
Referenced by BKE_blendfile_append(), BKE_blendfile_library_relocate(), BKE_blendfile_write_partial_begin(), BKE_blendfile_write_partial_end(), BKE_id_delete(), BKE_lib_override_library_create(), BKE_lib_override_library_delete(), blo_read_file_internal(), bpy_batch_remove(), bpy_lib_exit(), copybuffer_append(), id_override_library_create_hierarchy(), id_override_library_create_hierarchy_pre_process_fn(), lib_override_library_main_resync_on_library_indirect_level(), lib_override_library_resync(), library_link_end(), make_local_exec(), make_override_library_exec(), object_delete_exec(), outliner_delete_exec(), outliner_id_delete_invoke(), outliner_id_operation_exec(), outliner_lib_operation_exec(), previews_ensure_exec(), sorted_selected_editable_objects(), tag_localizable_objects(), wm_file_link_append_datablock_ex(), WM_lib_reload(), wm_lib_relocate_exec_do(), and wm_link_append_exec().
Clear or set given tags for all ids of given type in bmain
(runtime tags).
Definition at line 920 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(), BKE_blendfile_library_relocate(), id_delete_tag(), and sound_update_animation_flags_exec().
Clear or set given tags for all ids in listbase (runtime tags).
Definition at line 904 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(), object_delete_exec(), and previews_ensure_exec().
Definition at line 998 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 copybuffer_append(), outliner_id_remap_exec(), WM_lib_reload(), wm_lib_relocate_exec_do(), and wm_link_append_exec().
Use after setting the ID's name When name exists: call 'new_id'
Definition at line 1813 of file lib_id.c.
References BKE_id_new_name_validate(), BLI_findstring(), GS, ID_IS_LINKED, Main::is_memfile_undo_written, ID::name, NULL, and which_libbase().
Referenced by BLO_update_defaults_startup_blend(), do_versions_rename_id(), and namebutton_fn().
|
static |
Definition at line 569 of file lib_id.c.
References BLI_assert, LibraryIDLinkCallbackData::cb_flag, data, LibraryIDLinkCallbackData::id_pointer, LibraryIDLinkCallbackData::id_self, id_us_plus(), id_us_plus_no_lib(), IDWALK_CB_USER, IDWALK_RET_NOP, LIB_ID_CREATE_NO_MAIN, LIB_ID_CREATE_NO_USER_REFCOUNT, LIB_TAG_NO_MAIN, ID::tag, and LibraryIDLinkCallbackData::user_data.
Referenced by BKE_id_copy_ex().
Definition at line 351 of file lib_id.c.
References ID::flag, id, id_us_min(), and LIB_FAKEUSER.
Referenced by BKE_lib_id_clear_library_data(), blendfile_library_relocate_remap(), collection_link_exec(), ED_animedit_unlink_action(), ED_asset_clear_id(), id_fake_user_clear_fn(), lib_id_fake_user_toggle_exec(), libblock_remap_data_update_tags(), and template_id_cb().
Definition at line 343 of file lib_id.c.
References ID::flag, id, id_us_plus(), and LIB_FAKEUSER.
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_remap(), 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(), do_versions_after_linking_300(), ED_asset_mark_id(), id_fake_user_set_fn(), blender::io::usd::import_startjob(), lib_id_fake_user_toggle_exec(), lib_override_library_resync(), libblock_remap_data_update_tags(), mask_alloc(), mask_copy_data(), AssetClearHelper::operator()(), palette_init_data(), and unlink_collection_fn().
Definition at line 237 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 collection_instance_exec(), con_extern_cb(), id_us_plus(), and lib_id_expand_local_cb().
Definition at line 250 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_objects_sync(), and layer_collection_sync().
Definition at line 1933 of file lib_id.c.
References Freestyle::a, usdtokens::b(), id_order_get(), and ID::name.
Referenced by BKE_id_ordered_list().
|
static |
Definition at line 1922 of file lib_id.c.
References GS, id, ID_WS, ID::name, and NULL.
Referenced by BKE_id_ordered_list(), BKE_id_reorder(), and id_order_compare().
|
static |
Definition at line 1475 of file lib_id.c.
References bool, LibraryIDLinkCallbackData::cb_flag, ID_IS_LINKED, LibraryIDLinkCallbackData::id_pointer, id_us_ensure_real(), id_us_plus_no_lib(), IDWALK_CB_USER, IDWALK_CB_USER_ONE, IDWALK_RET_NOP, NULL, POINTER_AS_INT, and LibraryIDLinkCallbackData::user_data.
Referenced by BKE_main_id_refcount_recompute().
bool id_single_user | ( | struct bContext * | C, |
struct ID * | id, | ||
struct PointerRNA * | ptr, | ||
struct PropertyRNA * | prop | ||
) |
Definition at line 762 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 1318 of file lib_id.c.
References BLI_addhead(), BLI_addtail(), BLI_assert, BLI_findindex(), BLI_insertlinkafter(), BLI_insertlinkbefore(), BLI_remlink(), BLI_strcasecmp(), ELEM, ListBase::first, id, ID_IS_LINKED, ID_SORT_STEP_SIZE, ListBase::last, ID::lib, ID::name, ID::next, NULL, and ID::prev.
Referenced by blender::bke::tests::add_id_in_library(), BKE_blendfile_write_partial(), BKE_id_new_name_validate(), blendfile_library_relocate_remap(), create_placeholder(), expand_doit_library(), link_named_part(), sort_linked_ids(), and blender::bke::tests::TEST().
Does a mere memory swap over the whole IDs data (including type-specific memory).
Definition at line 715 of file lib_id.c.
References BKE_idtype_get_info_from_id(), BKE_libblock_relink_ex(), BLI_assert, GS, ID_REMAP_SKIP_NEVER_NULL_USAGE, ID::name, NULL, ID::properties, ID::recalc, and IDTypeInfo::struct_size.
Referenced by BKE_lib_id_swap(), and BKE_lib_id_swap_full().
Definition at line 278 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_blendfile_library_relocate(), BKE_id_free_us(), libblock_remap_data_update_tags(), libblock_remap_foreach_idpair_cb(), and template_id_cb().
Ensure we have a real user
Definition at line 260 of file lib_id.c.
References 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 blender::bke::id::remapper::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_find_main(), 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_apply(), id_refcount_recompute_callback(), id_us_min(), libblock_management_us_plus(), blender::ed::space_node::node_id_remap_cb(), restore_pointer_user(), scene_blend_read_data(), SEQ_add_mask_strip(), SEQ_add_movieclip_strip(), SEQ_add_scene_strip(), window_manager_blend_read_data(), and workspace_blend_read_data().
Definition at line 313 of file lib_id.c.
References CLOG_ERROR, Library::filepath_abs, GS, id, ID_FAKE_USERS, ID_TYPE_IS_DEPRECATED, 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(), blender::io::usd::USDMaterialReader::add_material(), ANIM_remove_empty_action_from_animdata(), animdata_copy_id_action(), animrecord_check_state(), blender::bke::id::remapper::IDRemapper::apply(), apply_objects_internal(), blender::io::alembic::utils::assign_materials(), background_image_remove_exec(), BCAnimation::BCAnimation(), BKE_animdata_free(), BKE_animdata_set_action(), BKE_animdata_transfer_by_basepath(), BKE_blendfile_library_relocate(), 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_lib_override_library_main_proxy_convert(), BKE_lib_override_library_proxy_convert(), BKE_library_update_ID_link_user(), 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_nla_action_pushdown(), BKE_nla_tweakmode_exit(), 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_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(), drop_world_exec(), duplibase_for_convert(), ED_mesh_join_objects_exec(), empty_drop_named_image_invoke(), eyedropper_add_palette_color(), font_open_exec(), foreach_libblock_remap_callback_apply(), FRS_paste_active_lineset(), geometry_node_tree_copy_assign_exec(), blender::io::obj::get_or_create_material(), 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_new_exec(), image_open_exec(), blender::io::usd::import_startjob(), import_startjob(), ipo_to_animato(), lib_override_library_create_from(), lib_override_library_create_post_process(), libblock_management_us_min(), make_links_data_exec(), make_object_duplilist_real(), modifier_free_data_id_us_cb(), new_material_exec(), blender::ed::space_node::new_node_tree_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_id_remap_cb(), nodeRemoveNode(), object_convert_exec(), object_data_convert_curve_to_mesh(), object_material_assign(), 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_convert_callback(), SEQ_effect_text_font_unload(), seq_sequence_free_ex(), 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(), blender::io::stl::STLMeshHelper::to_mesh(), unlink_material_fn(), unlink_texture_fn(), unlink_world_fn(), MeshImporter::write_geometry(), and DocumentImporter::writeMaterial().
Definition at line 305 of file lib_id.c.
References id_lib_extern(), and id_us_plus_no_lib().
Referenced by blender::io::usd::USDGeomReader::add_cache_modifier(), blender::io::alembic::AbcObjectReader::addCacheModifier(), apply_objects_internal(), BKE_animdata_copy(), BKE_animdata_merge_copy(), BKE_animdata_set_action(), BKE_camera_background_image_copy(), 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_movieclip_file_add_exists_ex(), BKE_nla_tweakmode_enter(), BKE_nlastrip_copy(), BKE_nlastrip_new(), BKE_object_add_for_data(), BKE_object_copy_particlesystem(), BKE_object_material_from_eval_data(), 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_drop_exec(), collection_instance_add_exec(), collection_instance_exec(), collection_object_add(), con_fix_copied_refs_cb(), copy_lineset(), MeshImporter::create_mesh_object(), drop_world_exec(), ED_mesh_join_objects_exec(), ED_rigidbody_constraint_add(), 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(), 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(), libblock_management_us_plus(), loose_data_instantiate_collection_process(), loose_data_instantiate_obdata_process(), make_links_data_exec(), make_local_all__instance_indirect_unused(), mesh_separate_material_assign_mat_nr(), 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_object_exec(), blender::nodes::node_composite_keyingscreen_cc::node_composit_init_keyingscreen(), blender::nodes::node_composite_image_cc::node_composit_init_rlayers(), blender::bke::node_copy_with_mapping(), blender::ed::space_node::node_id_remap_cb(), 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(), object_add_or_copy_particle_system(), object_convert_exec(), object_data_convert_curve_to_mesh(), object_gpencil_add_exec(), object_material_assign(), paint_toolslots_init(), paste_mtex_copybuf(), blender::io::usd::USDXformReader::read_object_data(), restrictbutton_id_user_toggle(), seq_dupli(), SEQ_effect_text_font_load(), 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(), WM_drag_free_imported_drag_ID(), and WM_operator_drop_load_path().
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 289 of file lib_id.c.
References BLI_assert, id, LIB_TAG_EXTRAUSER, LIB_TAG_EXTRAUSER_SET, ID::tag, and ID::us.
Referenced by blender::bke::id::remapper::IDRemapper::apply(), BKE_blendfile_library_relocate(), BKE_object_modifiers_lib_link_common(), brush_undo_preserve_cb(), foreach_libblock_remap_callback_apply(), id_copy_libmanagement_cb(), id_refcount_recompute_callback(), id_us_plus(), scene_foreach_toolsettings_id_pointer_process(), and seq_read_lib_cb().
|
static |
Definition at line 166 of file lib_id.c.
References LibraryIDLinkCallbackData::bmain, DEG_id_tag_update_ex(), LibraryIDLinkCallbackData::id_owner, LibraryIDLinkCallbackData::id_pointer, ID_RECALC_COPY_ON_WRITE, ID_RECALC_TAG_FOR_UNDO, IDWALK_RET_NOP, IDWALK_RET_STOP_ITER, and LibraryIDLinkCallbackData::user_data.
Referenced by BKE_lib_id_clear_library_data().
|
static |
Ensure new (copied) ID is fully made local.
Definition at line 436 of file lib_id.c.
References BKE_lib_id_expand_local(), ID_IS_LINKED, ID::lib, and lib_id_library_local_paths().
Referenced by BKE_id_copy_ex().
|
static |
Definition at line 389 of file lib_id.c.
References BKE_idtype_idcode_is_linkable(), BKE_lib_id_clear_library_data(), BLI_assert, LibraryIDLinkCallbackData::bmain, LibraryIDLinkCallbackData::cb_flag, GS, ID_IS_LINKED, id_lib_extern(), LibraryIDLinkCallbackData::id_pointer, LibraryIDLinkCallbackData::id_self, IDWALK_CB_EMBEDDED, IDWALK_CB_LOOPBACK, IDWALK_RET_NOP, NULL, POINTER_AS_INT, and LibraryIDLinkCallbackData::user_data.
Referenced by BKE_lib_id_expand_local().
This has to be called from each make_local_* func, we could call from BKE_lib_id_make_local() but then the make local functions would not be self contained. Also note that the id must have a library - campbell
Definition at line 154 of file lib_id.c.
References BKE_bpath_foreach_path_id(), BKE_BPATH_FOREACH_PATH_SKIP_MULTIFILE, BKE_main_blendfile_path(), id, lib, and lib_id_library_local_paths_callback().
Referenced by BKE_lib_id_clear_library_data(), and lib_id_copy_ensure_local().
|
static |
Rewrites a relative path to be relative to the main file - unless the path is absolute, in which case it is not altered.
Definition at line 117 of file lib_id.c.
References BLI_path_abs(), BLI_path_is_rel(), BLI_path_normalize(), BLI_path_rel(), BLI_strncpy(), CLOG_ERROR, data, FILE_MAX, FILE_MAXDIR, FILE_MAXFILE, LOG, and BPathForeachPathData::user_data.
Referenced by lib_id_library_local_paths().
|
static |
Definition at line 814 of file lib_id.c.
References LibraryIDLinkCallbackData::cb_flag, LibraryIDLinkCallbackData::id_pointer, id_us_min(), IDWALK_CB_USER, and IDWALK_RET_NOP.
Referenced by BKE_libblock_management_usercounts_clear().
|
static |
Definition at line 800 of file lib_id.c.
References LibraryIDLinkCallbackData::cb_flag, LibraryIDLinkCallbackData::id_pointer, id_us_ensure_real(), id_us_plus(), IDWALK_CB_USER, IDWALK_CB_USER_ONE, and IDWALK_RET_NOP.
Referenced by BKE_libblock_management_main_add(), and BKE_libblock_management_usercounts_set().
|
static |
Definition at line 1527 of file lib_id.c.
References BLI_ghash_lookup(), BLI_gset_add(), BLI_gset_haskey(), BLI_gset_insert(), BLI_gset_remove(), MainIDRelationsEntry::from_ids, GS, ID_IS_LINKED, ID_KE, IDWALK_CB_LOOPBACK, LIB_TAG_DOIT, ID::name, NULL, MainIDRelations::relations_from_pointers, and ID::tag.
Referenced by BKE_library_make_local().
|
static |
Definition at line 1138 of file lib_id.c.
Referenced by BKE_lib_libblock_session_uuid_ensure().
IDTypeInfo IDType_ID_LINK_PLACEHOLDER |
Empty shell mostly, but needed for read code.
Definition at line 77 of file lib_id.c.
Referenced by id_type_init().
|
static |
Definition at line 75 of file lib_id.c.
Referenced by id_us_ensure_real(), id_us_min(), and lib_id_library_local_paths_callback().