|
Blender V4.3
|
#include <algorithm>#include <cstdlib>#include <cstring>#include "CLG_log.h"#include "MEM_guardedalloc.h"#include "DNA_ID.h"#include "DNA_collection_types.h"#include "DNA_gpencil_legacy_types.h"#include "DNA_key_types.h"#include "DNA_object_types.h"#include "DNA_scene_types.h"#include "DNA_space_types.h"#include "BLI_blenlib.h"#include "BLI_ghash.h"#include "BLI_linklist.h"#include "BLI_math_vector.h"#include "BLI_string_ref.hh"#include "BLI_utildefines.h"#include "BLI_vector.hh"#include "BLT_translation.hh"#include "RNA_access.hh"#include "RNA_prototypes.hh"#include "BKE_callbacks.hh"#include "BKE_grease_pencil_legacy_convert.hh"#include "BKE_idtype.hh"#include "BKE_key.hh"#include "BKE_layer.hh"#include "BKE_lib_id.hh"#include "BKE_lib_override.hh"#include "BKE_lib_query.hh"#include "BKE_lib_remap.hh"#include "BKE_library.hh"#include "BKE_main.hh"#include "BKE_main_namemap.hh"#include "BKE_material.h"#include "BKE_mesh_legacy_convert.hh"#include "BKE_object.hh"#include "BKE_report.hh"#include "BKE_rigidbody.h"#include "BKE_scene.hh"#include "BKE_blendfile_link_append.hh"#include "BLO_writefile.hh"Go to the source code of this file.
Classes | |
| struct | BlendfileLinkAppendContextCallBack |
| struct | LooseDataInstantiateContext |
Variables | |
| static CLG_LogRef | LOG = {"bke.blendfile_link_append"} |
High level .blend file link/append code, including linking/appending several IDs from different libraries, handling instantiations of collections/objects/object-data in current scene.
Definition in file blendfile_link_append.cc.
| void BKE_blendfile_append | ( | BlendfileLinkAppendContext * | lapp_context, |
| ReportList * | reports ) |
Perform append operation, using modern ID usage looper to detect which ID should be kept linked, made local, duplicated as local, re-used from local etc.
The IDs processed by this functions are the one that have been linked by a previous call to BKE_blendfile_link on the same lapp_context.
Definition at line 1276 of file blendfile_link_append.cc.
References BlendfileLinkAppendContext::Appending, BKE_id_multi_tagged_delete(), BKE_idtype_idcode_append_is_reusable(), BKE_lib_id_make_local(), BKE_libblock_relink_to_newid(), BKE_main_id_newptr_and_tag_clear(), BKE_main_id_tag_all(), BKE_main_library_weak_reference_add_item(), BKE_main_library_weak_reference_create(), BKE_main_library_weak_reference_destroy(), blendfile_append_define_actions(), BLI_assert, BLI_assert_unreachable, BLO_LIBLINK_APPEND_ASSET_DATA_CLEAR, BLO_LIBLINK_APPEND_RECURSIVE, BLO_LIBLINK_APPEND_SET_FAKEUSER, BLO_read_do_version_after_setup(), LibraryLink_Params::bmain, CLOG_ERROR, ELEM, FILE_LINK, FILE_MAX, LibraryLink_Params::flag, GS, id_fake_user_set(), ID_GR, ID_IS_LINKED, ID_NEW_SET, ID_OB, ID_TAG_DOIT, ID_TAG_PRE_EXISTING, BlendfileLinkAppendContext::items, LIB_ID_MAKELOCAL_ASSET_DATA_CLEAR, LIB_ID_MAKELOCAL_FORCE_COPY, LIB_ID_MAKELOCAL_FORCE_LOCAL, LIB_ID_MAKELOCAL_FULL_LIBRARY, LIB_ID_MAKELOCAL_LIBOVERRIDE_CLEAR, BlendfileLinkAppendContext::library_weak_reference_mapping, LINK_APPEND_ACT_COPY_LOCAL, LINK_APPEND_ACT_KEEP_LINKED, LINK_APPEND_ACT_MAKE_LOCAL, LINK_APPEND_ACT_REUSE_LOCAL, LINK_APPEND_ACT_UNSET, LINK_APPEND_TAG_LIBOVERRIDE_DEPENDENCY, LINK_APPEND_TAG_LIBOVERRIDE_DEPENDENCY_ONLY, BlendfileLinkAppendContext::Linking, LOG, MAX_ID_NAME, ID::name, new_id_to_item_mapping_create(), ID::newid, BlendfileLinkAppendContext::params, BlendfileLinkAppendContext::process_stage, BlendFileReadReport::reports, and STRNCPY.
Referenced by bpy_lib_exit(), copybuffer_append(), wm_file_link_append_datablock_ex(), and wm_link_append_exec().
| void BKE_blendfile_library_relocate | ( | BlendfileLinkAppendContext * | lapp_context, |
| ReportList * | reports, | ||
| Library * | library, | ||
| bool | do_reload ) |
Try to relocate all linked IDs added to lapp_context, belonging to the given library.
This function searches for matching IDs (type and name) in all libraries added to the given lapp_context.
Typical usages include:
lapp_context.lapp_contextlapp_context.lapp_context.NOTE: content of lapp_context after execution of that function should not be assumed valid anymore, and should immediately be freed.
Definition at line 1768 of file blendfile_link_append.cc.
References BKE_blendfile_link(), BKE_blendfile_link_append_context_init_done(), BKE_blendfile_link_append_context_item_add(), BKE_id_delete(), BKE_id_free(), BKE_id_multi_tagged_delete(), BKE_id_name(), BKE_idtype_idcode_is_linkable(), BKE_key_from_id(), BKE_key_from_id_p(), BKE_layer_collection_resync_allow(), BKE_layer_collection_resync_forbid(), BKE_lib_override_library_main_operations_create(), BKE_lib_override_library_main_resync(), BKE_lib_override_library_update(), BKE_library_main_rebuild_hierarchy(), BKE_main_collection_sync(), BKE_main_collection_sync_remap(), BKE_main_id_refcount_recompute(), BKE_main_id_tag_all(), BKE_main_id_tag_idcode(), BKE_main_lock(), BKE_main_unlock(), BKE_view_layer_find(), blendfile_library_relocate_remap(), BLI_addtail(), BLI_assert, BLI_remlink(), LibraryLink_Params::bmain, CLOG_INFO, LibraryLink_Params::context, blender::bits::BitVector< InlineBufferCapacity, Allocator >::fill(), ListBase::first, FOREACH_MAIN_ID_BEGIN, FOREACH_MAIN_ID_END, GS, Key::id, Library::id, Scene::id, ID_IS_LINKED, ID_IS_OVERRIDE_LIBRARY_REAL, ID_KE, ID_LI, ID_REMAP_SKIP_INDIRECT_USAGE, ID_REMAP_SKIP_NEVER_NULL_USAGE, ID_SCE, ID_TAG_DOIT, ID_TAG_MISSING, ID_TAG_PRE_EXISTING, id_us_clear_real(), id_us_min(), id_us_plus_no_lib(), INDEX_ID_MAX, BlendfileLinkAppendContext::items, ID::lib, lib, BlendfileLinkAppendContextItem::libraries, LOG, ID::name, ViewLayer::name, BlendfileLinkAppendContext::params, BlendFileReadReport::reports, LibraryLink_Params::scene, set_listbasepointers(), ID::tag, ID::us, USER_EXPERIMENTAL_TEST, LibraryLink_Params::view_layer, Scene::view_layers, and which_libbase().
Referenced by WM_lib_reload(), and wm_lib_relocate_exec_do().
| void BKE_blendfile_link | ( | BlendfileLinkAppendContext * | lapp_context, |
| ReportList * | reports ) |
Perform linking operation on all items added to given lapp_context.
Definition at line 1524 of file blendfile_link_append.cc.
References BKE_reportf(), BLI_assert, BlendfileLinkAppendContextLibrary::blo_handle, BLO_library_link_begin(), BLO_library_link_end(), BLO_library_link_named_part(), BLO_read_do_version_after_setup(), LibraryLink_Params::bmain, Main::curlib, FILE_LINK, LibraryLink_Params::flag, blender::Vector< T, InlineBufferCapacity, Allocator >::index_range(), BlendfileLinkAppendContext::Init, blender::Vector< T, InlineBufferCapacity, Allocator >::is_empty(), BlendfileLinkAppendContext::items, ID::lib, lib, BlendfileLinkAppendContext::libraries, link_append_context_library_blohandle_ensure(), link_append_context_library_blohandle_release(), BlendfileLinkAppendContext::Linking, BlendfileLinkAppendContext::params, BlendfileLinkAppendContextLibrary::path, BlendfileLinkAppendContext::process_stage, BlendFileReadReport::reports, RPT_WARNING, Main::subversionfile, and Main::versionfile.
Referenced by blender::bke::asset_link_id(), BKE_blendfile_library_relocate(), bpy_lib_exit(), copybuffer_append(), wm_file_link_append_datablock_ex(), and wm_link_append_exec().
| void BKE_blendfile_link_append_context_embedded_blendfile_clear | ( | BlendfileLinkAppendContext * | lapp_context | ) |
Clear reference to Blender's embedded startup file into the context.
Definition at line 171 of file blendfile_link_append.cc.
References BlendfileLinkAppendContext::blendfile_mem, and BlendfileLinkAppendContext::blendfile_memsize.
| void BKE_blendfile_link_append_context_embedded_blendfile_set | ( | BlendfileLinkAppendContext * | lapp_context, |
| const void * | blendfile_mem, | ||
| int | blendfile_memsize ) |
Store reference to a Blender's embedded memfile into the context.
ED module, which cannot be linked in BKE code. Definition at line 161 of file blendfile_link_append.cc.
References BlendfileLinkAppendContext::blendfile_mem, BlendfileLinkAppendContext::blendfile_memsize, and BLI_assert_msg.
Referenced by wm_file_link_append_datablock_ex(), and wm_link_append_exec().
| void BKE_blendfile_link_append_context_finalize | ( | BlendfileLinkAppendContext * | lapp_context | ) |
Finalize the link/append process.
NOTE: Currently only used to call the matching handler..
Definition at line 362 of file blendfile_link_append.cc.
References BlendfileLinkAppendContext::Appending, BKE_callback_exec(), BKE_CB_EVT_BLENDIMPORT_POST, BLI_assert, LibraryLink_Params::bmain, BlendfileLinkAppendContext::Done, ELEM, BlendfileLinkAppendContext::Instantiating, BlendfileLinkAppendContext::Linking, BlendfileLinkAppendContext::params, BlendfileLinkAppendContext::process_stage, and RNA_pointer_create().
Referenced by blender::bke::asset_link_id(), bpy_lib_exit(), copybuffer_append(), wm_file_link_append_datablock_ex(), and wm_link_append_exec().
| void BKE_blendfile_link_append_context_flag_set | ( | BlendfileLinkAppendContext * | lapp_context, |
| int | flag, | ||
| bool | do_set ) |
Set or clear flags in given lapp_context.
| flag | A combination of:
|
| do_set | Set the given flag if true, clear it otherwise. |
Definition at line 149 of file blendfile_link_append.cc.
References flag, LibraryLink_Params::flag, and BlendfileLinkAppendContext::params.
Referenced by blender::bke::asset_link_id(), and wm_lib_relocate_exec_do().
| void BKE_blendfile_link_append_context_free | ( | BlendfileLinkAppendContext * | lapp_context | ) |
Free a link/append context.
Definition at line 138 of file blendfile_link_append.cc.
References BLI_assert, BlendfileLinkAppendContext::libraries, BlendfileLinkAppendContext::library_weak_reference_mapping, and link_append_context_library_blohandle_release().
Referenced by blender::bke::asset_link_id(), BKE_copybuffer_paste(), BKE_copybuffer_read(), bpy_lib_exit(), wm_file_link_append_datablock_ex(), WM_lib_reload(), wm_lib_relocate_exec_do(), and wm_link_append_exec().
| void BKE_blendfile_link_append_context_init_done | ( | BlendfileLinkAppendContext * | lapp_context | ) |
Called once the link/append process has been fully initialized (all of its data has been set).
NOTE: Currently only used to call the matching handler.
Definition at line 353 of file blendfile_link_append.cc.
References BKE_callback_exec(), BKE_CB_EVT_BLENDIMPORT_PRE, BLI_assert, LibraryLink_Params::bmain, BlendfileLinkAppendContext::Init, BlendfileLinkAppendContext::params, BlendfileLinkAppendContext::process_stage, and RNA_pointer_create().
Referenced by blender::bke::asset_link_id(), BKE_blendfile_library_relocate(), bpy_lib_exit(), copybuffer_append(), wm_file_link_append_datablock_ex(), and wm_link_append_exec().
| bool BKE_blendfile_link_append_context_is_empty | ( | BlendfileLinkAppendContext * | lapp_context | ) |
Check if given link/append context is empty (has no items to process) or not.
Definition at line 281 of file blendfile_link_append.cc.
References BlendfileLinkAppendContext::items.
Referenced by wm_link_append_exec().
| BlendfileLinkAppendContextItem * BKE_blendfile_link_append_context_item_add | ( | BlendfileLinkAppendContext * | lapp_context, |
| const char * | idname, | ||
| short | idcode, | ||
| void * | userdata ) |
Add a new item (data-block name and idcode) to be searched and linked/appended from libraries associated to the given context.
| userdata | an opaque user-data pointer stored in generated link/append item. |
TODO: Add a more friendly version of this that combines it with the call to BKE_blendfile_link_append_context_item_library_index_enable to enable the added item for all added library sources.
Definition at line 196 of file blendfile_link_append.cc.
References BlendfileLinkAppendContextItem::action, BlendfileLinkAppendContextItem::idcode, BlendfileLinkAppendContext::items, BlendfileLinkAppendContextItem::lapp_context, BlendfileLinkAppendContext::libraries, BlendfileLinkAppendContextItem::libraries, LINK_APPEND_ACT_UNSET, BlendfileLinkAppendContextItem::name, BlendfileLinkAppendContextItem::new_id, blender::Vector< T, InlineBufferCapacity, Allocator >::size(), and BlendfileLinkAppendContextItem::userdata.
Referenced by blender::bke::asset_link_id(), BKE_blendfile_library_relocate(), BKE_blendfile_link_append_context_item_idtypes_from_library_add(), bpy_lib_exit(), foreach_libblock_append_add_dependencies_callback(), foreach_libblock_link_finalize_cb(), wm_file_link_append_datablock_ex(), and wm_link_append_exec().
| void BKE_blendfile_link_append_context_item_foreach | ( | BlendfileLinkAppendContext * | lapp_context, |
| blender::FunctionRef< bool(BlendfileLinkAppendContext *lapp_context, BlendfileLinkAppendContextItem *item)> | callback_function, | ||
| eBlendfileLinkAppendForeachItemFlag | flag ) |
Iterate over all (or a subset) of the items listed in given BlendfileLinkAppendContext, and call the callback_function on them.
| flag | Control which type of items to process (see eBlendfileLinkAppendForeachItemFlag enum flags). |
| userdata | An opaque void pointer passed to the callback_function. |
| callback_function | Called over each (or a subset of each) of the items in given BlendfileLinkAppendContext. |
true if iteration should continue, false otherwise. Definition at line 329 of file blendfile_link_append.cc.
References BKE_BLENDFILE_LINK_APPEND_FOREACH_ITEM_FLAG_DO_DIRECT, BKE_BLENDFILE_LINK_APPEND_FOREACH_ITEM_FLAG_DO_INDIRECT, flag, BlendfileLinkAppendContext::items, LINK_APPEND_TAG_INDIRECT, and BlendfileLinkAppendContextItem::tag.
Referenced by bpy_lib_exit(), and blender::bke::greasepencil::convert::legacy_main().
| short BKE_blendfile_link_append_context_item_idcode_get | ( | BlendfileLinkAppendContext * | lapp_context, |
| BlendfileLinkAppendContextItem * | item ) |
Definition at line 323 of file blendfile_link_append.cc.
References BlendfileLinkAppendContextItem::idcode.
Referenced by bpy_lib_exit_lapp_context_items_cb().
| int BKE_blendfile_link_append_context_item_idtypes_from_library_add | ( | BlendfileLinkAppendContext * | lapp_context, |
| ReportList * | reports, | ||
| uint64_t | id_types_filter, | ||
| int | library_index ) |
Search for all ID matching given id_types_filter in given library_index, and add them to the list of items to process.
lapp_context after this function.| id_types_filter | A set of FILTER_ID bitflags, the types of IDs to add to the items list. |
| library_index | The index of the library to look into, in given lapp_context. |
BLENDFILE_LINK_APPEND_INVALID if it could not open the .blend file. Definition at line 219 of file blendfile_link_append.cc.
References BKE_blendfile_link_append_context_item_add(), BKE_blendfile_link_append_context_item_library_index_enable(), BKE_idtype_idcode_is_linkable(), BKE_idtype_idcode_iter_step(), BKE_idtype_idcode_to_idfilter(), BLENDFILE_LINK_APPEND_INVALID, BLI_assert, BLO_blendhandle_get_datablock_names(), FILE_ASSETS_ONLY, LibraryLink_Params::flag, id_name(), BlendfileLinkAppendContext::Init, BlendfileLinkAppendContext::libraries, LinkNode::link, link_append_context_library_blohandle_ensure(), MEM_freeN(), LinkNode::next, BlendfileLinkAppendContext::params, and BlendfileLinkAppendContext::process_stage.
Referenced by BKE_copybuffer_paste(), and BKE_copybuffer_read().
| ID * BKE_blendfile_link_append_context_item_liboverrideid_get | ( | BlendfileLinkAppendContext * | lapp_context, |
| BlendfileLinkAppendContextItem * | item ) |
Definition at line 315 of file blendfile_link_append.cc.
References BLI_assert, BlendfileLinkAppendContext::Init, BlendfileLinkAppendContextItem::liboverride_id, BlendfileLinkAppendContext::process_stage, and UNUSED_VARS_NDEBUG.
Referenced by bpy_lib_exit_lapp_context_items_cb().
| void BKE_blendfile_link_append_context_item_library_index_enable | ( | BlendfileLinkAppendContext * | lapp_context, |
| BlendfileLinkAppendContextItem * | item, | ||
| int | library_index ) |
Enable search of the given item into the library stored at given index in the link/append context.
Definition at line 271 of file blendfile_link_append.cc.
References BLI_assert, BlendfileLinkAppendContext::Init, BlendfileLinkAppendContextItem::libraries, BlendfileLinkAppendContext::process_stage, and UNUSED_VARS_NDEBUG.
Referenced by blender::bke::asset_link_id(), BKE_blendfile_link_append_context_item_idtypes_from_library_add(), bpy_lib_exit(), wm_file_link_append_datablock_ex(), and wm_link_append_exec().
| ID * BKE_blendfile_link_append_context_item_newid_get | ( | BlendfileLinkAppendContext * | lapp_context, |
| BlendfileLinkAppendContextItem * | item ) |
Definition at line 292 of file blendfile_link_append.cc.
References BLI_assert, BlendfileLinkAppendContext::Init, BlendfileLinkAppendContextItem::new_id, BlendfileLinkAppendContext::process_stage, and UNUSED_VARS_NDEBUG.
Referenced by blender::bke::asset_link_id(), bpy_lib_exit_lapp_context_items_cb(), and wm_file_link_append_datablock_ex().
| void BKE_blendfile_link_append_context_item_newid_set | ( | BlendfileLinkAppendContext * | lapp_context, |
| BlendfileLinkAppendContextItem * | item, | ||
| ID * | new_id ) |
Replace the newly linked ID by another from the same library. Rarely used, necessary e.g. in some complex 'do version after setup' code when an ID is replaced by another one.
Definition at line 300 of file blendfile_link_append.cc.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), BLI_assert, blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::contains(), BlendfileLinkAppendContext::Init, ID::lib, BlendfileLinkAppendContextItem::liboverride_id, BlendfileLinkAppendContextItem::new_id, BlendfileLinkAppendContext::new_id_to_item, BlendfileLinkAppendContext::process_stage, and blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::remove().
Referenced by blender::bke::greasepencil::convert::legacy_main().
| void * BKE_blendfile_link_append_context_item_userdata_get | ( | BlendfileLinkAppendContext * | lapp_context, |
| BlendfileLinkAppendContextItem * | item ) |
Definition at line 286 of file blendfile_link_append.cc.
References BlendfileLinkAppendContextItem::userdata.
Referenced by bpy_lib_exit_lapp_context_items_cb().
| void BKE_blendfile_link_append_context_library_add | ( | BlendfileLinkAppendContext * | lapp_context, |
| const char * | libname, | ||
| BlendHandle * | blo_handle ) |
Add a new source library to search for items to be linked to the given link/append context.
| libname | the absolute path to the library blend file. |
| blo_handle | the blend file handle of the library, nullptr if not available. Note that the ownership of this handle is always stolen, because readfile code may forcefully clear this handle after reading in some cases (endianness conversion, see usages of the FD_FLAGS_SWITCH_ENDIAN flag). |
Definition at line 178 of file blendfile_link_append.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), BLI_assert, BlendfileLinkAppendContextLibrary::blo_handle, BlendfileLinkAppendContextLibrary::blo_handle_is_owned, BlendfileLinkAppendContext::Init, BlendfileLinkAppendContext::items, BlendfileLinkAppendContext::libraries, BlendfileLinkAppendContextLibrary::path, and BlendfileLinkAppendContext::process_stage.
Referenced by blender::bke::asset_link_id(), BKE_copybuffer_paste(), BKE_copybuffer_read(), bpy_lib_exit(), wm_file_link_append_datablock_ex(), WM_lib_reload(), wm_lib_relocate_exec_do(), and wm_link_append_exec().
| BlendfileLinkAppendContext * BKE_blendfile_link_append_context_new | ( | LibraryLink_Params * | params | ) |
Allocate and initialize a new context to link/append data-blocks.
Definition at line 130 of file blendfile_link_append.cc.
References BlendfileLinkAppendContext::Init, BlendfileLinkAppendContext::params, params, and BlendfileLinkAppendContext::process_stage.
Referenced by blender::bke::asset_link_id(), BKE_copybuffer_paste(), BKE_copybuffer_read(), bpy_lib_exit(), wm_file_link_append_datablock_ex(), WM_lib_reload(), wm_lib_relocate_exec_do(), and wm_link_append_exec().
| void BKE_blendfile_link_append_instantiate_loose | ( | BlendfileLinkAppendContext * | lapp_context, |
| ReportList * | reports ) |
Instantiate loose data in the scene (e.g. add object to the active collection).
Definition at line 1481 of file blendfile_link_append.cc.
References BlendfileLinkAppendContext::Appending, BKE_library_foreach_ID_link(), BLI_assert, LibraryLink_Params::bmain, LibraryLink_Params::context, ELEM, FILE_LINK, LibraryLink_Params::flag, foreach_libblock_link_finalize_cb(), IDWALK_NOP, BlendfileLinkAppendContext::Instantiating, BlendfileLinkAppendContext::items, BlendfileLinkAppendContextCallBack::lapp_context, LooseDataInstantiateContext::lapp_context, BlendfileLinkAppendContext::Linking, loose_data_instantiate(), new_id_to_item_mapping_create(), BlendfileLinkAppendContext::params, BlendfileLinkAppendContext::process_stage, and LibraryLink_Params::scene.
Referenced by copybuffer_append(), wm_file_link_append_datablock_ex(), and wm_link_append_exec().
| void BKE_blendfile_override | ( | BlendfileLinkAppendContext * | lapp_context, |
| const eBKELibLinkOverride | flags, | ||
| ReportList * | reports ) |
Create (or find existing) liboverrides from linked data.
The IDs processed by this functions are the one that have been linked by a previous call to BKE_blendfile_link on the same lapp_context.
Control over how liboverrides are created is done through the extra eBKELibLinkOverride flags.
Definition at line 1604 of file blendfile_link_append.cc.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), BKE_lib_override_library_create_from_id(), BKE_LIBLINK_OVERRIDE_CREATE_RUNTIME, BKE_LIBLINK_OVERRIDE_USE_EXISTING_LIBOVERRIDES, BKE_main_namemap_clear(), BLI_assert, LibraryLink_Params::bmain, FILE_LINK, LibraryLink_Params::flag, FOREACH_MAIN_ID_BEGIN, FOREACH_MAIN_ID_END, ID_IS_LINKED, ID_IS_OVERRIDE_LIBRARY_REAL, ID_TAG_INDIRECT, ID_TAG_PRE_EXISTING, ID_TAG_RUNTIME, BlendfileLinkAppendContext::items, blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_default(), ID::override_library, BlendfileLinkAppendContext::params, IDOverrideLibrary::reference, and ID::tag.
Referenced by bpy_lib_exit().
|
static |
Definition at line 1062 of file blendfile_link_append.cc.
References blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), BKE_idtype_idcode_append_is_reusable(), BKE_library_foreach_ID_link(), BKE_main_library_weak_reference_remove_item(), BKE_main_library_weak_reference_search_item(), BLI_assert, BLI_assert_msg, BLO_LIBLINK_APPEND_LOCAL_ID_REUSE, BLO_LIBLINK_APPEND_RECURSIVE, LibraryLink_Params::bmain, CLOG_INFO, blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::contains(), ELEM, LibraryLink_Params::flag, foreach_libblock_append_add_dependencies_callback(), foreach_libblock_append_ensure_reusable_local_id_callback(), foreach_libblock_append_finalize_action_callback(), GS, ID_TAG_PRE_EXISTING, IDWALK_NOP, BlendfileLinkAppendContext::items, BlendfileLinkAppendContextCallBack::lapp_context, BlendfileLinkAppendContext::library_weak_reference_mapping, LINK_APPEND_ACT_COPY_LOCAL, LINK_APPEND_ACT_KEEP_LINKED, LINK_APPEND_ACT_MAKE_LOCAL, LINK_APPEND_ACT_REUSE_LOCAL, LINK_APPEND_ACT_UNSET, LINK_APPEND_TAG_LIBOVERRIDE_DEPENDENCY, LINK_APPEND_TAG_LIBOVERRIDE_DEPENDENCY_ONLY, LOG, and BlendfileLinkAppendContext::params.
Referenced by BKE_blendfile_append().
|
static |
Definition at line 1682 of file blendfile_link_append.cc.
References BKE_libblock_remap_locked(), BKE_reportf(), BLI_assert, BLI_assert_unreachable, BLI_strncpy(), CLOG_INFO, ID::flag, GS, id_fake_user_clear(), id_fake_user_set(), ID_FLAG_FAKEUSER, id_sort_by_name(), ID_TAG_INDIRECT, len, ID::lib, LOG, MAX_ID_NAME, ID::name, Library_Runtime::parent, RPT_WARNING, Library::runtime, ID::tag, ID::us, and which_libbase().
Referenced by BKE_blendfile_library_relocate().
|
static |
Definition at line 422 of file blendfile_link_append.cc.
References LISTBASE_FOREACH, OB_EMPTY, and Main::objects.
Referenced by loose_data_instantiate_collection_process().
|
static |
Definition at line 942 of file blendfile_link_append.cc.
References BlendfileLinkAppendContextItem::action, BKE_blendfile_link_append_context_item_add(), BKE_id_name(), LibraryIDLinkCallbackData::cb_flag, foreach_libblock_append_add_dependencies_callback(), foreach_libblock_link_append_common_processing(), GS, LibraryIDLinkCallbackData::id_pointer, IDWALK_CB_OVERRIDE_LIBRARY_REFERENCE, IDWALK_RET_NOP, BlendfileLinkAppendContextItem::lapp_context, LINK_APPEND_ACT_UNSET, LINK_APPEND_TAG_INDIRECT, LINK_APPEND_TAG_LIBOVERRIDE_DEPENDENCY, LINK_APPEND_TAG_LIBOVERRIDE_DEPENDENCY_ONLY, blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_default(), BlendfileLinkAppendContextItem::new_id, BlendfileLinkAppendContext::new_id_to_item, new_id_to_item_mapping_add(), BlendfileLinkAppendContextItem::source_library, BlendfileLinkAppendContextItem::tag, and LibraryIDLinkCallbackData::user_data.
Referenced by blendfile_append_define_actions(), and foreach_libblock_append_add_dependencies_callback().
|
static |
Definition at line 1003 of file blendfile_link_append.cc.
References BlendfileLinkAppendContextItem::action, BKE_main_library_weak_reference_remove_item(), BLI_assert, Library::filepath, foreach_libblock_append_ensure_reusable_local_id_callback(), foreach_libblock_link_append_common_processing(), LibraryIDLinkCallbackData::id_pointer, IDWALK_RET_NOP, BlendfileLinkAppendContextItem::lapp_context, ID::lib, LINK_APPEND_ACT_KEEP_LINKED, blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup(), ID::name, BlendfileLinkAppendContext::new_id_to_item, LibraryIDLinkCallbackData::owner_id, BlendfileLinkAppendContextItem::reusable_local_id, and LibraryIDLinkCallbackData::user_data.
Referenced by blendfile_append_define_actions(), and foreach_libblock_append_ensure_reusable_local_id_callback().
|
static |
Definition at line 1036 of file blendfile_link_append.cc.
References BlendfileLinkAppendContextItem::action, BLI_assert, CLOG_INFO, foreach_libblock_append_finalize_action_callback(), foreach_libblock_link_append_common_processing(), LibraryIDLinkCallbackData::id_pointer, IDWALK_RET_NOP, BlendfileLinkAppendContextItem::lapp_context, LINK_APPEND_ACT_COPY_LOCAL, LINK_APPEND_ACT_KEEP_LINKED, LINK_APPEND_ACT_MAKE_LOCAL, LOG, blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup(), BlendfileLinkAppendContext::new_id_to_item, and LibraryIDLinkCallbackData::user_data.
Referenced by blendfile_append_define_actions(), and foreach_libblock_append_finalize_action_callback().
|
static |
Definition at line 895 of file blendfile_link_append.cc.
References BKE_idtype_idcode_is_linkable(), BKE_library_foreach_ID_link(), LibraryIDLinkCallbackData::bmain, callback, LibraryIDLinkCallbackData::cb_flag, CLOG_ERROR, GS, ID_IS_LINKED, LibraryIDLinkCallbackData::id_pointer, IDWALK_CB_EMBEDDED, IDWALK_CB_EMBEDDED_NOT_OWNING, IDWALK_CB_INTERNAL, IDWALK_CB_LOOPBACK, IDWALK_NOP, LOG, ID::name, LibraryIDLinkCallbackData::self_id, and LibraryIDLinkCallbackData::user_data.
Referenced by foreach_libblock_append_add_dependencies_callback(), foreach_libblock_append_ensure_reusable_local_id_callback(), foreach_libblock_append_finalize_action_callback(), and foreach_libblock_link_finalize_cb().
|
static |
Definition at line 1440 of file blendfile_link_append.cc.
References BlendfileLinkAppendContextItem::action, BKE_blendfile_link_append_context_item_add(), BKE_id_name(), foreach_libblock_link_append_common_processing(), foreach_libblock_link_finalize_cb(), GS, LibraryIDLinkCallbackData::id_pointer, ID_TAG_PRE_EXISTING, IDWALK_RET_NOP, BlendfileLinkAppendContextItem::lapp_context, LINK_APPEND_ACT_KEEP_LINKED, LINK_APPEND_TAG_INDIRECT, blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_default(), BlendfileLinkAppendContextItem::new_id, BlendfileLinkAppendContext::new_id_to_item, new_id_to_item_mapping_add(), BlendfileLinkAppendContextItem::source_library, BlendfileLinkAppendContextItem::tag, and LibraryIDLinkCallbackData::user_data.
Referenced by BKE_blendfile_link_append_instantiate_loose(), and foreach_libblock_link_finalize_cb().
|
static |
Definition at line 94 of file blendfile_link_append.cc.
References BlendfileLinkAppendContextLibrary::bf_reports, BlendfileLinkAppendContext::blendfile_mem, BlendfileLinkAppendContext::blendfile_memsize, BLO_blendhandle_from_file(), BLO_blendhandle_from_memory(), BLO_EMBEDDED_STARTUP_BLEND, BlendfileLinkAppendContextLibrary::blo_handle, BlendfileLinkAppendContextLibrary::blo_handle_is_owned, blender::StringRefNull::c_str(), BlendfileLinkAppendContextLibrary::path, and BlendFileReadReport::reports.
Referenced by BKE_blendfile_link(), and BKE_blendfile_link_append_context_item_idtypes_from_library_add().
|
static |
Definition at line 121 of file blendfile_link_append.cc.
References BLO_blendhandle_close(), BlendfileLinkAppendContextLibrary::blo_handle, and BlendfileLinkAppendContextLibrary::blo_handle_is_owned.
Referenced by BKE_blendfile_link(), and BKE_blendfile_link_append_context_free().
|
static |
Definition at line 843 of file blendfile_link_append.cc.
References BLO_LIBLINK_OBDATA_INSTANCE, LibraryLink_Params::context, LibraryLink_Params::flag, LooseDataInstantiateContext::lapp_context, loose_data_instantiate_collection_process(), loose_data_instantiate_obdata_preprocess(), loose_data_instantiate_obdata_process(), loose_data_instantiate_object_process(), loose_data_instantiate_object_rigidbody_postprocess(), BlendfileLinkAppendContext::params, and LibraryLink_Params::scene.
Referenced by BKE_blendfile_link_append_instantiate_loose().
|
static |
Definition at line 571 of file blendfile_link_append.cc.
References ID_TAG_DOIT, and loose_data_instantiate_collection_parents_check_recursive().
Referenced by loose_data_instantiate_collection_parents_check_recursive(), and loose_data_instantiate_collection_process().
|
static |
Definition at line 588 of file blendfile_link_append.cc.
References LooseDataInstantiateContext::active_collection, BASE_SELECTED, BKE_collection_child_add(), BKE_object_add_only_object(), BKE_scene_object_base_flag_sync_from_base(), BKE_view_layer_base_find(), BKE_view_layer_synced_ensure(), BLO_LIBLINK_COLLECTION_INSTANCE, LibraryLink_Params::bmain, collection_instantiated_by_any_object(), LibraryLink_Params::context, copy_v3_v3(), Object::empty_drawsize, FILE_AUTOSELECT, FILE_LINK, Base::flag, LibraryLink_Params::flag, GS, Object::id, ID_GR, ID_TAG_DOIT, id_us_plus(), Object::instance_collection, BlendfileLinkAppendContext::items, LooseDataInstantiateContext::lapp_context, LINK_APPEND_TAG_INDIRECT, LISTBASE_FOREACH, Object::loc, loose_data_instantiate_collection_parents_check_recursive(), loose_data_instantiate_ensure_active_collection(), loose_data_instantiate_object_base_instance_init(), loose_data_instantiate_process_check(), OB_DUPLICOLLECTION, OB_EMPTY, object_in_any_scene(), BlendfileLinkAppendContext::params, LibraryLink_Params::scene, ID::tag, Object::transflag, Object::type, LibraryLink_Params::v3d, and LibraryLink_Params::view_layer.
Referenced by loose_data_instantiate().
|
static |
Definition at line 456 of file blendfile_link_append.cc.
References LooseDataInstantiateContext::active_collection, BKE_collection_add(), BKE_collection_parent_editable_find_recursive(), BKE_layer_collection_get_active(), LibraryLink_Params::bmain, LayerCollection::collection, LibraryLink_Params::context, DATA_, FILE_ACTIVE_COLLECTION, FILE_LINK, LibraryLink_Params::flag, LooseDataInstantiateContext::lapp_context, BlendfileLinkAppendContext::params, LibraryLink_Params::scene, and LibraryLink_Params::view_layer.
Referenced by loose_data_instantiate_collection_process(), loose_data_instantiate_obdata_process(), and loose_data_instantiate_object_process().
|
static |
Definition at line 527 of file blendfile_link_append.cc.
References Object::data, bGPdata::flag, GP_DATA_ANNOTATIONS, GS, ID_GD_LEGACY, ID_OB, ID_TAG_DOIT, BlendfileLinkAppendContext::items, LooseDataInstantiateContext::lapp_context, loose_data_instantiate_process_check(), and OB_DATA_SUPPORT_ID.
Referenced by loose_data_instantiate().
|
static |
Definition at line 777 of file blendfile_link_append.cc.
References LooseDataInstantiateContext::active_collection, BKE_object_add_only_object(), BKE_object_materials_test(), BKE_object_obdata_to_type(), BLI_assert, LibraryLink_Params::bmain, LibraryLink_Params::context, copy_v3_v3(), Object::data, LibraryLink_Params::flag, GS, ID_TAG_DOIT, id_us_plus(), BlendfileLinkAppendContext::items, LooseDataInstantiateContext::lapp_context, Object::loc, loose_data_instantiate_ensure_active_collection(), loose_data_instantiate_object_base_instance_init(), loose_data_instantiate_process_check(), OB_DATA_SUPPORT_ID, BlendfileLinkAppendContext::params, LibraryLink_Params::scene, LibraryLink_Params::v3d, and LibraryLink_Params::view_layer.
Referenced by loose_data_instantiate().
|
static |
Definition at line 486 of file blendfile_link_append.cc.
References ViewLayer::basact, BASE_SELECTABLE, BASE_SELECTED, BKE_collection_object_add(), BKE_scene_object_base_flag_sync_from_base(), BKE_view_layer_base_find(), BKE_view_layer_synced_ensure(), BLI_assert, FILE_AUTOSELECT, FILE_LINK, Base::flag, flag, Base::local_view_bits, View3D::local_view_uid, OB_HIDE_SELECT, OB_HIDE_VIEWPORT, and Object::visibility_flag.
Referenced by loose_data_instantiate_collection_process(), loose_data_instantiate_obdata_process(), and loose_data_instantiate_object_process().
|
static |
Definition at line 721 of file blendfile_link_append.cc.
References LooseDataInstantiateContext::active_collection, LibraryLink_Params::bmain, CLAMP_MIN, LibraryLink_Params::context, FILE_LINK, LibraryLink_Params::flag, GS, Object::id, ID_OB, BlendfileLinkAppendContext::items, LooseDataInstantiateContext::lapp_context, LINK_APPEND_TAG_INDIRECT, loose_data_instantiate_ensure_active_collection(), loose_data_instantiate_object_base_instance_init(), loose_data_instantiate_process_check(), Object::mode, OB_MODE_OBJECT, object_in_any_collection(), BlendfileLinkAppendContext::params, LibraryLink_Params::scene, ID::us, LibraryLink_Params::v3d, and LibraryLink_Params::view_layer.
Referenced by loose_data_instantiate().
|
static |
Definition at line 827 of file blendfile_link_append.cc.
References BKE_rigidbody_ensure_local_object(), LibraryLink_Params::bmain, GS, ID_OB, BlendfileLinkAppendContext::items, LooseDataInstantiateContext::lapp_context, loose_data_instantiate_process_check(), and BlendfileLinkAppendContext::params.
Referenced by loose_data_instantiate().
|
static |
Definition at line 432 of file blendfile_link_append.cc.
References BlendfileLinkAppendContextItem::action, BLI_assert, ELEM, FILE_LINK, LibraryLink_Params::flag, ID_IS_LINKED, LooseDataInstantiateContext::lapp_context, LINK_APPEND_ACT_COPY_LOCAL, LINK_APPEND_ACT_MAKE_LOCAL, BlendfileLinkAppendContextItem::new_id, and BlendfileLinkAppendContext::params.
Referenced by loose_data_instantiate_collection_process(), loose_data_instantiate_obdata_preprocess(), loose_data_instantiate_obdata_process(), loose_data_instantiate_object_process(), and loose_data_instantiate_object_rigidbody_postprocess().
|
static |
Definition at line 870 of file blendfile_link_append.cc.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), and BlendfileLinkAppendContext::new_id_to_item.
Referenced by foreach_libblock_append_add_dependencies_callback(), foreach_libblock_link_finalize_cb(), and new_id_to_item_mapping_create().
|
static |
Definition at line 879 of file blendfile_link_append.cc.
References BlendfileLinkAppendContext::items, and new_id_to_item_mapping_add().
Referenced by BKE_blendfile_append(), and BKE_blendfile_link_append_instantiate_loose().
Definition at line 403 of file blendfile_link_append.cc.
References BKE_collection_has_object(), Main::collections, LISTBASE_FOREACH, and Main::scenes.
Referenced by loose_data_instantiate_object_process().
Definition at line 390 of file blendfile_link_append.cc.
References BKE_collection_has_object_recursive(), LISTBASE_FOREACH, and Main::scenes.
Referenced by loose_data_instantiate_collection_process().
|
static |
Definition at line 65 of file blendfile_link_append.cc.
Referenced by BKE_blendfile_append(), BKE_blendfile_library_relocate(), blendfile_append_define_actions(), blendfile_library_relocate_remap(), foreach_libblock_append_finalize_action_callback(), and foreach_libblock_link_append_common_processing().