Blender
V3.3
|
#include <ctype.h>
#include <fcntl.h>
#include <limits.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdlib.h>
#include <time.h>
#include "BLI_utildefines.h"
#include <unistd.h>
#include "CLG_log.h"
#include "DNA_anim_types.h"
#include "DNA_asset_types.h"
#include "DNA_cachefile_types.h"
#include "DNA_collection_types.h"
#include "DNA_fileglobal_types.h"
#include "DNA_genfile.h"
#include "DNA_key_types.h"
#include "DNA_layer_types.h"
#include "DNA_node_types.h"
#include "DNA_packedFile_types.h"
#include "DNA_sdna_types.h"
#include "DNA_sound_types.h"
#include "DNA_vfont_types.h"
#include "DNA_volume_types.h"
#include "DNA_workspace_types.h"
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_endian_defines.h"
#include "BLI_endian_switch.h"
#include "BLI_ghash.h"
#include "BLI_linklist.h"
#include "BLI_math.h"
#include "BLI_memarena.h"
#include "BLI_mempool.h"
#include "BLI_threads.h"
#include "PIL_time.h"
#include "BLT_translation.h"
#include "BKE_anim_data.h"
#include "BKE_animsys.h"
#include "BKE_asset.h"
#include "BKE_blender_version.h"
#include "BKE_collection.h"
#include "BKE_global.h"
#include "BKE_idprop.h"
#include "BKE_idtype.h"
#include "BKE_layer.h"
#include "BKE_lib_id.h"
#include "BKE_lib_override.h"
#include "BKE_lib_query.h"
#include "BKE_main.h"
#include "BKE_main_idmap.h"
#include "BKE_material.h"
#include "BKE_modifier.h"
#include "BKE_node.h"
#include "BKE_object.h"
#include "BKE_packedFile.h"
#include "BKE_report.h"
#include "BKE_scene.h"
#include "BKE_screen.h"
#include "BKE_undo_system.h"
#include "BKE_workspace.h"
#include "DRW_engine.h"
#include "DEG_depsgraph.h"
#include "BLO_blend_defs.h"
#include "BLO_blend_validate.h"
#include "BLO_read_write.h"
#include "BLO_readfile.h"
#include "BLO_undofile.h"
#include "SEQ_clipboard.h"
#include "SEQ_iterator.h"
#include "SEQ_modifier.h"
#include "SEQ_sequencer.h"
#include "SEQ_utils.h"
#include "readfile.h"
#include <errno.h>
Go to the source code of this file.
Classes | |
struct | BHeadN |
struct | OldNew |
struct | OldNewMap |
struct | BlendDataReader |
struct | BlendLibReader |
struct | BlendExpander |
struct | BLOCacheStorage |
struct | BLOCacheStorageValue |
struct | BHeadSort |
Macros | |
#define | DNA_DEPRECATED_ALLOW |
#define | U (*((const UserDef *)&U)) |
#define | USE_BHEAD_READ_ON_DEMAND |
#define | USE_GHASH_BHEAD |
#define | USE_GHASH_RESTORE_POINTER |
#define | BHEADN_FROM_BHEAD(bh) ((BHeadN *)POINTER_OFFSET(bh, -(int)offsetof(BHeadN, bhead))) |
#define | BHEAD_USE_READ_ON_DEMAND(bhead) ((bhead)->code == DATA) |
Typedefs | |
typedef struct BHeadN | BHeadN |
Variables | |
static CLG_LogRef | LOG = {"blo.readfile"} |
static CLG_LogRef | LOG_UNDO = {"blo.readfile.undo"} |
Library Linking (expand pointers) | |
static BLOExpandDoitCallback | expand_doit |
static void | expand_doit_library (void *fdhandle, Main *mainvar, void *old) |
static void | expand_id (BlendExpander *expander, ID *id) |
static void | expand_id_embedded_id (BlendExpander *expander, ID *id) |
void | BLO_main_expander (BLOExpandDoitCallback expand_doit_func) |
void | BLO_expand_main (void *fdhandle, Main *mainvar) |
We could change this in the future, for now it's simplest if only data is delayed because ID names are used in lookup tables.
Definition at line 202 of file readfile.c.
#define BHEADN_FROM_BHEAD | ( | bh | ) | ((BHeadN *)POINTER_OFFSET(bh, -(int)offsetof(BHeadN, bhead))) |
Definition at line 196 of file readfile.c.
#define DEFAULT_SIZE_EXP 6 |
Definition at line 253 of file readfile.c.
#define DNA_DEPRECATED_ALLOW |
Definition at line 28 of file readfile.c.
#define ENTRIES_CAPACITY | ( | onm | ) | (1ll << (onm)->capacity_exp) |
Definition at line 250 of file readfile.c.
Definition at line 257 of file readfile.c.
#define MAP_CAPACITY | ( | onm | ) | (1ll << ((onm)->capacity_exp + 1)) |
Definition at line 251 of file readfile.c.
#define PERTURB_SHIFT 5 |
Definition at line 254 of file readfile.c.
#define SLOT_MASK | ( | onm | ) | (MAP_CAPACITY(onm) - 1) |
Definition at line 252 of file readfile.c.
#define USE_BHEAD_READ_ON_DEMAND |
~/.config/blender/X.XX/config/userpref.blend
)Definition at line 167 of file readfile.c.
#define USE_GHASH_BHEAD |
Use GHash for BHead name-based lookups (speeds up linking).
Definition at line 170 of file readfile.c.
#define USE_GHASH_RESTORE_POINTER |
Use GHash for restoring pointers by name.
Definition at line 173 of file readfile.c.
typedef struct BlendDataReader BlendDataReader |
typedef struct BlendExpander BlendExpander |
typedef struct BlendLibReader BlendLibReader |
typedef struct BLOCacheStorage BLOCacheStorage |
typedef struct BLOCacheStorageValue BLOCacheStorageValue |
typedef enum ePointerUserMode ePointerUserMode |
enum ePointerUserMode |
Enumerator | |
---|---|
USER_IGNORE | |
USER_REAL |
Definition at line 2399 of file readfile.c.
Definition at line 439 of file readfile.c.
References Freestyle::a, BLI_movelisttolist(), from, INDEX_ID_MAX, Main::is_read_invalid, and set_listbasepointers().
Referenced by blo_join_main(), library_link_end(), and read_libraries().
Checks to perform after lib_link_all
. Those operations cannot perform properly in a split bmain case, since some data from other bmain's (aka libraries) may not have been processed yet.
Definition at line 3837 of file readfile.c.
References BKE_main_collections_parent_relations_rebuild(), BLI_assert, BLO_main_validate_embedded_liboverrides(), BLO_main_validate_shapekeys(), lib_link_scenes_check_set(), Main::next, NULL, and Main::prev.
Referenced by blo_read_file_internal(), and library_link_end().
Definition at line 756 of file readfile.c.
References BLI_endian_switch_uint64(), BHead4::code, BHead8::code, ENDB, BHead4::len, BHead8::len, BHead4::nr, BHead8::nr, BHead4::old, BHead8::old, BHead4::SDNAnr, and BHead8::SDNAnr.
Referenced by get_bhead().
Definition at line 782 of file readfile.c.
References BHead4::code, BHead8::code, ENDB, BHead4::len, BHead8::len, BHead4::nr, BHead8::nr, BHead4::old, BHead8::old, BHead4::SDNAnr, and BHead8::SDNAnr.
Referenced by get_bhead().
Undo file support: add all library pointers in lookup.
Definition at line 1759 of file readfile.c.
References GS, id, INDEX_ID_MAX, LISTBASE_FOREACH, ID::name, FileData::old_mainlist, oldnewmap_lib_insert(), ptr, and set_listbasepointers().
Referenced by BLO_read_from_memfile().
Definition at line 937 of file readfile.c.
References BHeadN::bhead, FileData::bhead_list, ListBase::first, get_bhead(), and NULL.
Referenced by BLO_blendhandle_get_datablock_info(), BLO_blendhandle_get_datablock_names(), BLO_blendhandle_get_linkable_groups(), BLO_blendhandle_get_preview_for_id(), BLO_blendhandle_get_previews(), BLO_blendhandle_print_sizes(), blo_read_file_internal(), find_bhead(), find_bhead_from_code_name(), is_minversion_older_than_blender(), read_file_bhead_idname_map_create(), read_file_dna(), read_file_thumbnail(), read_file_version(), and sort_bhead_old_map().
AssetMetaData* blo_bhead_id_asset_data_address | ( | const FileData * | fd, |
const BHead * | bhead | ||
) |
Warning! Caller's responsibility to ensure given bhead is an ID one!
Definition at line 1036 of file readfile.c.
References BLI_assert, blo_bhead_is_id_valid_type(), FileData::id_asset_data_offset, NULL, and POINTER_OFFSET.
Referenced by BLO_blendhandle_get_datablock_info(), and BLO_blendhandle_get_datablock_names().
Warning! Caller's responsibility to ensure given bhead is an ID one!
Definition at line 1031 of file readfile.c.
References FileData::id_name_offset, and POINTER_OFFSET.
Referenced by BLO_blendhandle_get_datablock_info(), BLO_blendhandle_get_datablock_names(), BLO_blendhandle_get_preview_for_id(), BLO_blendhandle_get_previews(), expand_doit_library(), find_bhead_from_code_name(), is_yet_read(), and read_file_bhead_idname_map_create().
Definition at line 583 of file readfile.c.
References BHead::code.
Referenced by blo_bhead_is_id_valid_type().
Definition at line 590 of file readfile.c.
References BKE_idtype_idcode_is_valid(), blo_bhead_is_id(), and BHead::code.
Referenced by blo_bhead_id_asset_data_address(), blo_read_asset_data_block(), and read_file_bhead_idname_map_create().
Definition at line 965 of file readfile.c.
References BHeadN::bhead, BHEADN_FROM_BHEAD, get_bhead(), BHeadN::next, and NULL.
Referenced by BLO_blendhandle_get_datablock_info(), BLO_blendhandle_get_datablock_names(), BLO_blendhandle_get_linkable_groups(), BLO_blendhandle_get_preview_for_id(), BLO_blendhandle_get_previews(), BLO_blendhandle_print_sizes(), blo_blendhandle_read_preview_rects(), blo_read_file_internal(), find_bhead(), find_bhead_from_code_name(), is_minversion_older_than_blender(), read_data_into_datamap(), read_file_bhead_idname_map_create(), read_file_dna(), read_file_thumbnail(), read_file_version(), read_global(), read_libblock(), read_libblock_is_identical(), and sort_bhead_old_map().
Definition at line 957 of file readfile.c.
References BHEADN_FROM_BHEAD, NULL, blender::meshintersect::prev(), and BHeadN::prev.
Referenced by BLO_blendhandle_get_datablock_info(), and find_previous_lib().
Definition at line 992 of file readfile.c.
References BHeadN::bhead, BHEADN_FROM_BHEAD, BLI_assert, FD_FLAGS_IS_MEMFILE, FileData::file, BHeadN::file_offset, FileData::flags, BHeadN::has_data, BHeadN::is_memchunk_identical, BHead::len, FileReader::offset, FileReader::read, FileReader::seek, and UNLIKELY.
Referenced by blo_bhead_read_full(), and read_struct().
Definition at line 1015 of file readfile.c.
References BHeadN::bhead, BHEADN_FROM_BHEAD, blo_bhead_read_data(), BHeadN::file_offset, BHeadN::has_data, BHeadN::is_memchunk_identical, BHead::len, MEM_freeN, MEM_mallocN, and NULL.
Referenced by read_struct().
Definition at line 1924 of file readfile.c.
References BLI_ghash_free(), BLI_memarena_free(), BLOCacheStorage::cache_map, FileData::cache_storage, MEM_freeN, BLOCacheStorage::memarena, and NULL.
Referenced by blo_filedata_free().
|
static |
Clear as needed a cache data entry from old ID, when reading some undo memfile.
Definition at line 1838 of file readfile.c.
References BLI_assert, BLI_ghash_lookup(), BLOCacheStorage::cache_map, BLOCacheStorageValue::cache_v, BLOCacheStorageValue::new_usage_count, and NULL.
Referenced by blo_cache_storage_old_bmain_clear().
|
static |
Register a cache data entry to be preserved when reading some undo memfile.
Definition at line 1794 of file readfile.c.
References BLI_assert, BLI_ghash_haskey(), BLI_ghash_insert(), BLI_memarena_alloc(), BLOCacheStorage::cache_map, BLOCacheStorageValue::cache_v, id, IDCacheKey::id_session_uuid, BLOCacheStorage::memarena, BLOCacheStorageValue::new_usage_count, ID::session_uuid, and UNUSED_VARS_NDEBUG.
Referenced by blo_cache_storage_init().
|
static |
Restore a cache data entry from old ID into new one, when reading some undo memfile.
Definition at line 1813 of file readfile.c.
References BLI_ghash_lookup(), BLOCacheStorage::cache_map, BLOCacheStorageValue::cache_v, IDTYPE_CACHE_CB_FLAGS_PERSISTENT, BLOCacheStorageValue::new_usage_count, and NULL.
Referenced by direct_link_id().
Definition at line 1861 of file readfile.c.
References BKE_idtype_cache_key_cmp(), BKE_idtype_cache_key_hash(), BKE_idtype_get_info_from_id(), BKE_idtype_id_foreach_cache(), BLI_assert, BLI_ghash_new(), BLI_memarena_new(), BLI_MEMARENA_STD_BUFSIZE, blo_cache_storage_entry_register(), BLOCacheStorage::cache_map, FileData::cache_storage, FD_FLAGS_IS_MEMFILE, ListBase::first, FileData::flags, IDTypeInfo::foreach_cache, FOREACH_MAIN_LISTBASE_BEGIN, FOREACH_MAIN_LISTBASE_END, FOREACH_MAIN_LISTBASE_ID_BEGIN, FOREACH_MAIN_LISTBASE_ID_END, ID_IS_LINKED, MEM_mallocN, BLOCacheStorage::memarena, and NULL.
Referenced by BLO_read_from_memfile().
Definition at line 1897 of file readfile.c.
References BKE_idtype_get_info_from_id(), BKE_idtype_id_foreach_cache(), blo_cache_storage_entry_clear_in_old(), FileData::cache_storage, ListBase::first, IDTypeInfo::foreach_cache, FOREACH_MAIN_LISTBASE_BEGIN, FOREACH_MAIN_LISTBASE_END, FOREACH_MAIN_LISTBASE_ID_BEGIN, FOREACH_MAIN_LISTBASE_ID_END, ID_IS_LINKED, and NULL.
Referenced by BLO_read_from_memfile().
|
static |
Definition at line 1249 of file readfile.c.
References BKE_reportf(), blo_filedata_free(), decode_blender_header(), FD_FLAGS_FILE_OK, FileData::flags, is_minversion_older_than_blender(), NULL, read_file_dna(), FileData::relabase, and RPT_ERROR.
Referenced by blo_filedata_from_file(), blo_filedata_from_memfile(), and blo_filedata_from_memory().
Definition at line 2323 of file readfile.c.
References Key::block, LISTBASE_FOREACH, and Key::uidgen.
Referenced by blo_do_versions_260().
Only library data.
Definition at line 1632 of file readfile.c.
References lib, and newlibadr().
Referenced by blo_do_versions_250(), blo_do_versions_260(), blo_do_versions_pre250(), and ntree_version_245().
void blo_do_versions_oldnewmap_insert | ( | OldNewMap * | onm, |
const void * | oldaddr, | ||
void * | newaddr, | ||
int | nr | ||
) |
Definition at line 368 of file readfile.c.
References oldnewmap_insert().
Referenced by blo_do_versions_pre250().
Set old main packed data to zero if it has been restored this works because freeing old main only happens after this call.
Definition at line 1723 of file readfile.c.
References OldNewMap::entries, Main::fonts, Main::images, lib, Main::libraries, LISTBASE_FOREACH, OldNewMap::nentries, OldNew::newp, newpackedadr(), OldNew::nr, NULL, FileData::packedmap, Main::sounds, and Main::volumes.
void BLO_expand_id | ( | BlendExpander * | expander, |
ID * | id | ||
) |
Definition at line 5323 of file readfile.c.
References expand_doit, BlendExpander::fd, and BlendExpander::main.
Loop over all ID data in Main to mark relations. Set (id->tag & LIB_TAG_NEED_EXPAND) to mark expanding. Flags get cleared after expanding.
fdhandle | usually filedata, or own handle. |
mainvar | the Main database to expand. |
Definition at line 4477 of file readfile.c.
References Freestyle::a, BKE_idtype_get_info_from_id(), IDTypeInfo::blend_read_expand, expand_id(), ListBase::first, id, INDEX_ID_MAX, LIB_TAG_NEED_EXPAND, NULL, set_listbasepointers(), and ID::tag.
Referenced by BKE_blendfile_write_partial(), library_link_end(), and read_libraries().
Definition at line 1433 of file readfile.c.
References FileData::bhead_idname_hash, FileData::bhead_list, BHEAD_USE_READ_ON_DEMAND, FileData::bheadmap, BKE_main_idmap_destroy(), BLI_assert, BLI_freelistN(), BLI_ghash_free(), blo_cache_storage_end(), FileReader::close, FileData::compflags, FileData::datamap, DNA_reconstruct_info_free(), DNA_sdna_free(), FD_FLAGS_NOT_MY_LIBMAP, FileData::file, FileData::filesdna, FileData::flags, FileData::globmap, FileData::libmap, LISTBASE_FOREACH_MUTABLE, MEM_freeN, NULL, FileData::old_idmap, oldnewmap_free(), FileData::packedmap, FileData::reconstruct_info, and FileReader::seek.
Referenced by BLO_blendhandle_close(), blo_decode_and_check(), blo_filedata_from_file_minimal(), BLO_read_from_file(), BLO_read_from_memfile(), BLO_read_from_memory(), BLO_thumbnail_from_file(), library_link_end(), and read_libraries().
FileData* blo_filedata_from_file | ( | const char * | filepath, |
struct BlendFileReadReport * | reports | ||
) |
On each new library added, it now checks for the current FileData and expands relativeness
cannot be called with relative paths anymore!
Definition at line 1357 of file readfile.c.
References BLI_strncpy(), blo_decode_and_check(), blo_filedata_from_file_open(), NULL, FileData::relabase, and BlendFileReadReport::reports.
Referenced by BLO_blendhandle_from_file(), BLO_read_from_file(), and read_library_file_data().
|
static |
Definition at line 1276 of file readfile.c.
References BKE_reportf(), BLI_file_magic_is_gzip(), BLI_file_magic_is_zstd(), BLI_filereader_new_file(), BLI_filereader_new_gzip(), BLI_filereader_new_mmap(), BLI_filereader_new_zstd(), FileReader::close, FileData::file, file, filedata_new(), NULL, FileReader::read, BlendFileReadReport::reports, RPT_WARNING, FileReader::seek, and TIP_.
Referenced by blo_filedata_from_file_open().
|
static |
Same as blo_filedata_from_file(), but does not reads DNA data, only header. Use it for light access (e.g. thumbnail reading).
Definition at line 1373 of file readfile.c.
References blo_filedata_free(), blo_filedata_from_file_open(), decode_blender_header(), FD_FLAGS_FILE_OK, FileData::flags, and NULL.
Referenced by BLO_thumbnail_from_file().
|
static |
Definition at line 1342 of file readfile.c.
References BKE_reportf(), BLI_open(), blo_filedata_from_file_descriptor(), file, NULL, O_BINARY, BlendFileReadReport::reports, RPT_WARNING, and TIP_.
Referenced by blo_filedata_from_file(), and blo_filedata_from_file_minimal().
FileData* blo_filedata_from_memfile | ( | MemFile * | memfile, |
const struct BlendFileReadParams * | params, | ||
BlendFileReadReport * | reports | ||
) |
Definition at line 1416 of file readfile.c.
References BKE_report(), blo_decode_and_check(), BLO_memfile_new_filereader(), FD_FLAGS_IS_MEMFILE, FileData::file, filedata_new(), FileData::flags, NULL, params, BlendFileReadReport::reports, RPT_WARNING, and FileData::undo_direction.
Referenced by BLO_read_from_memfile().
FileData* blo_filedata_from_memory | ( | const void * | mem, |
int | memsize, | ||
BlendFileReadReport * | reports | ||
) |
Definition at line 1386 of file readfile.c.
References BKE_report(), BLI_file_magic_is_gzip(), BLI_file_magic_is_zstd(), BLI_filereader_new_gzip(), BLI_filereader_new_memory(), BLI_filereader_new_zstd(), blo_decode_and_check(), FileReader::close, FileData::file, file, filedata_new(), NULL, BlendFileReadReport::reports, RPT_WARNING, SIZEOFBLENDERHEADER, and TIP_.
Referenced by BLO_blendhandle_from_memory(), BLO_read_from_memory(), and read_library_file_data().
Definition at line 642 of file readfile.c.
References BKE_libblock_alloc(), BKE_main_new(), BLI_addtail(), BLI_path_basename(), BLI_path_cmp, BLI_path_normalize(), BLI_strncpy(), CLOG_INFO, Main::curlib, FILE_MAX, Main::filepath, Library::filepath_abs, ListBase::first, G, G_DEBUG, ID_FAKE_USERS, ID_LI, id_us_ensure_real(), if(), lib, LOG, FileData::mainlist, Main::next, and read_file_version().
Referenced by expand_doit_library(), and library_link_begin().
bool BLO_has_bfile_extension | ( | const char * | str | ) |
Check whether given path ends with a blend file compatible extension (.blend
, .ble
or .blend.gz
).
str | The path to check. |
Definition at line 1497 of file readfile.c.
References BLI_path_extension_check_array(), NULL, and str.
Referenced by arg_handle_load_file(), blend_save_check(), BLO_library_path_explode(), ED_path_extension_type(), file_path_to_ui_path(), filelist_readjob_list_dir(), recent_files_menu_draw(), uiTemplateRecentFiles(), WM_lib_reload(), and wm_lib_relocate_exec_do().
Definition at line 455 of file readfile.c.
References add_main_to_main(), BKE_main_free(), BKE_main_idmap_destroy(), BLI_remlink(), ListBase::first, Main::id_map, Main::next, NULL, and Main::prev.
Referenced by BLO_main_validate_libraries(), blo_read_file_internal(), BLO_read_from_memfile(), library_link_end(), and write_file_handle().
void blo_lib_link_restore | ( | struct Main * | oldmain, |
struct Main * | newmain, | ||
struct wmWindowManager * | curwm, | ||
struct Scene * | curscene, | ||
struct ViewLayer * | cur_view_layer | ||
) |
Used to link a file (without UI) to the current UI. Note that it assumes the old pointers in UI are still valid, so old Main is not freed.
Definition at line 2819 of file readfile.c.
References BKE_main_idmap_create(), BKE_main_idmap_destroy(), BKE_view_layer_find(), BKE_workspace_active_get(), BKE_workspace_active_set(), BLI_assert, Scene::cursor, lib_link_clipboard_restore(), lib_link_main_data_restore(), lib_link_window_scene_data_restore(), lib_link_wm_xr_data_restore(), lib_link_workspace_layout_restore(), LISTBASE_FOREACH, MAIN_IDMAP_TYPE_NAME, ViewLayer::name, NULL, restore_pointer_by_name(), id_map< K, T >::scene, STRNCPY, USER_IGNORE, USER_REAL, wmWindowManager::windows, Main::workspaces, and wmWindowManager::xr.
Referenced by setup_app_data().
Main* BLO_library_link_begin | ( | BlendHandle ** | bh, |
const char * | filepath, | ||
const struct LibraryLink_Params * | params | ||
) |
Initialize the BlendHandle for linking library data.
bh | A blender file handle as returned by BLO_blendhandle_from_file or BLO_blendhandle_from_memory. |
filepath | Used for relative linking, copied to the lib->filepath . |
params | Settings for linking that don't change from beginning to end of linking. |
Definition at line 4650 of file readfile.c.
References library_link_begin(), and params.
Referenced by BKE_blendfile_link(), and BLO_library_temp_load_id().
void BLO_library_link_end | ( | struct Main * | mainl, |
BlendHandle ** | bh, | ||
const struct LibraryLink_Params * | params | ||
) |
Finalize linking from a given .blend file (library). Optionally instance the indirect object/collection in the scene when the flags are set.
mainl | The main database to link from (not the active one). |
bh | The blender file handle (WARNING! may be freed by this function!). |
params | Settings for linking that don't change from beginning to end of linking. |
Definition at line 4787 of file readfile.c.
References Main::is_read_invalid, library_link_end(), and params.
Referenced by BKE_blendfile_link(), and BLO_library_temp_free().
ID* BLO_library_link_named_part | ( | struct Main * | mainl, |
BlendHandle ** | bh, | ||
short | idcode, | ||
const char * | name, | ||
const struct LibraryLink_Params * | params | ||
) |
Link a named data-block from an external blend file.
mainl | The main database to link from (not the active one). |
bh | The blender file handle. |
idcode | The kind of data-block to link. |
name | The name of the data-block (without the 2 char ID prefix). |
Definition at line 4569 of file readfile.c.
References Main::is_read_invalid, link_named_part(), NULL, and params.
Referenced by BKE_blendfile_link(), and BLO_library_temp_load_id().
void BLO_library_link_params_init | ( | struct LibraryLink_Params * | params, |
struct Main * | bmain, | ||
const int | flag, | ||
const int | id_tag_extra | ||
) |
Definition at line 4622 of file readfile.c.
References params.
Referenced by BKE_copybuffer_read(), BLO_library_link_params_init_with_context(), BLO_library_temp_load_id(), and bpy_lib_exit().
void BLO_library_link_params_init_with_context | ( | struct LibraryLink_Params * | params, |
struct Main * | bmain, | ||
const int | flag, | ||
const int | id_tag_extra, | ||
struct Scene * | scene, | ||
struct ViewLayer * | view_layer, | ||
const struct View3D * | v3d | ||
) |
Definition at line 4633 of file readfile.c.
References BLO_library_link_params_init(), NULL, params, and scene.
Referenced by BKE_copybuffer_paste(), wm_file_link_append_datablock_ex(), WM_lib_reload(), wm_lib_relocate_exec_do(), and wm_link_append_exec().
bool BLO_library_path_explode | ( | const char * | path, |
char * | r_dir, | ||
char ** | r_group, | ||
char ** | r_name | ||
) |
Try to explode given path into its 'library components' (i.e. a .blend file, id type/group, and data-block itself).
path | the full path to explode. |
r_dir | the string that'll contain path up to blend file itself ('library' path). WARNING! Must be FILE_MAX_LIBEXTRA long (it also stores group and name strings)! |
r_group | the string that'll contain 'group' part of the path, if any. May be NULL. |
r_name | the string that'll contain data's name part of the path, if any. May be NULL. |
Definition at line 1503 of file readfile.c.
References BLI_assert, BLI_is_dir(), BLI_is_file(), BLI_path_slash_rfind(), BLO_EMBEDDED_STARTUP_BLEND, BLO_GROUP_MAX, BLO_has_bfile_extension(), Freestyle::c, MAX_ID_NAME, NULL, and STREQ.
Referenced by ED_asset_handle_get_full_library_path(), file_directory_enter_handle(), file_draw_icon(), file_draw_preview(), fileentry_uiname(), filelist_checkdir_lib(), filelist_islibrary(), filelist_readjob_list_lib(), IMB_thumb_manage(), is_filtered_lib_type(), and wm_link_append_exec().
Definition at line 4796 of file readfile.c.
References read_struct().
Referenced by BLO_blendhandle_get_preview_for_id(), BLO_blendhandle_get_previews(), and blo_blendhandle_read_preview_rects().
void BLO_main_expander | ( | BLOExpandDoitCallback | expand_doit_func | ) |
Set the callback func used over all ID data found by BLO_expand_main func.
expand_doit_func | Called for each ID block it finds. |
Definition at line 4472 of file readfile.c.
References expand_doit.
Referenced by BKE_blendfile_write_partial(), library_link_end(), and read_libraries().
Build a GSet of old main (we only care about local data here, so we can do that after blo_split_main() call.
Definition at line 1775 of file readfile.c.
References BKE_main_idmap_create(), BKE_main_idmap_destroy(), MAIN_IDMAP_TYPE_UUID, NULL, and FileData::old_idmap.
Referenced by BLO_read_from_memfile().
Definition at line 1682 of file readfile.c.
References Main::fonts, Main::images, insert_packedmap(), lib, Main::libraries, LISTBASE_FOREACH, oldnewmap_new(), FileData::packedmap, Main::sounds, and Main::volumes.
BHead* blo_read_asset_data_block | ( | FileData * | fd, |
BHead * | bhead, | ||
AssetMetaData ** | r_asset_data | ||
) |
Definition at line 3558 of file readfile.c.
References BKE_asset_metadata_read(), BLI_assert, blo_bhead_is_id_valid_type(), BLO_read_data_address, FileData::datamap, oldnewmap_clear(), and read_data_into_datamap().
Referenced by BLO_blendhandle_get_datablock_info().
void BLO_read_data_globmap_add | ( | BlendDataReader * | reader, |
void * | oldaddr, | ||
void * | newaddr | ||
) |
Definition at line 5293 of file readfile.c.
References BlendDataReader::fd, FileData::globmap, and oldnewmap_insert().
Referenced by window_manager_blend_read_data().
bool BLO_read_data_is_undo | ( | BlendDataReader * | reader | ) |
Definition at line 5288 of file readfile.c.
References BlendDataReader::fd, FD_FLAGS_IS_MEMFILE, and FileData::flags.
Referenced by BKE_previewimg_blend_read(), direct_link_id_common(), image_blend_read_data(), object_blend_read_data(), scene_blend_read_data(), and sound_blend_read_data().
BlendFileReadReport* BLO_read_data_reports | ( | BlendDataReader * | reader | ) |
Definition at line 5303 of file readfile.c.
References BlendDataReader::fd, and FileData::reports.
Referenced by BKE_modifier_blend_read_data(), and link_recurs_seq().
void BLO_read_double_array | ( | BlendDataReader * | reader, |
int | array_size, | ||
double ** | ptr_p | ||
) |
Definition at line 5206 of file readfile.c.
References BLI_endian_switch_double_array(), BLO_read_data_address, and BLO_read_requires_endian_switch().
Referenced by IDP_DirectLinkArray(), and read_ui_data().
BlendFileData* blo_read_file_internal | ( | FileData * | fd, |
const char * | filepath | ||
) |
Definition at line 3963 of file readfile.c.
References after_liblink_merged_bmain_process(), ATTR_FALLTHROUGH, BKE_collections_after_lib_link(), BKE_lib_override_library_main_update(), BKE_lib_override_library_main_validate(), BKE_main_id_refcount_recompute(), BKE_main_id_tag_all(), BKE_main_new(), Main::blen_thumb, BLEN_THUMB_MEMSIZE, BLEN_THUMB_MEMSIZE_FILE, BLEN_THUMB_MEMSIZE_IS_VALID, BLENFILETYPE_BLEND, BLI_addtail(), BLI_assert, blo_bhead_first(), blo_bhead_next(), blo_join_main(), BLO_READ_SKIP_DATA, BLO_READ_SKIP_USERDEF, blo_split_main(), CLOG_INFO, BHead::code, DATA, data, DNA1, do_versions(), do_versions_after_linking(), do_versions_userdef(), BlendFileReadReport::duration, ENDB, FD_FLAGS_IS_MEMFILE, Main::filepath, FileData::fileversion, fix_relpaths_library(), FileData::flags, G, GLOB, BlendThumbnail::height, height, ID_LINK_PLACEHOLDER, Main::id_map, ID_SCR, ID_SCRN, Main::is_read_invalid, ListBase::last, lib_link_all(), BlendFileReadReport::lib_overrides, LIB_TAG_LOCAL, LIB_TAG_NEW, BlendFileReadReport::libraries, link_global(), LISTBASE_FOREACH, LOG_UNDO, BlendFileData::main, FileData::mainlist, MEM_callocN, MEM_mallocN, ntreeUpdateAllNew(), NULL, PIL_check_seconds_timer(), placeholders_ensure_valid(), read_file_thumbnail(), read_global(), read_libblock(), read_libraries(), read_userdef(), BlendThumbnail::rect, FileData::relabase, REND, BlendFileReadReport::reports, FileData::reports, FileData::skip_flags, STRNCPY, TEST, BlendFileData::type, USER, Main::versionfile, BlendThumbnail::width, and width.
Referenced by BLO_read_from_file(), BLO_read_from_memfile(), and BLO_read_from_memory().
void BLO_read_float3_array | ( | BlendDataReader * | reader, |
int | array_size, | ||
float ** | ptr_p | ||
) |
Definition at line 5201 of file readfile.c.
References BLO_read_float_array().
Referenced by blendRead().
void BLO_read_float_array | ( | BlendDataReader * | reader, |
int | array_size, | ||
float ** | ptr_p | ||
) |
Definition at line 5193 of file readfile.c.
References BLI_endian_switch_float_array(), BLO_read_data_address, and BLO_read_requires_endian_switch().
Referenced by BKE_fmodifiers_blend_read_data(), blendRead(), and BLO_read_float3_array().
void* BLO_read_get_new_data_address | ( | BlendDataReader * | reader, |
const void * | old_address | ||
) |
Definition at line 5123 of file readfile.c.
References BlendDataReader::fd, and newdataadr().
Referenced by BKE_defvert_blend_read(), BKE_modifier_blend_read_data(), modifier_replace_with_fluid(), and scene_blend_read_data().
void* BLO_read_get_new_data_address_no_us | ( | BlendDataReader * | reader, |
const void * | old_address | ||
) |
Definition at line 5128 of file readfile.c.
References BlendDataReader::fd, and newdataadr_no_us().
Referenced by direct_link_area().
Direct data-blocks with global linking.
Definition at line 1611 of file readfile.c.
References FileData::globmap, and oldnewmap_lookup_and_inc().
Referenced by blo_do_versions_290(), and link_global().
ID* BLO_read_get_new_id_address | ( | BlendLibReader * | reader, |
Library * | lib, | ||
ID * | id | ||
) |
Definition at line 5138 of file readfile.c.
References BlendLibReader::fd, lib, and newlibadr().
Referenced by brush_undo_preserve_cb(), IDP_BlendReadLib(), object_blend_read_lib(), and scene_foreach_toolsettings_id_pointer_process().
void* BLO_read_get_new_packed_address | ( | BlendDataReader * | reader, |
const void * | old_address | ||
) |
Definition at line 5133 of file readfile.c.
References BlendDataReader::fd, and newpackedadr().
void BLO_read_glob_list | ( | BlendDataReader * | reader, |
ListBase * | list | ||
) |
Definition at line 5298 of file readfile.c.
References BlendDataReader::fd, and link_glob_list().
Referenced by scene_blend_read_data().
void BLO_read_int32_array | ( | BlendDataReader * | reader, |
int | array_size, | ||
int32_t ** | ptr_p | ||
) |
Definition at line 5177 of file readfile.c.
References BLI_endian_switch_int32_array(), BLO_read_data_address, and BLO_read_requires_endian_switch().
Referenced by blendRead(), curves_blend_read_data(), IDP_DirectLinkArray(), object_blend_read_data(), and read_ui_data().
Main* BLO_read_lib_get_main | ( | BlendLibReader * | reader | ) |
Definition at line 5313 of file readfile.c.
References BlendLibReader::main.
Referenced by BKE_pose_blend_read_lib(), object_blend_read_lib(), and workspace_blend_read_lib().
bool BLO_read_lib_is_undo | ( | BlendLibReader * | reader | ) |
Definition at line 5308 of file readfile.c.
References BlendLibReader::fd, FD_FLAGS_IS_MEMFILE, and FileData::flags.
Referenced by BKE_pose_blend_read_lib(), and ntreeBlendReadLib().
BlendFileReadReport* BLO_read_lib_reports | ( | BlendLibReader * | reader | ) |
Definition at line 5318 of file readfile.c.
References BlendLibReader::fd, and FileData::reports.
Referenced by object_blend_read_lib(), and scene_blend_read_lib().
void BLO_read_list | ( | BlendDataReader * | reader, |
struct ListBase * | list | ||
) |
Definition at line 5172 of file readfile.c.
References BLO_read_list_cb(), and NULL.
Referenced by action_blend_read_data(), armature_blend_read_data(), BKE_animdata_blend_read_data(), BKE_asset_metadata_read(), BKE_collection_blend_read_data(), BKE_constraint_blend_read_data(), BKE_fcurve_blend_read_data(), BKE_gpencil_blend_read_data(), BKE_gpencil_modifier_blend_read_data(), BKE_keyingsets_blend_read_data(), BKE_modifier_blend_read_data(), BKE_nla_blend_read_data(), BKE_particle_system_blend_read_data(), BKE_pose_blend_read_data(), BKE_ptcache_blend_read_data(), BKE_screen_area_map_blend_read_data(), BKE_shaderfx_blend_read_data(), BKE_view_layer_blend_read_data(), blend_data_read_nla_strips(), cache_file_blend_read_data(), camera_blend_read_data(), curve_blend_read_data(), direct_link_area(), direct_link_bones(), direct_link_layer_collections(), direct_link_moviePlaneTracks(), direct_link_movieTracks(), direct_link_nlastrips(), direct_link_panel_list(), direct_link_pointcache_cb(), direct_link_region(), IDP_DirectLinkGroup(), image_blend_read_data(), ipo_blend_read_data(), lattice_blend_read_data(), linestyle_blend_read_data(), link_recurs_seq(), mask_blend_read_data(), mesh_blend_read_data(), metaball_blend_read_data(), movieclip_blend_read_data(), ntreeBlendReadData(), object_blend_read_data(), palette_blend_read_data(), particle_settings_blend_read_data(), read_userdef(), scene_blend_read_data(), SEQ_modifier_blend_read_data(), seq_read_data_cb(), shapekey_blend_read_data(), text_blend_read_data(), window_manager_blend_read_data(), and workspace_blend_read_data().
void BLO_read_list_cb | ( | BlendDataReader * | reader, |
struct ListBase * | list, | ||
BlendReadListFn | callback | ||
) |
Updates all ->prev and ->next pointers of the list elements. Updates the list->first and list->last pointers. When not NULL, calls the callback on every element.
Definition at line 5148 of file readfile.c.
References BLI_listbase_is_empty(), BLO_read_data_address, callback, ListBase::first, ListBase::last, Link::next, NULL, blender::meshintersect::prev(), and Link::prev.
Referenced by BLO_read_list(), direct_link_id_common(), direct_link_id_override_property_cb(), and direct_link_pointcache().
void BLO_read_pointer_array | ( | BlendDataReader * | reader, |
void ** | ptr_p | ||
) |
Definition at line 5245 of file readfile.c.
References BLI_assert, convert_pointer_array_32_to_64(), convert_pointer_array_64_to_32(), BlendDataReader::fd, FileData::filesdna, MEM_allocN_len, MEM_freeN, MEM_malloc_arrayN, FileData::memsdna, newdataadr(), NULL, and SDNA::pointer_size.
Referenced by BKE_gpencil_blend_read_data(), curve_blend_read_data(), curves_blend_read_data(), direct_link_moviePlaneTracks(), IDP_DirectLinkArray(), mesh_blend_read_data(), metaball_blend_read_data(), object_blend_read_data(), pointcloud_blend_read_data(), and volume_blend_read_data().
bool BLO_read_requires_endian_switch | ( | BlendDataReader * | reader | ) |
Definition at line 5143 of file readfile.c.
References BlendDataReader::fd, FD_FLAGS_SWITCH_ENDIAN, and FileData::flags.
Referenced by blend_read_mdisps(), BLO_read_double_array(), BLO_read_float_array(), BLO_read_int32_array(), BLO_read_uint32_array(), convert_pointer_array_64_to_32(), curve_blend_read_data(), direct_link_lightcache_texture(), direct_link_pointcache_cb(), IDP_DirectLinkProperty(), ipo_blend_read_data(), mask_blend_read_data(), mesh_blend_read_data(), and shapekey_blend_read_data().
void BLO_read_uint32_array | ( | BlendDataReader * | reader, |
int | array_size, | ||
uint32_t ** | ptr_p | ||
) |
Definition at line 5185 of file readfile.c.
References BLI_endian_switch_uint32_array(), BLO_read_data_address, and BLO_read_requires_endian_switch().
Referenced by blendRead().
Definition at line 693 of file readfile.c.
References BLO_reportf_wrap(), Main::is_read_invalid, NULL, Main::prev, FileData::reports, and RPT_ERROR.
Referenced by BLO_read_invalidate_message().
void BLO_reportf_wrap | ( | BlendFileReadReport * | reports, |
eReportType | type, | ||
const char * | format, | ||
... | |||
) |
Definition at line 204 of file readfile.c.
References BKE_report(), BKE_report_type_str(), G, BlendFileReadReport::reports, and type.
Referenced by blo_readfile_invalidate(), direct_link_library(), expand_doit_library(), read_library_file_data(), and read_library_linked_id().
Definition at line 496 of file readfile.c.
References BKE_main_idmap_destroy(), BKE_main_new(), BLENDER_FILE_SUBVERSION, BLENDER_FILE_VERSION, BLI_addtail(), BLI_listbase_count(), BLI_listbase_is_empty(), Main::curlib, ListBase::first, GS, Main::has_forward_compatibility_issues, id, ID_LI, INDEX_ID_MAX, ListBase::last, lib, main(), MAIN_VERSION_FILE_OLDER_OR_EQUAL, MEM_freeN, MEM_malloc_arrayN, ID::name, NULL, set_listbasepointers(), split_libdata(), Main::subversionfile, and Main::versionfile.
Referenced by BLO_main_validate_libraries(), blo_read_file_internal(), BLO_read_from_memfile(), library_link_begin(), library_link_end(), and write_file_handle().
BlendThumbnail* BLO_thumbnail_from_file | ( | const char * | filepath | ) |
Does a very light reading of given .blend file to extract its stored thumbnail.
filepath | The path of the file to extract thumbnail from. |
Definition at line 1563 of file readfile.c.
References BLEN_THUMB_MEMSIZE, BLEN_THUMB_MEMSIZE_FILE, BLEN_THUMB_MEMSIZE_IS_VALID, BLI_assert, blo_filedata_free(), blo_filedata_from_file_minimal(), data, height, MEM_mallocN, NULL, read_file_thumbnail(), and width.
Referenced by imb_thumb_load_from_blendfile().
|
static |
Definition at line 1652 of file readfile.c.
References change_link_placeholder_to_real_ID_pointer_fd(), and LISTBASE_FOREACH.
Referenced by direct_link_library(), read_library_clear_weak_links(), and read_library_linked_ids().
|
static |
Definition at line 1638 of file readfile.c.
References OldNewMap::entries, GS, ID_LINK_PLACEHOLDER, FileData::libmap, OldNewMap::nentries, OldNew::newp, and OldNew::nr.
Referenced by change_link_placeholder_to_real_ID_pointer(), and expand_doit_library().
|
static |
|
static |
Definition at line 5214 of file readfile.c.
References BLI_endian_switch_uint64(), BLO_read_requires_endian_switch(), ptr, and src.
Referenced by BLO_read_pointer_array().
|
static |
Definition at line 2982 of file readfile.c.
References BKE_lib_libblock_session_uuid_ensure(), BKE_libblock_alloc_notest(), BKE_libblock_init_empty(), BKE_main_idmap_insert_id(), BLI_addtail(), BLI_strncpy(), Main::curlib, ID::icon_id, ID_FAKE_USERS, Main::id_map, id_sort_by_name(), ID::lib, LIB_TAG_MISSING, LIB_TAG_TEMP_MAIN, ID::name, NULL, ID::tag, ID::us, and which_libbase().
Referenced by link_named_part(), and read_library_linked_id().
|
static |
Definition at line 3021 of file readfile.c.
References ID_AC, ID_AR, ID_BR, ID_CA, ID_CF, ID_CU_LEGACY, ID_CV, ID_GD, ID_GR, ID_IM, ID_IP, ID_KE, ID_LA, ID_LI, ID_LP, ID_LS, ID_LT, ID_MA, ID_MB, ID_MC, ID_ME, ID_MSK, ID_NT, ID_OB, ID_PA, ID_PAL, ID_PC, ID_PT, ID_SCE, ID_SCR, ID_SIM, ID_SO, ID_SPK, ID_TE, ID_TXT, ID_VF, ID_VO, ID_WM, ID_WO, and ID_WS.
Referenced by OSLRenderServices::get_texture_info(), and read_libblock().
Definition at line 1044 of file readfile.c.
References B_ENDIAN, ELEM, ENDIAN_ORDER, FD_FLAGS_FILE_OK, FD_FLAGS_FILE_POINTSIZE_IS_4, FD_FLAGS_POINTSIZE_DIFFERS, FD_FLAGS_SWITCH_ENDIAN, FileData::file, FileData::fileversion, FileData::flags, L_ENDIAN, FileReader::read, SIZEOFBLENDERHEADER, and STREQLEN.
Referenced by blo_decode_and_check(), and blo_filedata_from_file_minimal().
|
static |
Definition at line 3108 of file readfile.c.
References BKE_idtype_get_info_from_id(), BKE_idtype_id_foreach_cache(), BKE_screen_blend_read_data(), IDTypeInfo::blend_read_data, blo_cache_storage_entry_restore_in_new(), FileData::cache_storage, direct_link_id_common(), direct_link_library(), BlendDataReader::fd, IDTypeInfo::foreach_cache, GS, id, ID_LI, ID_SCR, LIB_TAG_ID_LINK_PLACEHOLDER, main(), ID::name, and NULL.
Referenced by read_libblock().
|
static |
Definition at line 2221 of file readfile.c.
References ID::asset_data, IDTypeInfo::asset_type_info, BKE_asset_metadata_read(), BKE_idtype_get_info_from_id(), BKE_lib_libblock_session_uuid_ensure(), BLI_listbase_clear(), BLO_read_data_address, BLO_read_data_is_undo(), BLO_read_list_cb(), BLO_READ_SKIP_UNDO_OLD_MAIN, direct_link_id_embedded_id(), direct_link_id_override_property_cb(), direct_link_id_restore_recalc(), DRW_drawdatalist_from_id(), BlendDataReader::fd, id, ID_FAKE_USERS, ID_IS_LINKED, IDP_BlendDataRead, LIB_INDIRECT_WEAK_LINK, LIB_TAG_ID_LINK_PLACEHOLDER, LIB_TAG_TEMP_MAIN, ID::library_weak_reference, MAIN_ID_SESSION_UUID_UNSET, NULL, ID::override_library, IDOverrideLibrary::properties, ID::properties, and FileData::skip_flags.
Referenced by direct_link_id(), and direct_link_id_embedded_id().
|
static |
Definition at line 2133 of file readfile.c.
References BKE_collection_blend_read_data(), BKE_ntree_ptr_from_id(), BLO_read_data_address, direct_link_id_common(), GS, id, Collection::id, ID_SCE, Scene::master_collection, ID::name, ntreeBlendReadData(), ntreeFromID(), NULL, and scene.
Referenced by direct_link_id_common().
|
static |
Definition at line 2119 of file readfile.c.
References BLO_read_data_address, BLO_read_list_cb(), data, direct_link_id_override_property_operation_cb(), IDOverrideLibraryProperty::operations, IDOverrideLibraryProperty::rna_path, and IDOverrideLibraryProperty::tag.
Referenced by direct_link_id_common().
|
static |
Definition at line 2109 of file readfile.c.
References BLO_read_data_address, data, IDOverrideLibraryPropertyOperation::subitem_local_name, IDOverrideLibraryPropertyOperation::subitem_reference_name, and IDOverrideLibraryPropertyOperation::tag.
Referenced by direct_link_id_override_property_cb().
|
static |
Definition at line 2175 of file readfile.c.
References BLI_assert, direct_link_id_restore_recalc_exceptions(), ID_RECALC_ALL, ID_RECALC_COPY_ON_WRITE, NULL, ID::recalc, ID::recalc_up_to_undo_push, STEP_REDO, STEP_UNDO, and FileData::undo_direction.
Referenced by direct_link_id_common().
|
static |
Definition at line 2164 of file readfile.c.
References GS, ID_OB, ID_RECALC_GEOMETRY, and ID::name.
Referenced by direct_link_id_restore_recalc(), and read_libblock_undo_restore_identical().
|
static |
Definition at line 3862 of file readfile.c.
References BLO_read_data_address, wmKeyMapItem::flag, IDP_BlendDataRead, KMI_UPDATE, NULL, wmKeyMapItem::properties, and wmKeyMapItem::ptr.
Referenced by read_userdef().
Definition at line 2888 of file readfile.c.
References BKE_main_new(), BKE_packedfile_blend_read(), BLI_addtail(), BLI_path_cmp, BLI_path_normalize(), BLI_remlink(), BLI_strncpy(), BLO_reportf_wrap(), change_link_placeholder_to_real_ID_pointer(), Main::curlib, Library::filepath_abs, ListBase::first, id_us_ensure_real(), lib, main(), FileData::mainlist, MEM_freeN, Main::next, NULL, FileData::relabase, FileData::reports, RPT_WARNING, and TIP_.
Referenced by direct_link_id().
Definition at line 3663 of file readfile.c.
References BLI_strncpy(), blo_do_versions_250(), blo_do_versions_260(), blo_do_versions_270(), blo_do_versions_280(), blo_do_versions_290(), blo_do_versions_300(), blo_do_versions_cycles(), blo_do_versions_pre250(), CLOG_INFO, G, G_DEBUG, lib, LIKELY, LOG, main(), NULL, and FileData::relabase.
Referenced by blo_read_file_internal(), and read_libraries().
Definition at line 3724 of file readfile.c.
References CLOG_INFO, do_versions_after_linking_250(), do_versions_after_linking_260(), do_versions_after_linking_270(), do_versions_after_linking_280(), do_versions_after_linking_290(), do_versions_after_linking_300(), do_versions_after_linking_cycles(), LOG, and main().
Referenced by blo_read_file_internal(), and library_link_end().
|
static |
Definition at line 3652 of file readfile.c.
References blo_do_versions_userdef(), NULL, and BlendFileData::user.
Referenced by blo_read_file_internal().
Definition at line 4314 of file readfile.c.
References BHeadSort::bhead, BLI_assert, blo_bhead_id_name(), blo_find_main(), BLO_reportf_wrap(), change_link_placeholder_to_real_ID_pointer_fd(), BHead::code, Main::curlib, Library::filepath_abs, find_bhead(), find_previous_lib(), G, G_DEBUG, GS, id, ID_LINK_PLACEHOLDER, ID_SCR, ID_SCRN, id_sort_by_name(), FileData::id_tag_extra, is_yet_read(), lib, LIB_INDIRECT_WEAK_LINK, LIB_TAG_ID_LINK_PLACEHOLDER, LIB_TAG_INDIRECT, LIB_TAG_NEED_EXPAND, MEM_freeN, ID::name, NULL, BHeadSort::old, BHead::old, oldnewmap_lib_insert(), Library::parent, ID::prev, read_libblock(), read_struct(), FileData::relabase, FileData::reports, RPT_WARNING, ID::tag, TIP_, and which_libbase().
Referenced by library_link_end(), and read_libraries().
|
static |
Definition at line 4455 of file readfile.c.
References BKE_animdata_blend_read_expand(), BKE_animdata_from_id(), BLO_expand, expand_id_embedded_id(), id, IDP_BlendReadExpand(), NULL, ID::override_library, ID::properties, IDOverrideLibrary::reference, and IDOverrideLibrary::storage.
Referenced by BLO_expand_main(), expand_id_embedded_id(), and blender::ed::space_node::nodelink_batch_init().
|
static |
Definition at line 4437 of file readfile.c.
References BKE_collection_blend_read_expand(), expand_id(), GS, id, Collection::id, bNodeTree::id, ID_SCE, Scene::master_collection, ID::name, ntreeBlendReadExpand(), ntreeFromID(), NULL, and scene.
Referenced by expand_id().
|
static |
Definition at line 546 of file readfile.c.
References BLENDER_FILE_SUBVERSION, BLENDER_FILE_VERSION, FileGlobal::minsubversion, and FileGlobal::minversion.
Referenced by is_minversion_older_than_blender(), and read_file_version().
|
static |
Definition at line 1184 of file readfile.c.
References BLI_assert, FileData::datamap, DNA_sdna_current_get(), FileData::globmap, FileData::libmap, MEM_callocN, FileData::memsdna, NULL, oldnewmap_new(), and FileData::reports.
Referenced by blo_filedata_from_file_descriptor(), blo_filedata_from_memfile(), and blo_filedata_from_memory().
Definition at line 4222 of file readfile.c.
References BHeadSort::bhead, FileData::bheadmap, blo_bhead_first(), blo_bhead_next(), NULL, BHeadSort::old, BHead::old, sort_bhead_old_map(), FileData::tot_bheadmap, and verg_bheadsort().
Referenced by expand_doit_library().
|
static |
Definition at line 4255 of file readfile.c.
References BHeadSort::bhead, FileData::bhead_idname_hash, BLI_ghash_lookup(), BLI_strncpy(), blo_bhead_first(), blo_bhead_id_name(), blo_bhead_next(), BHead::code, ENDB, MAX_ID_NAME, NULL, and STREQ.
Referenced by find_bhead_from_idname(), and link_named_part().
Definition at line 4285 of file readfile.c.
References FileData::bhead_idname_hash, BLI_ghash_lookup(), find_bhead_from_code_name(), and GS.
Referenced by read_library_linked_id().
Definition at line 4206 of file readfile.c.
References BHeadSort::bhead, blo_bhead_prev(), BHead::code, FD_FLAGS_IS_MEMFILE, FileData::flags, ID_LI, and NULL.
Referenced by expand_doit_library().
Definition at line 2948 of file readfile.c.
References BLI_path_is_rel(), BLI_path_rel(), BLI_strncpy(), lib, LISTBASE_FOREACH, main(), and NULL.
Referenced by blo_read_file_internal(), and library_link_end().
Definition at line 796 of file readfile.c.
References bh4_from_bh8(), bh8_from_bh4(), BHeadN::bhead, FileData::bhead_list, BHEAD_USE_READ_ON_DEMAND, BLI_addtail(), BLI_assert, BHead4::code, BHead8::code, DATA, ENDB, FD_FLAGS_FILE_POINTSIZE_IS_4, FD_FLAGS_IS_MEMFILE, FD_FLAGS_POINTSIZE_DIFFERS, FD_FLAGS_SWITCH_ENDIAN, FileData::file, BHeadN::file_offset, FileData::flags, BHeadN::has_data, FileData::is_eof, BHeadN::is_memchunk_identical, BHead::len, MEM_freeN, MEM_mallocN, MIN2, BHeadN::next, NULL, FileReader::offset, BHeadN::prev, FileReader::read, FileReader::seek, switch_endian_bh4(), and switch_endian_bh8().
Referenced by blo_bhead_first(), and blo_bhead_next().
|
static |
Definition at line 4807 of file readfile.c.
References Freestyle::a, ID::flag, id, INDEX_ID_MAX, LIB_INDIRECT_WEAK_LINK, LIB_TAG_ID_LINK_PLACEHOLDER, LISTBASE_FOREACH, set_listbasepointers(), and ID::tag.
Referenced by read_libraries().
|
static |
Definition at line 1676 of file readfile.c.
References oldnewmap_insert(), FileData::packedmap, and pf.
Referenced by blo_make_packed_pointer_map().
|
static |
Check if minversion of the file is older than current Blender, return false if it is not. Should only be called after read_file_dna was successfuly executed.
Definition at line 1203 of file readfile.c.
References BKE_blender_version_blendfile_string_from_values(), BKE_reportf(), BLENDER_FILE_SUBVERSION, BLENDER_FILE_VERSION, BLI_assert, blo_bhead_first(), blo_bhead_next(), CLOG_WARN, file_global_minversion_hotfix(), FileData::filesdna, FileData::fileversion, GLOB, LOG, MEM_freeN, FileGlobal::minsubversion, FileGlobal::minversion, NULL, read_struct(), FileData::relabase, RPT_ERROR, FileGlobal::subversion, and TIP_.
Referenced by blo_decode_and_check().
Definition at line 4294 of file readfile.c.
References BHeadSort::bhead, BKE_main_idmap_create(), BKE_main_idmap_lookup_name(), BKE_main_idmap_main_get(), BLI_assert, BLI_findstring(), blo_bhead_id_name(), Main::curlib, GS, id, Main::id_map, MAIN_IDMAP_TYPE_NAME, NULL, and which_libbase().
Referenced by expand_doit_library(), and link_named_part().
Definition at line 3768 of file readfile.c.
References BKE_idtype_get_info_from_id(), IDTypeInfo::blend_read_lib, IDTypeInfo::blend_read_undo_preserve, BLI_assert, BLO_READ_SKIP_UNDO_OLD_MAIN, FD_FLAGS_IS_MEMFILE, FileData::flags, FOREACH_MAIN_ID_BEGIN, FOREACH_MAIN_ID_END, GS, id, ID_LI, ID_WM, lib_link_id(), lib_link_library(), LIB_TAG_NEED_LINK, LIB_TAG_UNDO_OLD_ID_REUSED, ID::name, NULL, ID::orig_id, FileData::skip_flags, and ID::tag.
Referenced by blo_read_file_internal(), library_link_end(), and read_libraries().
|
static |
Definition at line 2490 of file readfile.c.
References lib_link_seq_clipboard_cb(), SEQ_for_each_callback(), and seqbase_clipboard.
Referenced by blo_lib_link_restore().
|
static |
Definition at line 2089 of file readfile.c.
References BKE_animdata_blend_read_lib(), BKE_animdata_from_id(), BLI_assert, BLO_read_id_address, GS, IDOverrideLibrary::hierarchy_root, id, ID_WM, IDP_BlendReadLib(), ID::lib, lib_link_id_embedded_id(), ID::name, NULL, ID::override_library, ID::properties, IDOverrideLibrary::reference, and IDOverrideLibrary::storage.
Referenced by lib_link_all(), and lib_link_id_embedded_id().
|
static |
Definition at line 2070 of file readfile.c.
References BKE_collection_blend_read_lib(), GS, id, Collection::id, bNodeTree::id, ID_SCE, lib_link_id(), Scene::master_collection, ID::name, ntreeBlendReadLib(), ntreeFromID(), NULL, and scene.
Referenced by lib_link_id().
|
static |
Definition at line 2942 of file readfile.c.
Referenced by lib_link_all().
|
static |
Definition at line 2528 of file readfile.c.
References BKE_library_foreach_ID_link(), FOREACH_MAIN_ID_BEGIN, FOREACH_MAIN_ID_END, id, IDWALK_NOP, and lib_link_main_data_restore_cb().
Referenced by blo_lib_link_restore().
|
static |
Definition at line 2496 of file readfile.c.
References BLI_assert_unreachable, LibraryIDLinkCallbackData::cb_flag, COLLECTION_IS_MASTER, Collection::flag, GS, ID_GR, LibraryIDLinkCallbackData::id_pointer, IDWALK_CB_EMBEDDED, IDWALK_CB_USER_ONE, IDWALK_RET_NOP, NULL, restore_pointer_by_name(), LibraryIDLinkCallbackData::user_data, USER_IGNORE, and USER_REAL.
Referenced by lib_link_main_data_restore().
Definition at line 2373 of file readfile.c.
References BLI_listbase_count(), CLOG_WARN, Scene::flag, Scene::id, LISTBASE_FOREACH, LOG, ID::name, SCE_READFILE_LIBLINK_NEED_SETSCENE_CHECK, Main::scenes, and UNUSED_VARS.
Referenced by after_liblink_merged_bmain_process().
Definition at line 2478 of file readfile.c.
References Sequence::clip, lib_link_seq_clipboard_pt_restore(), Sequence::mask, Sequence::scene, Sequence::scene_camera, and Sequence::sound.
Referenced by lib_link_clipboard_restore().
|
static |
Definition at line 2470 of file readfile.c.
References BLI_assert, id, ID::newid, NULL, restore_pointer_by_name(), and USER_REAL.
Referenced by lib_link_seq_clipboard_cb().
|
static |
Definition at line 2543 of file readfile.c.
References blender::compositor::area(), bScreen::areabase, BKE_workspace_active_screen_get(), Scene::camera, View3D::camera, ListBase::first, LISTBASE_FOREACH, Base::local_view_bits, View3D::local_view_uuid, RegionView3D::localvd, View3D::localvd, MEM_freeN, Base::next, NULL, ViewLayer::object_bases, RGN_TYPE_WINDOW, scene, View3D::scenelock, SPACE_VIEW3D, and wmWindow::workspace_hook.
Referenced by blo_lib_link_restore().
|
static |
Definition at line 2537 of file readfile.c.
References XrSessionSettings::base_pose_object, restore_pointer_by_name(), wmXrData::session_settings, and USER_REAL.
Referenced by blo_lib_link_restore().
|
static |
Definition at line 2592 of file readfile.c.
References SpaceAction::action, SpaceAction::ads, SpaceGraph::ads, SpaceNla::ads, blender::compositor::area(), bScreen::areabase, BKE_workspace_layout_screen_get(), BLI_mempool_iternew(), BLI_mempool_iterstep(), BLI_remlink(), View3D::camera, SpaceClip::clip, blender::compositor::context, SpaceSpreadsheet::context_path, SpaceNode::edittree, FILE_TAG_REBUILD_MAIN_FILES, bDopeSheet::filter_grp, ListBase::first, SpaceAction_Runtime::flag, SpaceProperties::flag, SpaceGraph_Runtime::flag, SpaceNode::from, SpaceSeq::gpd, SpaceImage::gpd, TreeStoreElem::id, SpaceNode::id, SpaceImage::image, SpaceImage::iuser, ListBase::last, LISTBASE_FOREACH, MaskSpaceInfo::mask, SpaceImage::mask_info, SpaceClip::mask_info, MEM_freeN, MEM_SAFE_FREE, bNodeTreePath::next, bNodeTreePath::nodetree, SpaceNode::nodetree, ntree, ntreeFromID(), NULL, View3D::ob_center, SpreadsheetContextObject::object, Scopes::ok, MovieClipScopes::ok, SpaceFile::op, SpaceProperties::path, SpaceProperties::pinid, restore_pointer_by_name(), SpaceAction::runtime, SpaceGraph::runtime, SACTION_RUNTIME_FLAG_NEED_CHAN_SYNC, SB_PIN_CONTEXT, ImageUser::scene, SpaceImage::scopes, SpaceClip::scopes, SpaceScript::script, SCRIPT_SET_NULL, SpaceOutliner::search_tse, SIPO_RUNTIME_FLAG_NEED_CHAN_SYNC_COLOR, SO_TREESTORE_REBUILD, bDopeSheet::source, SPACE_ACTION, SPACE_CLIP, SPACE_FILE, SPACE_GRAPH, SPACE_IMAGE, SPACE_NLA, SPACE_NODE, SPACE_OUTLINER, SPACE_PROPERTIES, SPACE_SCRIPT, SPACE_SEQ, SPACE_SPREADSHEET, SPACE_TEXT, SPACE_VIEW3D, SPREADSHEET_CONTEXT_OBJECT, usdtokens::st(), SpaceOutliner::storeflag, SpaceFile::tags, Main::texts, SpaceNode::treepath, SpaceOutliner::treestore, TSE_IS_REAL_ID, USER_IGNORE, USER_REAL, Scopes::vecscope, Scopes::waveform_1, Scopes::waveform_2, and Scopes::waveform_3.
Referenced by blo_lib_link_restore().
|
static |
Definition at line 4590 of file readfile.c.
References BKE_main_blendfile_path(), BLI_assert, blo_find_main(), blo_split_main(), LIB_TAG_TEMP_MAIN, MEM_callocN, read_file_bhead_idname_map_create(), read_file_version(), and Main::versionfile.
Referenced by BLO_library_link_begin().
Definition at line 4682 of file readfile.c.
References add_main_to_main(), after_liblink_merged_bmain_process(), BKE_collections_after_lib_link(), BKE_lib_override_library_main_update(), BKE_lib_override_library_main_validate(), BKE_main_blendfile_path(), BKE_main_blendfile_path_from_global(), BKE_main_free(), BKE_main_id_refcount_recompute(), BKE_main_id_tag_all(), BKE_main_idmap_create(), BKE_main_is_empty(), BKE_main_new(), BLI_assert, BLI_path_rel(), BLI_strncpy(), BLO_expand_main(), blo_filedata_free(), blo_join_main(), BLO_main_expander(), blo_split_main(), Main::curlib, do_versions_after_linking(), expand_doit_library(), FD_FLAGS_SWITCH_ENDIAN, FILE_RELPATH, Library::filepath, Library::filepath_abs, fix_relpaths_library(), Main::id_map, Main::is_read_invalid, lib_link_all(), LIB_TAG_NEW, MAIN_IDMAP_TYPE_NAME, FileData::mainlist, MEM_freeN, Main::next, ntreeUpdateAllNew(), NULL, placeholders_ensure_valid(), read_libraries(), split_main_newid(), and Main::versionfile.
Referenced by BLO_library_link_end().
|
static |
Definition at line 224 of file readfile.c.
References lib.
Referenced by read_library_file_data(), and read_library_linked_id().
Definition at line 2033 of file readfile.c.
References BLI_listbase_is_empty(), ListBase::first, FileData::globmap, ListBase::last, newdataadr(), Link::next, NULL, oldnewmap_insert(), blender::meshintersect::prev(), and Link::prev.
Referenced by BLO_read_glob_list().
|
static |
Definition at line 3633 of file readfile.c.
References blo_read_get_new_globaldata_address(), BlendFileData::cur_view_layer, BlendFileData::curscene, BlendFileData::curscreen, newlibadr(), and NULL.
Referenced by blo_read_file_internal().
|
static |
Definition at line 4519 of file readfile.c.
References BHeadSort::bhead, BKE_idtype_idcode_is_linkable(), BKE_idtype_idcode_is_valid(), BLI_assert, BLO_LIBLINK_FORCE_INDIRECT, BLO_LIBLINK_USE_PLACEHOLDERS, CLOG_WARN, BHead::code, create_placeholder(), find_bhead_from_code_name(), id, id_sort_by_name(), FileData::id_tag_extra, is_yet_read(), LIB_INDIRECT_WEAK_LINK, LIB_TAG_EXTERN, LIB_TAG_INDIRECT, LIB_TAG_NEED_EXPAND, LOG, ID::name, NULL, BHead::old, oldnewmap_lib_insert(), read_libblock(), ID::tag, and which_libbase().
Referenced by BLO_library_link_named_part().
Definition at line 1600 of file readfile.c.
References FileData::datamap, and oldnewmap_lookup_and_inc().
Referenced by blendRead(), BLO_read_get_new_data_address(), BLO_read_pointer_array(), direct_link_area(), link_glob_list(), and speaker_blend_read_data().
Definition at line 1606 of file readfile.c.
References FileData::datamap, and oldnewmap_lookup_and_inc().
Referenced by BLO_read_get_new_data_address_no_us().
Definition at line 1627 of file readfile.c.
References lib, FileData::libmap, and oldnewmap_liblookup().
Referenced by blo_do_versions_newlibadr(), BLO_read_get_new_id_address(), and link_global().
Definition at line 1617 of file readfile.c.
References FileData::datamap, oldnewmap_lookup_and_inc(), and FileData::packedmap.
Referenced by blo_end_packed_pointer_map(), and BLO_read_get_new_packed_address().
Definition at line 402 of file readfile.c.
References DEFAULT_SIZE_EXP, OldNewMap::entries, OldNewMap::map, MEM_freeN, OldNewMap::nentries, OldNew::newp, OldNew::nr, NULL, and oldnewmap_init_data().
Referenced by blo_read_asset_data_block(), read_libblock(), and read_userdef().
Definition at line 308 of file readfile.c.
References OldNewMap::map, and MAP_CAPACITY.
Referenced by oldnewmap_increase_size(), and oldnewmap_init_data().
Definition at line 419 of file readfile.c.
References OldNewMap::entries, OldNewMap::map, and MEM_freeN.
Referenced by blo_filedata_free(), and read_library_file_data().
Definition at line 313 of file readfile.c.
References OldNewMap::capacity_exp, OldNewMap::entries, ENTRIES_CAPACITY, OldNewMap::map, MAP_CAPACITY, MEM_reallocN, OldNewMap::nentries, oldnewmap_clear_map(), oldnewmap_insert_index_in_map(), and OldNew::oldp.
Referenced by oldnewmap_insert().
Definition at line 326 of file readfile.c.
References OldNewMap::capacity_exp, OldNewMap::entries, ENTRIES_CAPACITY, OldNewMap::map, MAP_CAPACITY, MEM_malloc_arrayN, and oldnewmap_clear_map().
Referenced by oldnewmap_clear(), and oldnewmap_new().
|
static |
Definition at line 346 of file readfile.c.
References ENTRIES_CAPACITY, OldNewMap::nentries, OldNew::newp, OldNew::nr, NULL, oldnewmap_increase_size(), oldnewmap_insert_or_replace(), OldNew::oldp, and UNLIKELY.
Referenced by blo_do_versions_oldnewmap_insert(), BLO_read_data_globmap_add(), insert_packedmap(), link_glob_list(), oldnewmap_lib_insert(), and read_data_into_datamap().
Definition at line 267 of file readfile.c.
References ITER_SLOTS, OldNewMap::map, and ptr.
Referenced by oldnewmap_increase_size().
Definition at line 277 of file readfile.c.
References OldNewMap::entries, ITER_SLOTS, OldNewMap::map, OldNewMap::nentries, and OldNew::oldp.
Referenced by oldnewmap_insert().
|
static |
Definition at line 363 of file readfile.c.
References FileData::libmap, and oldnewmap_insert().
Referenced by blo_add_library_pointer_map(), expand_doit_library(), link_named_part(), read_libblock(), read_libblock_undo_restore(), and read_libblock_undo_restore_linked().
Definition at line 386 of file readfile.c.
References id, lib, ID::lib, NULL, and oldnewmap_lookup_and_inc().
Referenced by newlibadr().
|
static |
Definition at line 373 of file readfile.c.
References OldNew::newp, OldNew::nr, NULL, and oldnewmap_lookup_entry().
Referenced by blo_read_get_new_globaldata_address(), newdataadr(), newdataadr_no_us(), newpackedadr(), and oldnewmap_liblookup().
Definition at line 293 of file readfile.c.
References OldNewMap::entries, ITER_SLOTS, NULL, and OldNew::oldp.
Referenced by oldnewmap_lookup_and_inc().
Definition at line 337 of file readfile.c.
References DEFAULT_SIZE_EXP, MEM_mallocN, and oldnewmap_init_data().
Referenced by blo_make_packed_pointer_map(), filedata_new(), and read_library_file_data().
Definition at line 2026 of file readfile.c.
References BLI_assert, FD_FLAGS_IS_MEMFILE, FileData::flags, BHead::len, NULL, and UNUSED_VARS_NDEBUG.
Referenced by read_libblock_undo_restore().
Definition at line 3009 of file readfile.c.
References BKE_object_materials_test(), IDNameLib_Map::bmain, LIB_TAG_MISSING, LISTBASE_FOREACH, NULL, Main::objects, and ID::tag.
Referenced by blo_read_file_internal(), and library_link_end().
|
static |
Definition at line 3152 of file readfile.c.
References blo_bhead_next(), BHead::code, DATA, data, FileData::datamap, FileData::filesdna, BHead::old, oldnewmap_insert(), read_struct(), BHead::SDNAnr, SDNA::structs, and SDNA::types.
Referenced by blo_read_asset_data_block(), read_libblock(), and read_userdef().
Definition at line 601 of file readfile.c.
References FileData::bhead_idname_hash, BKE_idtype_idcode_is_linkable(), BLI_assert, BLI_ghash_insert(), BLI_ghash_str_new_ex(), blo_bhead_first(), blo_bhead_id_name(), blo_bhead_is_id_valid_type(), blo_bhead_next(), BHead::code, ENDB, and NULL.
Referenced by library_link_begin(), and read_library_file_data().
Definition at line 1087 of file readfile.c.
References BLI_assert, BLI_STATIC_ASSERT, blo_bhead_first(), blo_bhead_next(), blo_do_versions_dna(), BHead::code, FileData::compflags, DNA1, DNA_elem_offset(), DNA_reconstruct_info_create(), DNA_sdna_from_data(), DNA_struct_get_compareflags(), ENDB, FD_FLAGS_SWITCH_ENDIAN, FileData::filesdna, FileData::fileversion, FileData::flags, GLOB, FileData::id_asset_data_offset, FileData::id_name_offset, BHead::len, FileData::memsdna, FileData::reconstruct_info, and FileGlobal::subvstr.
Referenced by blo_decode_and_check().
|
static |
Definition at line 1138 of file readfile.c.
References BLEN_THUMB_MEMSIZE_FILE, BLEN_THUMB_MEMSIZE_IS_VALID, BLI_endian_switch_int32(), blo_bhead_first(), blo_bhead_next(), BHead::code, data, FD_FLAGS_SWITCH_ENDIAN, FileData::flags, height, BHead::len, NULL, REND, TEST, and width.
Referenced by blo_read_file_internal(), and BLO_thumbnail_from_file().
Definition at line 557 of file readfile.c.
References blo_bhead_first(), blo_bhead_next(), BHead::code, ENDB, file_global_minversion_hotfix(), GLOB, main(), MEM_freeN, FileGlobal::minsubversion, FileGlobal::minversion, read_struct(), and FileGlobal::subversion.
Referenced by blo_find_main(), library_link_begin(), and read_library_file_data().
|
static |
Definition at line 3581 of file readfile.c.
References BKE_main_blendfile_path(), BLENDER_FILE_SUBVERSION, BLENDER_FILE_VERSION, BLI_strncpy(), blo_bhead_next(), Main::build_commit_timestamp, FileGlobal::build_commit_timestamp, Main::build_hash, FileGlobal::build_hash, BlendFileData::cur_view_layer, FileGlobal::cur_view_layer, BlendFileData::curscene, FileGlobal::curscene, BlendFileData::curscreen, FileGlobal::curscreen, BlendFileData::fileflags, FileData::fileflags, FileGlobal::fileflags, BlendFileData::filepath, FileGlobal::filepath, FileData::fileversion, G, G_FILE_RECOVER_READ, BlendFileData::globalf, FileData::globalf, FileGlobal::globalf, Main::has_forward_compatibility_issues, BlendFileData::main, MAIN_VERSION_FILE_OLDER_OR_EQUAL, MEM_freeN, FileGlobal::minsubversion, Main::minsubversionfile, FileGlobal::minversion, Main::minversionfile, read_struct(), FileData::relabase, STRNCPY, FileGlobal::subversion, and Main::subversionfile.
Referenced by blo_read_file_internal().
|
static |
Definition at line 3434 of file readfile.c.
References BKE_id_free(), BKE_main_idmap_insert_id(), BLI_addtail(), blo_bhead_next(), CLOG_WARN, BHead::code, FileData::datamap, dataname(), direct_link_id(), FD_FLAGS_IS_MEMFILE, ID::flag, FileData::flags, GS, id, ID_LINK_PLACEHOLDER, LIB_INDIRECT_WEAK_LINK, LIB_TAG_EXTERN, LIB_TAG_ID_LINK_PLACEHOLDER, LIB_TAG_INDIRECT, LIB_TAG_NEED_LINK, LIB_TAG_NEW, LOG, main(), MEM_freeN, ID::name, NULL, BHead::old, oldnewmap_clear(), oldnewmap_lib_insert(), read_data_into_datamap(), read_libblock_undo_restore(), read_libblock_undo_restore_at_old_address(), read_struct(), and which_libbase().
Referenced by blo_read_file_internal(), expand_doit_library(), link_named_part(), and read_library_linked_id().
Definition at line 3185 of file readfile.c.
References BHEADN_FROM_BHEAD, blo_bhead_next(), BHead::code, DATA, and BHead::len.
Referenced by read_libblock_undo_restore().
|
static |
Definition at line 3347 of file readfile.c.
References BKE_main_idmap_lookup_uuid(), BLI_assert, BLO_READ_SKIP_UNDO_OLD_MAIN, CLOG_INFO, BHead::code, ELEM, GS, id, ID_LI, ID_LINK_PLACEHOLDER, ID_SCR, ID_WM, ID_WS, LIB_TAG_UNDO_OLD_ID_REUSED, LOG_UNDO, main(), ID::name, NULL, BHead::old, FileData::old_idmap, oldnewmap_lib_insert(), peek_struct_undo(), read_libblock_is_identical(), read_libblock_undo_restore_identical(), read_libblock_undo_restore_library(), read_libblock_undo_restore_linked(), ID::session_uuid, and FileData::skip_flags.
Referenced by read_libblock().
|
static |
Definition at line 3315 of file readfile.c.
References BKE_lib_id_swap_full(), BLI_addtail(), BLI_assert, BLI_remlink(), BLO_READ_SKIP_UNDO_OLD_MAIN, ListBase::first, GS, id, main(), ID::name, NULL, FileData::old_mainlist, ID::orig_id, FileData::skip_flags, and which_libbase().
Referenced by read_libblock().
|
static |
Definition at line 3280 of file readfile.c.
References BLI_addtail(), BLI_assert, BLI_remlink(), BLO_READ_SKIP_UNDO_OLD_MAIN, direct_link_id_restore_recalc_exceptions(), ListBase::first, GS, ID_FAKE_USERS, ID_OB, ID::lib, LIB_TAG_EXTRAUSER, main(), Object::mode, ID::name, ID::newid, NULL, OB_MODE_EDIT, FileData::old_mainlist, ID::orig_id, ID::recalc, ID::recalc_after_undo_push, FileData::skip_flags, ID::tag, ID::us, and which_libbase().
Referenced by read_libblock_undo_restore().
Definition at line 3207 of file readfile.c.
References BLI_addtail(), BLI_remlink(), BLI_remlink_safe(), CLOG_INFO, Main::curlib, ListBase::first, id, Library::id, Main::libraries, LOG_UNDO, main(), FileData::mainlist, ID::name, Main::next, FileData::old_mainlist, and STREQ.
Referenced by read_libblock_undo_restore().
|
static |
Definition at line 3249 of file readfile.c.
References BKE_libblock_find_name(), CLOG_INFO, GS, id, LOG_UNDO, main(), ID::name, NULL, BHead::old, and oldnewmap_lib_insert().
Referenced by read_libblock_undo_restore().
Definition at line 5025 of file readfile.c.
References add_main_to_main(), BKE_main_free(), BKE_main_idmap_create(), BKE_main_new(), BLO_expand_main(), blo_filedata_free(), BLO_main_expander(), CLOG_INFO, do_versions(), expand_doit_library(), ListBase::first, has_linked_ids_to_read(), lib_link_all(), LOG, MAIN_IDMAP_TYPE_NAME, Main::next, NULL, read_library_clear_weak_links(), read_library_file_data(), read_library_linked_ids(), and split_main_newid().
Referenced by blo_read_file_internal(), and library_link_end().
|
static |
Definition at line 4925 of file readfile.c.
References Freestyle::a, BLI_freelinkN(), change_link_placeholder_to_real_ID_pointer(), CLOG_INFO, ListBase::first, ID::flag, id, INDEX_ID_MAX, LIB_INDIRECT_WEAK_LINK, LIB_TAG_ID_LINK_PLACEHOLDER, LOG, ID::name, ID::next, NULL, set_listbasepointers(), and ID::tag.
Referenced by read_libraries().
|
static |
Definition at line 4947 of file readfile.c.
References BLI_strncpy(), blo_filedata_from_file(), blo_filedata_from_memory(), BLO_reportf_wrap(), BlendFileReadReport::count, Main::curlib, Library::filedata, Library::filepath, Library::filepath_abs, FileData::fileversion, Library::id, LIB_TAG_MISSING, FileData::libmap, library_parent_filepath(), FileData::mainlist, BlendFileReadReport::missing_libraries, NULL, oldnewmap_free(), oldnewmap_new(), Library::packedfile, pf, read_file_bhead_idname_map_create(), read_file_version(), FileData::relabase, FileData::reports, RPT_INFO, Main::subversionfile, Library::subversionfile, ID::tag, TIP_, Main::versionfile, and Library::versionfile.
Referenced by read_libraries().
|
static |
Definition at line 4823 of file readfile.c.
References BHeadSort::bhead, BKE_idtype_idcode_is_linkable(), BKE_idtype_idcode_to_name(), BLO_reportf_wrap(), BlendFileReadReport::count, create_placeholder(), Main::curlib, Library::filepath_abs, find_bhead_from_idname(), GS, id, is_valid, LIB_INDIRECT_WEAK_LINK, LIB_TAG_EXTERN, LIB_TAG_ID_LINK_PLACEHOLDER, LIB_TAG_NEED_EXPAND, library_parent_filepath(), BlendFileReadReport::missing_linked_id, ID::name, NULL, read_libblock(), FileData::reports, RPT_ERROR, RPT_INFO, ID::tag, and TIP_.
Referenced by read_library_linked_ids().
|
static |
Definition at line 4870 of file readfile.c.
References Freestyle::a, BKE_main_idmap_remove_id(), BLI_addtail(), BLI_freelistN(), BLI_ghash_clear(), BLI_ghash_ensure_p(), BLI_ghash_free(), BLI_ghash_str_new(), BLI_remlink(), change_link_placeholder_to_real_ID_pointer(), ListBase::first, ID::flag, id, Main::id_map, INDEX_ID_MAX, LIB_INDIRECT_WEAK_LINK, LIB_TAG_ID_LINK_PLACEHOLDER, ID::name, ID::next, NULL, read_library_linked_id(), set_listbasepointers(), and ID::tag.
Referenced by read_libraries().
Definition at line 1956 of file readfile.c.
References BHEADN_FROM_BHEAD, blo_bhead_read_data(), blo_bhead_read_full(), FileData::compflags, DNA_struct_reconstruct(), FD_FLAGS_FILE_OK, FD_FLAGS_SWITCH_ENDIAN, FileData::filesdna, FileData::flags, BHead::len, MEM_freeN, MEM_mallocN, BHead::nr, NULL, FileData::reconstruct_info, SDNA_CMP_NOT_EQUAL, SDNA_CMP_REMOVED, BHead::SDNAnr, switch_endian_structs(), and UNLIKELY.
Referenced by BLO_library_read_struct(), expand_doit_library(), is_minversion_older_than_blender(), read_data_into_datamap(), read_file_version(), read_global(), read_libblock(), and read_userdef().
|
static |
Definition at line 3870 of file readfile.c.
References UserDef::addons, UserDef::app_template, UserDef::asset_libraries, UserDef::autoexec_paths, BLO_read_data_address, BLO_read_list(), FileData::datamap, direct_link_keymapitem(), UserDef::edit_studio_light, ListBase::first, IDP_BlendDataRead, UserDef_Runtime::is_dirty, KEYMAP_UPDATE, ListBase::last, LISTBASE_FOREACH, BlendFileData::main, NULL, oldnewmap_clear(), bUserMenuItem_Op::prop, read_data_into_datamap(), read_struct(), UserDef::runtime, Main::subversionfile, UserDef::subversionfile, UserDef::themes, UserDef::uifonts, UserDef::uistyles, BlendFileData::user, UserDef::user_keyconfig_prefs, UserDef::user_keymaps, USER_MENU_TYPE_OPERATOR, UserDef::user_menus, Main::versionfile, and UserDef::versionfile.
Referenced by blo_read_file_internal().
|
static |
Only for undo files, or to restore a screen after reading without UI...
user |
|
id_map | lookup table, use when performing many lookups. this could be made an optional argument (falling back to a full lookup), however at the moment it's always available. |
Definition at line 2452 of file readfile.c.
References BKE_main_idmap_lookup_id(), BKE_main_idmap_main_get(), NULL, and restore_pointer_user().
Referenced by blo_lib_link_restore(), lib_link_main_data_restore_cb(), lib_link_seq_clipboard_pt_restore(), lib_link_wm_xr_data_restore(), and lib_link_workspace_layout_restore().
|
static |
Definition at line 2404 of file readfile.c.
References BLI_assert, id, id_us_ensure_real(), ID::lib, ID::name, STREQ, UNUSED_VARS_NDEBUG, and USER_REAL.
Referenced by restore_pointer_by_name().
Definition at line 4181 of file readfile.c.
References BHeadSort::bhead, FileData::bheadmap, blo_bhead_first(), blo_bhead_next(), MEM_malloc_arrayN, BHeadSort::old, BHead::old, FileData::tot_bheadmap, and verg_bheadsort().
Referenced by find_bhead().
|
static |
Definition at line 475 of file readfile.c.
References BLI_addtail(), BLI_remlink(), CLOG_ERROR, Main::curlib, ListBase::first, GS, id, ID::lib, LOG, ID::name, Library::temp_index, and which_libbase().
Referenced by blo_split_main().
Definition at line 4658 of file readfile.c.
References BLI_addtail(), BLI_listbase_clear(), BLI_remlink(), Main::curlib, Main::filepath, id, INDEX_ID_MAX, LIB_TAG_NEW, LISTBASE_FOREACH_MUTABLE, set_listbasepointers(), STRNCPY, Main::subversionfile, ID::tag, and Main::versionfile.
Referenced by library_link_end(), and read_libraries().
Definition at line 728 of file readfile.c.
References BLI_endian_switch_int32(), BHead4::code, ENDB, BHead4::len, BHead4::nr, and BHead4::SDNAnr.
Referenced by get_bhead().
Definition at line 742 of file readfile.c.
References BLI_endian_switch_int32(), BHead8::code, ENDB, BHead8::len, BHead8::nr, and BHead8::SDNAnr.
Referenced by get_bhead().
Definition at line 1940 of file readfile.c.
References data, DNA_struct_switch_endian(), BHead::nr, BHead::SDNAnr, SDNA::structs, SDNA_Struct::type, and SDNA::types_size.
Referenced by read_struct().
Definition at line 4168 of file readfile.c.
References BHeadSort::old, v1, v2, and x2.
Referenced by find_bhead(), and sort_bhead_old_map().
|
static |
Definition at line 4433 of file readfile.c.
Referenced by BLO_expand_id(), and BLO_main_expander().
|
static |
Definition at line 175 of file readfile.c.
Referenced by blo_find_main(), do_versions(), do_versions_after_linking(), is_minversion_older_than_blender(), lib_link_scenes_check_set(), link_named_part(), read_libblock(), read_libraries(), read_library_clear_weak_links(), and split_libdata().
|
static |
Definition at line 176 of file readfile.c.
Referenced by blo_read_file_internal(), read_libblock_undo_restore(), read_libblock_undo_restore_library(), and read_libblock_undo_restore_linked().