Blender
V3.3
|
#include <stdlib.h>
#include <string.h>
#include "CLG_log.h"
#include "MEM_guardedalloc.h"
#include "DNA_ID.h"
#include "DNA_collection_types.h"
#include "DNA_key_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
#include "BLI_bitmap.h"
#include "BLI_blenlib.h"
#include "BLI_ghash.h"
#include "BLI_linklist.h"
#include "BLI_math.h"
#include "BLI_memarena.h"
#include "BLI_utildefines.h"
#include "BLT_translation.h"
#include "BKE_idtype.h"
#include "BKE_key.h"
#include "BKE_layer.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_material.h"
#include "BKE_object.h"
#include "BKE_report.h"
#include "BKE_rigidbody.h"
#include "BKE_scene.h"
#include "BKE_blendfile_link_append.h"
#include "BLO_readfile.h"
#include "BLO_writefile.h"
Go to the source code of this file.
Classes | |
struct | BlendfileLinkAppendContextItem |
struct | BlendfileLinkAppendContextLibrary |
struct | BlendfileLinkAppendContext |
struct | BlendfileLinkAppendContextCallBack |
struct | LooseDataInstantiateContext |
Functions | |
Library link/append code. | |
static void | blendfile_link_append_proxies_convert (Main *bmain, ReportList *reports) |
void | BKE_blendfile_append (BlendfileLinkAppendContext *lapp_context, ReportList *reports) |
void | BKE_blendfile_link (BlendfileLinkAppendContext *lapp_context, ReportList *reports) |
Library relocating code. | |
static void | blendfile_library_relocate_remap (Main *bmain, ID *old_id, ID *new_id, ReportList *reports, const bool do_reload, const short remap_flags) |
void | BKE_blendfile_library_relocate (BlendfileLinkAppendContext *lapp_context, ReportList *reports, Library *library, const bool do_reload) |
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.c.
typedef struct BlendfileLinkAppendContext BlendfileLinkAppendContext |
typedef struct BlendfileLinkAppendContextItem BlendfileLinkAppendContextItem |
typedef struct LooseDataInstantiateContext LooseDataInstantiateContext |
anonymous enum |
Enumerator | |
---|---|
LINK_APPEND_ACT_UNSET | |
LINK_APPEND_ACT_KEEP_LINKED | |
LINK_APPEND_ACT_REUSE_LOCAL | |
LINK_APPEND_ACT_MAKE_LOCAL | |
LINK_APPEND_ACT_COPY_LOCAL |
Definition at line 124 of file blendfile_link_append.c.
anonymous enum |
Enumerator | |
---|---|
LINK_APPEND_TAG_INDIRECT |
Definition at line 133 of file blendfile_link_append.c.
void BKE_blendfile_append | ( | struct BlendfileLinkAppendContext * | lapp_context, |
struct 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 1001 of file blendfile_link_append.c.
References BlendfileLinkAppendContextItem::action, BKE_id_multi_tagged_delete(), BKE_idtype_idcode_append_is_reusable(), BKE_lib_id_make_local(), BKE_libblock_relink_to_newid(), BKE_library_foreach_ID_link(), 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(), BKE_main_library_weak_reference_remove_item(), BKE_main_library_weak_reference_search_item(), blendfile_link_append_proxies_convert(), BLI_assert, BLI_assert_unreachable, BLI_strncpy(), BLO_LIBLINK_APPEND_ASSET_DATA_CLEAR, BLO_LIBLINK_APPEND_LOCAL_ID_REUSE, BLO_LIBLINK_APPEND_SET_FAKEUSER, LibraryLink_Params::bmain, CLOG_ERROR, CLOG_INFO, ELEM, FILE_LINK, FILE_MAX, Library::filepath, LibraryLink_Params::flag, foreach_libblock_link_append_callback(), GS, id, id_fake_user_set(), ID_GR, ID_IS_LINKED, ID_NEW_SET, ID_OB, IDWALK_NOP, BlendfileLinkAppendContext::items, BlendfileLinkAppendContextCallBack::lapp_context, LooseDataInstantiateContext::lapp_context, ID::lib, LIB_ID_MAKELOCAL_ASSET_DATA_CLEAR, LIB_ID_MAKELOCAL_FORCE_COPY, LIB_ID_MAKELOCAL_FORCE_LOCAL, LIB_ID_MAKELOCAL_FULL_LIBRARY, LIB_TAG_DOIT, LIB_TAG_PRE_EXISTING, BlendfileLinkAppendContext::library_weak_reference_mapping, LinkNode::link, LINK_APPEND_ACT_COPY_LOCAL, LINK_APPEND_ACT_KEEP_LINKED, LINK_APPEND_ACT_MAKE_LOCAL, LINK_APPEND_ACT_REUSE_LOCAL, LINK_APPEND_ACT_UNSET, LinkNodePair::list, LOG, loose_data_instantiate(), MAX_ID_NAME, ID::name, BlendfileLinkAppendContextItem::new_id, new_id_to_item_mapping_create(), ID::newid, LinkNode::next, NULL, BlendfileLinkAppendContext::num_items, BlendfileLinkAppendContext::params, ID::tag, and BlendfileLinkAppendContextItem::userdata.
Referenced by bpy_lib_exit(), copybuffer_append(), wm_file_link_append_datablock_ex(), and wm_link_append_exec().
void BKE_blendfile_library_relocate | ( | struct BlendfileLinkAppendContext * | lapp_context, |
struct ReportList * | reports, | ||
struct 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_context
lapp_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 1403 of file blendfile_link_append.c.
References BKE_blendfile_link(), BKE_blendfile_link_append_context_item_add(), BKE_id_free(), BKE_id_multi_tagged_delete(), BKE_idtype_idcode_is_linkable(), BKE_key_from_id(), BKE_key_from_id_p(), BKE_lib_override_library_main_operations_create(), BKE_lib_override_library_main_resync(), BKE_lib_override_library_update(), BKE_main_collection_sync(), 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_bitmap_set_all(), BLI_remlink(), LibraryLink_Params::bmain, CLOG_INFO, LibraryLink_Params::context, ListBase::first, ID::flag, FOREACH_MAIN_ID_BEGIN, FOREACH_MAIN_ID_END, GS, id, Library::id, Key::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_us_clear_real(), id_us_min(), id_us_plus_no_lib(), INDEX_ID_MAX, BlendfileLinkAppendContext::items, lib, ID::lib, LIB_TAG_DOIT, LIB_TAG_MISSING, LIB_TAG_PRE_EXISTING, BlendfileLinkAppendContextItem::libraries, library, LinkNode::link, LinkNodePair::list, LOG, ViewLayer::name, ID::name, BlendfileLinkAppendContextItem::new_id, LinkNode::next, ID::next, NULL, BlendfileLinkAppendContext::num_items, BlendfileLinkAppendContext::num_libraries, ID::override_library, BlendfileLinkAppendContext::params, IDOverrideLibrary::reference, LibraryLink_Params::scene, set_listbasepointers(), ID::tag, ID::us, USER_EXPERIMENTAL_TEST, BlendfileLinkAppendContextItem::userdata, 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 | ( | struct BlendfileLinkAppendContext * | lapp_context, |
struct ReportList * | reports | ||
) |
Perform linking operation on all items added to given lapp_context
.
Definition at line 1205 of file blendfile_link_append.c.
References BKE_library_foreach_ID_link(), BKE_reportf(), blendfile_link_append_proxies_convert(), BLI_assert, BLI_bitmap_set_all(), BLI_BITMAP_TEST, BLO_library_link_begin(), BLO_library_link_end(), BLO_library_link_named_part(), LibraryLink_Params::bmain, LibraryLink_Params::context, Main::curlib, FILE_LINK, LibraryLink_Params::flag, foreach_libblock_link_append_callback(), BlendfileLinkAppendContextItem::idcode, IDWALK_NOP, BlendfileLinkAppendContext::items, BlendfileLinkAppendContextCallBack::lapp_context, LooseDataInstantiateContext::lapp_context, lib, ID::lib, LIB_TAG_MISSING, BlendfileLinkAppendContextItem::libraries, BlendfileLinkAppendContext::libraries, LinkNode::link, link_append_context_library_blohandle_ensure(), link_append_context_library_blohandle_release(), LinkNodePair::list, loose_data_instantiate(), BlendfileLinkAppendContextItem::name, BlendfileLinkAppendContextItem::new_id, new_id_to_item_mapping_create(), LinkNode::next, NULL, BlendfileLinkAppendContext::num_items, BlendfileLinkAppendContext::num_libraries, BlendfileLinkAppendContext::params, BlendfileLinkAppendContextLibrary::path, RPT_WARNING, LibraryLink_Params::scene, BlendfileLinkAppendContextItem::source_library, Main::subversionfile, BlendfileLinkAppendContextItem::userdata, and Main::versionfile.
Referenced by 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 | ( | struct BlendfileLinkAppendContext * | lapp_context | ) |
Clear reference to Blender's embedded startup file into the context.
Definition at line 225 of file blendfile_link_append.c.
References BlendfileLinkAppendContext::blendfile_mem, BlendfileLinkAppendContext::blendfile_memsize, and NULL.
void BKE_blendfile_link_append_context_embedded_blendfile_set | ( | struct 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 215 of file blendfile_link_append.c.
References BlendfileLinkAppendContext::blendfile_mem, BlendfileLinkAppendContext::blendfile_memsize, BLI_assert_msg, and NULL.
Referenced by wm_file_link_append_datablock_ex(), and wm_link_append_exec().
void BKE_blendfile_link_append_context_flag_set | ( | struct 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 203 of file blendfile_link_append.c.
References LibraryLink_Params::flag, and BlendfileLinkAppendContext::params.
Referenced by wm_lib_relocate_exec_do().
void BKE_blendfile_link_append_context_free | ( | struct BlendfileLinkAppendContext * | lapp_context | ) |
Free a link/append context.
Definition at line 186 of file blendfile_link_append.c.
References BLI_assert, BLI_ghash_free(), BLI_memarena_free(), BlendfileLinkAppendContext::libraries, BlendfileLinkAppendContext::library_weak_reference_mapping, link_append_context_library_blohandle_release(), LinkNodePair::list, BlendfileLinkAppendContext::memarena, BlendfileLinkAppendContext::new_id_to_item, and NULL.
Referenced by 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().
bool BKE_blendfile_link_append_context_is_empty | ( | struct BlendfileLinkAppendContext * | lapp_context | ) |
Check if given link/append context is empty (has no items to process) or not.
Definition at line 337 of file blendfile_link_append.c.
References BlendfileLinkAppendContext::num_items.
Referenced by wm_link_append_exec().
BlendfileLinkAppendContextItem* BKE_blendfile_link_append_context_item_add | ( | struct 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 253 of file blendfile_link_append.c.
References BlendfileLinkAppendContextItem::action, BLI_BITMAP_NEW_MEMARENA, BLI_linklist_append_arena(), BLI_memarena_alloc(), BLI_memarena_calloc(), BLI_strncpy(), BlendfileLinkAppendContextItem::idcode, BlendfileLinkAppendContext::items, len, BlendfileLinkAppendContextItem::libraries, LINK_APPEND_ACT_UNSET, BlendfileLinkAppendContext::memarena, BlendfileLinkAppendContextItem::name, BlendfileLinkAppendContextItem::new_id, NULL, BlendfileLinkAppendContext::num_items, BlendfileLinkAppendContext::num_libraries, and BlendfileLinkAppendContextItem::userdata.
Referenced by BKE_blendfile_library_relocate(), BKE_blendfile_link_append_context_item_idtypes_from_library_add(), bpy_lib_exit(), foreach_libblock_link_append_callback(), wm_file_link_append_datablock_ex(), and wm_link_append_exec().
void BKE_blendfile_link_append_context_item_foreach | ( | struct BlendfileLinkAppendContext * | lapp_context, |
BKE_BlendfileLinkAppendContexteItemFunction | callback_function, | ||
eBlendfileLinkAppendForeachItemFlag | flag, | ||
void * | userdata | ||
) |
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 . |
Definition at line 361 of file blendfile_link_append.c.
References BKE_BLENDFILE_LINK_APPEND_FOREACH_ITEM_FLAG_DO_DIRECT, BKE_BLENDFILE_LINK_APPEND_FOREACH_ITEM_FLAG_DO_INDIRECT, BlendfileLinkAppendContext::items, LINK_APPEND_TAG_INDIRECT, LinkNodePair::list, LinkNode::next, and BlendfileLinkAppendContextItem::tag.
Referenced by bpy_lib_exit().
short BKE_blendfile_link_append_context_item_idcode_get | ( | struct BlendfileLinkAppendContext * | UNUSEDlapp_context, |
struct BlendfileLinkAppendContextItem * | item | ||
) |
Definition at line 354 of file blendfile_link_append.c.
References BlendfileLinkAppendContextItem::idcode.
int BKE_blendfile_link_append_context_item_idtypes_from_library_add | ( | struct BlendfileLinkAppendContext * | lapp_context, |
struct 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 278 of file blendfile_link_append.c.
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_linklist_find(), BLO_blendhandle_get_datablock_names(), FILE_ASSETS_ONLY, LibraryLink_Params::flag, id_name(), BlendfileLinkAppendContext::libraries, LinkNode::link, link_append_context_library_blohandle_ensure(), LinkNodePair::list, MEM_freeN, LinkNode::next, NULL, and BlendfileLinkAppendContext::params.
Referenced by BKE_copybuffer_paste(), and BKE_copybuffer_read().
void BKE_blendfile_link_append_context_item_library_index_enable | ( | BlendfileLinkAppendContext * | UNUSEDlapp_context, |
BlendfileLinkAppendContextItem * | item, | ||
const int | library_index | ||
) |
Definition at line 329 of file blendfile_link_append.c.
References BLI_BITMAP_ENABLE, and BlendfileLinkAppendContextItem::libraries.
Referenced by BKE_blendfile_link_append_context_item_idtypes_from_library_add().
ID* BKE_blendfile_link_append_context_item_newid_get | ( | BlendfileLinkAppendContext * | UNUSEDlapp_context, |
BlendfileLinkAppendContextItem * | item | ||
) |
Definition at line 348 of file blendfile_link_append.c.
References BlendfileLinkAppendContextItem::new_id.
void* BKE_blendfile_link_append_context_item_userdata_get | ( | BlendfileLinkAppendContext * | UNUSEDlapp_context, |
BlendfileLinkAppendContextItem * | item | ||
) |
Definition at line 342 of file blendfile_link_append.c.
References BlendfileLinkAppendContextItem::userdata.
void BKE_blendfile_link_append_context_library_add | ( | struct BlendfileLinkAppendContext * | lapp_context, |
const char * | libname, | ||
struct 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, NULL is not available. Note that this is only borrowed for linking purpose, no releasing or other management will be performed by #BKE_blendfile_link_append code on it. |
Definition at line 232 of file blendfile_link_append.c.
References BLI_assert, BLI_linklist_append_arena(), BLI_memarena_alloc(), BLI_memarena_calloc(), BLI_strncpy(), BlendfileLinkAppendContextLibrary::blo_handle, BlendfileLinkAppendContextLibrary::blo_handle_is_owned, BlendfileLinkAppendContext::items, len, BlendfileLinkAppendContext::libraries, LinkNodePair::list, BlendfileLinkAppendContext::memarena, NULL, BlendfileLinkAppendContext::num_libraries, and BlendfileLinkAppendContextLibrary::path.
Referenced by 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 | ( | struct LibraryLink_Params * | params | ) |
Allocate and initialize a new context to link/append data-blocks.
Definition at line 175 of file blendfile_link_append.c.
References BLI_memarena_calloc(), BLI_memarena_new(), BLI_MEMARENA_STD_BUFSIZE, BlendfileLinkAppendContext::memarena, BlendfileLinkAppendContext::params, and params.
Referenced by 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().
|
static |
Definition at line 1317 of file blendfile_link_append.c.
References BKE_libblock_remap_locked(), BKE_reportf(), BLI_assert, BLI_assert_unreachable, BLI_strncpy(), Freestyle::c, CLOG_INFO, ID::flag, GS, id_fake_user_clear(), id_fake_user_set(), id_sort_by_name(), len, ID::lib, LIB_FAKEUSER, LIB_TAG_INDIRECT, LOG, MAX_ID_NAME, MIN2, ID::name, NULL, Library::parent, RPT_WARNING, ID::tag, ID::us, and which_libbase().
Referenced by BKE_blendfile_library_relocate().
|
static |
Definition at line 980 of file blendfile_link_append.c.
References BKE_lib_override_library_main_proxy_convert(), BKE_reportf(), BlendFileReadReport::count, BlendFileReadReport::proxies_to_lib_overrides_failures, BlendFileReadReport::proxies_to_lib_overrides_success, BlendFileReadReport::reports, and RPT_WARNING.
Referenced by BKE_blendfile_append(), and BKE_blendfile_link().
|
static |
Definition at line 431 of file blendfile_link_append.c.
References LISTBASE_FOREACH, OB_EMPTY, and Main::objects.
Referenced by loose_data_instantiate_collection_process().
|
static |
Definition at line 901 of file blendfile_link_append.c.
References BlendfileLinkAppendContextItem::action, BKE_blendfile_link_append_context_item_add(), BKE_idtype_idcode_is_linkable(), BKE_library_foreach_ID_link(), BLI_ghash_lookup(), BLO_LIBLINK_APPEND_RECURSIVE, LibraryIDLinkCallbackData::bmain, LibraryIDLinkCallbackData::cb_flag, data, FILE_LINK, GS, id, LibraryIDLinkCallbackData::id_owner, LibraryIDLinkCallbackData::id_pointer, LibraryIDLinkCallbackData::id_self, IDWALK_CB_EMBEDDED, IDWALK_CB_INTERNAL, IDWALK_CB_LOOPBACK, IDWALK_CB_OVERRIDE_LIBRARY_REFERENCE, IDWALK_NOP, IDWALK_RET_NOP, ID::lib, LINK_APPEND_ACT_KEEP_LINKED, LINK_APPEND_TAG_INDIRECT, ID::name, BlendfileLinkAppendContextItem::new_id, new_id_to_item_mapping_add(), NULL, BlendfileLinkAppendContextItem::source_library, BlendfileLinkAppendContextItem::tag, and LibraryIDLinkCallbackData::user_data.
Referenced by BKE_blendfile_append(), and BKE_blendfile_link().
|
static |
Definition at line 138 of file blendfile_link_append.c.
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, NULL, BlendfileLinkAppendContextLibrary::path, BlendFileReadReport::reports, and STREQ.
Referenced by BKE_blendfile_link(), and BKE_blendfile_link_append_context_item_idtypes_from_library_add().
|
static |
Definition at line 165 of file blendfile_link_append.c.
References BLO_blendhandle_close(), BlendfileLinkAppendContextLibrary::blo_handle, BlendfileLinkAppendContextLibrary::blo_handle_is_owned, and NULL.
Referenced by BKE_blendfile_link(), and BKE_blendfile_link_append_context_free().
|
static |
Definition at line 843 of file blendfile_link_append.c.
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(), NULL, BlendfileLinkAppendContext::params, and LibraryLink_Params::scene.
Referenced by BKE_blendfile_append(), and BKE_blendfile_link().
|
static |
Definition at line 576 of file blendfile_link_append.c.
References ListBase::first, LIB_TAG_DOIT, NULL, and Collection::parents.
Referenced by loose_data_instantiate_collection_process().
|
static |
Definition at line 590 of file blendfile_link_append.c.
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(), BLO_LIBLINK_COLLECTION_INSTANCE, LibraryLink_Params::bmain, collection_instantiated_by_any_object(), LibraryLink_Params::context, copy_v3_v3(), Scene::cursor, Object::empty_drawsize, FILE_AUTOSELECT, FILE_LINK, LibraryLink_Params::flag, Base::flag, Collection::gobject, GS, id, Collection::id, ID_GR, id_us_plus(), Object::instance_collection, BlendfileLinkAppendContext::items, LooseDataInstantiateContext::lapp_context, LIB_TAG_DOIT, LinkNode::link, LINK_APPEND_TAG_INDIRECT, LinkNodePair::list, LISTBASE_FOREACH, Object::loc, View3DCursor::location, 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(), ID::name, LinkNode::next, NULL, OB_DUPLICOLLECTION, OB_EMPTY, object_in_any_scene(), BlendfileLinkAppendContext::params, LibraryLink_Params::scene, scene, BlendfileLinkAppendContextItem::tag, ID::tag, Object::transflag, Object::type, LibraryLink_Params::v3d, and LibraryLink_Params::view_layer.
Referenced by loose_data_instantiate().
|
static |
Definition at line 465 of file blendfile_link_append.c.
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, Scene::master_collection, NULL, BlendfileLinkAppendContext::params, LibraryLink_Params::scene, 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 535 of file blendfile_link_append.c.
References Object::data, GS, id, ID_OB, if(), BlendfileLinkAppendContext::items, LooseDataInstantiateContext::lapp_context, LIB_TAG_DOIT, LinkNode::link, LinkNodePair::list, loose_data_instantiate_process_check(), ID::name, BlendfileLinkAppendContextItem::new_id, ID::newid, LinkNode::next, NULL, and OB_DATA_SUPPORT_ID.
Referenced by loose_data_instantiate().
|
static |
Definition at line 774 of file blendfile_link_append.c.
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(), Scene::cursor, Object::data, LibraryLink_Params::flag, GS, id, id_us_plus(), BlendfileLinkAppendContext::items, LooseDataInstantiateContext::lapp_context, LIB_TAG_DOIT, LinkNode::link, LinkNodePair::list, Object::loc, View3DCursor::location, loose_data_instantiate_ensure_active_collection(), loose_data_instantiate_object_base_instance_init(), loose_data_instantiate_process_check(), ID::name, LinkNode::next, NULL, OB_DATA_SUPPORT_ID, BlendfileLinkAppendContext::params, LibraryLink_Params::scene, scene, ID::tag, type, LibraryLink_Params::v3d, and LibraryLink_Params::view_layer.
Referenced by loose_data_instantiate().
|
static |
Definition at line 495 of file blendfile_link_append.c.
References ViewLayer::basact, BASE_SELECTABLE, BASE_SELECTED, BKE_collection_object_add(), BKE_scene_object_base_flag_sync_from_base(), BKE_view_layer_base_find(), BLI_assert, FILE_AUTOSELECT, FILE_LINK, Base::flag, Base::local_view_bits, View3D::local_view_uuid, NULL, 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 718 of file blendfile_link_append.c.
References LooseDataInstantiateContext::active_collection, LibraryLink_Params::bmain, CLAMP_MIN, LibraryLink_Params::context, FILE_LINK, LibraryLink_Params::flag, GS, id, Object::id, ID_OB, BlendfileLinkAppendContext::items, LooseDataInstantiateContext::lapp_context, LinkNode::link, LINK_APPEND_TAG_INDIRECT, LinkNodePair::list, loose_data_instantiate_ensure_active_collection(), loose_data_instantiate_object_base_instance_init(), loose_data_instantiate_process_check(), Object::mode, ID::name, LinkNode::next, NULL, OB_MODE_OBJECT, object_in_any_collection(), BlendfileLinkAppendContext::params, BlendfileLinkAppendContextItem::tag, ID::us, LibraryLink_Params::v3d, and LibraryLink_Params::view_layer.
Referenced by loose_data_instantiate().
|
static |
Definition at line 825 of file blendfile_link_append.c.
References BKE_rigidbody_ensure_local_object(), LibraryLink_Params::bmain, GS, id, ID_OB, BlendfileLinkAppendContext::items, LooseDataInstantiateContext::lapp_context, LinkNode::link, LinkNodePair::list, loose_data_instantiate_process_check(), ID::name, LinkNode::next, NULL, and BlendfileLinkAppendContext::params.
Referenced by loose_data_instantiate().
|
static |
Definition at line 441 of file blendfile_link_append.c.
References BlendfileLinkAppendContextItem::action, BLI_assert, ELEM, FILE_LINK, LibraryLink_Params::flag, id, ID_IS_LINKED, LooseDataInstantiateContext::lapp_context, LINK_APPEND_ACT_COPY_LOCAL, LINK_APPEND_ACT_MAKE_LOCAL, BlendfileLinkAppendContextItem::new_id, NULL, 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.c.
References BLI_ghash_insert(), ID_IS_OVERRIDE_LIBRARY_REAL, LIB_TAG_PRE_EXISTING, and BlendfileLinkAppendContext::new_id_to_item.
Referenced by foreach_libblock_link_append_callback(), and new_id_to_item_mapping_create().
|
static |
Definition at line 886 of file blendfile_link_append.c.
References BLI_ghash_new(), BLI_ghashutil_ptrcmp(), BLI_ghashutil_ptrhash(), BlendfileLinkAppendContext::items, LinkNodePair::list, BlendfileLinkAppendContextItem::new_id, BlendfileLinkAppendContext::new_id_to_item, new_id_to_item_mapping_add(), LinkNode::next, and NULL.
Referenced by BKE_blendfile_append(), and BKE_blendfile_link().
Definition at line 413 of file blendfile_link_append.c.
References BKE_collection_has_object(), Main::collections, LISTBASE_FOREACH, Scene::master_collection, NULL, scene, and Main::scenes.
Referenced by loose_data_instantiate_object_process().
Definition at line 400 of file blendfile_link_append.c.
References BKE_collection_has_object_recursive(), LISTBASE_FOREACH, and Main::scenes.
Referenced by loose_data_instantiate_collection_process().
|
static |
Definition at line 55 of file blendfile_link_append.c.
Referenced by BKE_blendfile_append(), BKE_blendfile_library_relocate(), and blendfile_library_relocate_remap().