|
Blender V4.5
|
#include "fmt/core.h"#include <algorithm>#include <cerrno>#include <climits>#include <cstdarg>#include <cstddef>#include <cstdlib>#include <cstring>#include <ctime>#include <fcntl.h>#include <unistd.h>#include <fmt/format.h>#include "CLG_log.h"#include "DNA_asset_types.h"#include "DNA_collection_types.h"#include "DNA_constraint_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_userdef_types.h"#include "MEM_alloc_string_storage.hh"#include "MEM_guardedalloc.h"#include "BLI_endian_defines.h"#include "BLI_endian_switch.h"#include "BLI_fileops.h"#include "BLI_ghash.h"#include "BLI_map.hh"#include "BLI_memarena.h"#include "BLI_memory_utils.hh"#include "BLI_set.hh"#include "BLI_string.h"#include "BLI_string_ref.hh"#include "BLI_string_utf8.h"#include "BLI_string_utils.hh"#include "BLI_threads.h"#include "BLI_time.h"#include "BLI_utildefines.h"#include "BLT_translation.hh"#include "BKE_anim_data.hh"#include "BKE_animsys.h"#include "BKE_asset.hh"#include "BKE_blender_version.h"#include "BKE_collection.hh"#include "BKE_global.hh"#include "BKE_idprop.hh"#include "BKE_idtype.hh"#include "BKE_layer.hh"#include "BKE_lib_id.hh"#include "BKE_lib_override.hh"#include "BKE_lib_query.hh"#include "BKE_lib_remap.hh"#include "BKE_library.hh"#include "BKE_main.hh"#include "BKE_main_idmap.hh"#include "BKE_main_invariants.hh"#include "BKE_main_namemap.hh"#include "BKE_material.hh"#include "BKE_mesh.hh"#include "BKE_modifier.hh"#include "BKE_nla.hh"#include "BKE_node.hh"#include "BKE_node_tree_update.hh"#include "BKE_object.hh"#include "BKE_packedFile.hh"#include "BKE_preferences.h"#include "BKE_report.hh"#include "BKE_scene.hh"#include "BKE_screen.hh"#include "BKE_undo_system.hh"#include "BKE_workspace.hh"#include "DRW_engine.hh"#include "DEG_depsgraph.hh"#include "BLO_blend_validate.hh"#include "BLO_read_write.hh"#include "BLO_readfile.hh"#include "BLO_undofile.hh"#include "SEQ_iterator.hh"#include "SEQ_modifier.hh"#include "SEQ_sequencer.hh"#include "SEQ_utils.hh"#include "readfile.hh"#include "versioning_common.hh"Go to the source code of this file.
Classes | |
| struct | BHeadN |
| struct | NewAddress |
| struct | OldNewMap |
| struct | BlendDataReader |
| struct | BlendLibReader |
| struct | BLOCacheStorage |
| struct | BLOCacheStorageValue |
| struct | BHeadSort |
| struct | BlendExpander |
Macros | |
| #define | DNA_DEPRECATED_ALLOW |
| #define | U (*((const UserDef *)&U)) |
| #define | USE_BHEAD_READ_ON_DEMAND |
| #define | BHEADN_FROM_BHEAD(bh) |
| #define | BHEAD_USE_READ_ON_DEMAND(bhead) |
Functions | |
Library Reading | |
| static void | read_libraries (FileData *basefd, ListBase *mainlist) |
| static void | read_libraries_free_placeholders (FileData *basefd, ListBase *mainlist) |
| static int | has_linked_ids_to_read (Main *mainvar) |
| static void | read_library_linked_id (FileData *basefd, FileData *fd, Main *mainvar, ID *id, ID **r_id) |
| static void | read_library_linked_ids (FileData *basefd, FileData *fd, ListBase *mainlist, Main *mainvar) |
| static void | read_library_clear_weak_links (FileData *basefd, ListBase *mainlist, Main *mainvar) |
| static FileData * | read_library_file_data (FileData *basefd, ListBase *mainlist, Main *mainl, Main *mainptr) |
| static void * | blo_verify_data_address (FileData *fd, void *new_address, const void *, const size_t expected_size) |
| void * | BLO_read_get_new_data_address (BlendDataReader *reader, const void *old_address) |
| void * | BLO_read_get_new_data_address_no_us (BlendDataReader *reader, const void *old_address, const size_t expected_size) |
| void * | BLO_read_struct_array_with_size (BlendDataReader *reader, const void *old_address, const size_t expected_size) |
| void * | BLO_read_struct_by_name_array (BlendDataReader *reader, const char *struct_name, const int64_t items_num, const void *old_address) |
| ID * | BLO_read_get_new_id_address (BlendLibReader *reader, ID *self_id, const bool is_linked_only, ID *id) |
| ID * | BLO_read_get_new_id_address_from_session_uid (BlendLibReader *reader, const uint session_uid) |
| int | BLO_read_fileversion_get (BlendDataReader *reader) |
| bool | BLO_read_requires_endian_switch (BlendDataReader *reader) |
| int | BLO_read_struct_member_offset (const BlendDataReader *reader, const char *stype, const char *vartype, const char *name) |
| void | BLO_read_struct_list_with_size (BlendDataReader *reader, const size_t expected_elem_size, ListBase *list) |
| static bool | blo_read_verify_type_size (FileData *fd, NewAddress &entry, const void *old_address, blender::FunctionRef< size_t(const void *data)> type_size_fn) |
| void | BLO_read_struct_list_with_type_size (BlendDataReader *reader, const size_t base_size, ListBase *list, blender::FunctionRef< size_t(const void *data)> type_size_fn) |
| void * | blo_read_struct_with_type_size_impl (BlendDataReader *reader, const void *old_address, const size_t base_size, blender::FunctionRef< size_t(const void *data)> type_size_fn) |
| void | BLO_read_char_array (BlendDataReader *reader, const int64_t array_size, char **ptr_p) |
| void | BLO_read_uint8_array (BlendDataReader *reader, const int64_t array_size, uint8_t **ptr_p) |
| void | BLO_read_int8_array (BlendDataReader *reader, const int64_t array_size, int8_t **ptr_p) |
| void | BLO_read_int16_array (BlendDataReader *reader, const int64_t array_size, int16_t **ptr_p) |
| void | BLO_read_int32_array (BlendDataReader *reader, const int64_t array_size, int32_t **ptr_p) |
| void | BLO_read_uint32_array (BlendDataReader *reader, const int64_t array_size, uint32_t **ptr_p) |
| void | BLO_read_float_array (BlendDataReader *reader, const int64_t array_size, float **ptr_p) |
| void | BLO_read_float3_array (BlendDataReader *reader, const int64_t array_size, float **ptr_p) |
| void | BLO_read_double_array (BlendDataReader *reader, const int64_t array_size, double **ptr_p) |
| void | BLO_read_string (BlendDataReader *reader, char **ptr_p) |
| void | BLO_read_string (BlendDataReader *reader, char *const *ptr_p) |
| static void | convert_pointer_array_64_to_32 (BlendDataReader *reader, const int64_t array_size, const uint64_t *src, uint32_t *dst) |
| static void | convert_pointer_array_32_to_64 (BlendDataReader *, const int64_t array_size, const uint32_t *src, uint64_t *dst) |
| void | BLO_read_pointer_array (BlendDataReader *reader, const int64_t array_size, void **ptr_p) |
| blender::ImplicitSharingInfoAndData | blo_read_shared_impl (BlendDataReader *reader, const void **ptr_p, const blender::FunctionRef< const blender::ImplicitSharingInfo *()> read_fn) |
| bool | BLO_read_data_is_undo (BlendDataReader *reader) |
| void | BLO_read_data_globmap_add (BlendDataReader *reader, void *oldaddr, void *newaddr) |
| void | BLO_read_glob_list (BlendDataReader *reader, ListBase *list) |
| BlendFileReadReport * | BLO_read_data_reports (BlendDataReader *reader) |
| void | BLO_read_data_invalidate (BlendDataReader *reader, const char *message) |
| bool | BLO_read_lib_is_undo (BlendLibReader *reader) |
| Main * | BLO_read_lib_get_main (BlendLibReader *reader) |
| BlendFileReadReport * | BLO_read_lib_reports (BlendLibReader *reader) |
DNA Struct Loading | |
| static void * | read_struct (FileData *fd, BHead *bh, const char *blockname, const int id_type_index) |
| static void * | read_struct_and_validate_size (FileData *fd, BHead *bh, const char *blockname, const int id_type_index, const int64_t min_size) |
| static void | switch_endian_structs (const SDNA *filesdna, BHead *bhead) |
| static const char * | get_alloc_name (FileData *fd, BHead *bh, const char *blockname, const int id_type_index=INDEX_ID_NULL) |
| static ID * | read_id_struct (FileData *fd, BHead *bh, const char *blockname, const int id_type_index) |
| static const void * | peek_struct_undo (FileData *fd, BHead *bhead) |
| static void | link_glob_list (FileData *fd, ListBase *lb) |
Library Linking | |
Also used for append. | |
| static BHead * | find_bhead_from_code_name (FileData *fd, const short idcode, const char *name) |
| static int | verg_bheadsort (const void *v1, const void *v2) |
| static void | sort_bhead_old_map (FileData *fd) |
| static BHead * | find_previous_lib (FileData *fd, BHead *bhead) |
| static Library * | read_library_struct (FileData *fd, BHead *bheadlib) |
| static BHead * | find_bhead (FileData *fd, void *old) |
| static BHead * | find_bhead_from_idname (FileData *fd, const char *idname) |
| static void | read_libraries_report_invalid_id_names (FileData *fd, ReportList *reports, const bool has_forward_compatibility_issues, const char *filepath) |
Blend Loader Reporting Wrapper | |
| void | BLO_reportf_wrap (BlendFileReadReport *reports, const eReportType type, const char *formatformat,...) |
| static const char * | library_parent_filepath (Library *lib) |
OldNewMap API | |
| static OldNewMap * | oldnewmap_new () |
| static bool | oldnewmap_insert (OldNewMap *onm, const void *oldaddr, void *newaddr, const int nr) |
| static void | oldnewmap_lib_insert (FileData *fd, const void *oldaddr, ID *newaddr, const int id_code) |
| void | blo_do_versions_oldnewmap_insert (OldNewMap *onm, const void *oldaddr, void *newaddr, const int nr) |
| static void * | oldnewmap_lookup_and_inc (OldNewMap *onm, const void *addr, const bool increase_users) |
| static void * | oldnewmap_liblookup (OldNewMap *onm, const void *addr, const bool is_linked_only) |
| static void | oldnewmap_clear (OldNewMap *onm) |
| static void | oldnewmap_free (OldNewMap *onm) |
Helper Functions | |
| static void | add_main_to_main (Main *mainvar, Main *from) |
| void | blo_join_main (ListBase *mainlist) |
| static void | split_libdata (ListBase *lb_src, Main **lib_main_array, const uint lib_main_array_len) |
| void | blo_split_main (ListBase *mainlist, Main *main) |
| static void | read_file_version (FileData *fd, Main *main) |
| static bool | blo_bhead_is_id (const BHead *bhead) |
| static bool | blo_bhead_is_id_valid_type (const BHead *bhead) |
| static void | read_file_bhead_idname_map_create (FileData *fd) |
| static Main * | blo_find_main (FileData *fd, const char *filepath, const char *relabase) |
| void | blo_readfile_invalidate (FileData *fd, Main *bmain, const char *message) |
| static Main * | filedata_main (FileData *fd) |
File Parsing | |
| static BHeadN * | get_bhead (FileData *fd) |
| BHead * | blo_bhead_first (FileData *fd) |
| BHead * | blo_bhead_prev (FileData *, BHead *thisblock) |
| BHead * | blo_bhead_next (FileData *fd, BHead *thisblock) |
| static bool | blo_bhead_read_data (FileData *fd, BHead *thisblock, void *buf) |
| static BHead * | blo_bhead_read_full (FileData *fd, BHead *thisblock) |
| template<typename T> | |
| static const T * | blo_bhead_data_at (const BHead *bhead, const int offset) |
| static const char * | blo_bhead_string_at (const BHead *bhead, const int offset, const size_t maxsize) |
| const char * | blo_bhead_id_name (FileData *fd, const BHead *bhead) |
| AssetMetaData * | blo_bhead_id_asset_data_address (const FileData *fd, const BHead *bhead) |
| static void | read_blender_header (FileData *fd) |
| static bool | read_file_dna (FileData *fd, const char **r_error_message) |
| static int * | read_file_thumbnail (FileData *fd) |
| static void | long_id_names_ensure_unique_id_names (Main *bmain) |
| static void | long_id_names_process_action_slots_identifiers (Main *bmain) |
File Data API | |
| static FileData * | filedata_new (BlendFileReadReport *reports) |
| static bool | is_minversion_older_than_blender (FileData *fd, ReportList *reports) |
| static FileData * | blo_decode_and_check (FileData *fd, ReportList *reports) |
| static FileData * | blo_filedata_from_file_descriptor (const char *filepath, BlendFileReadReport *reports, const int filedes) |
| static FileData * | blo_filedata_from_file_open (const char *filepath, BlendFileReadReport *reports) |
| FileData * | blo_filedata_from_file (const char *filepath, BlendFileReadReport *reports) |
| static FileData * | blo_filedata_from_file_minimal (const char *filepath) |
| FileData * | blo_filedata_from_memory (const void *mem, const int memsize, BlendFileReadReport *reports) |
| FileData * | blo_filedata_from_memfile (MemFile *memfile, const BlendFileReadParams *params, BlendFileReadReport *reports) |
| void | blo_filedata_free (FileData *fd) |
Read Thumbnail from Blend File | |
| BlendThumbnail * | BLO_thumbnail_from_file (const char *filepath) |
| short | BLO_version_from_file (const char *filepath) |
Old/New Pointer Map | |
| static void * | newdataadr (FileData *fd, const void *adr) |
| static void * | newdataadr_no_us (FileData *fd, const void *adr) |
| static NewAddress * | newdataadr_entry (FileData *fd, const void *adr) |
| void * | blo_read_get_new_globaldata_address (FileData *fd, const void *adr) |
| static void * | newlibadr (FileData *fd, ID *, const bool is_linked_only, const void *adr) |
| void * | blo_do_versions_newlibadr (FileData *fd, ID *self_id, const bool is_linked_only, const void *adr) |
| static void | change_link_placeholder_to_real_ID_pointer_fd (FileData *fd, const void *old, void *newp) |
| static void | change_ID_pointer_to_real_ID_pointer_fd (FileData *fd, const void *old, void *newp) |
| static FileData * | change_ID_link_filedata_get (Main *bmain, FileData *basefd) |
| static void | change_link_placeholder_to_real_ID_pointer (ListBase *mainlist, FileData *basefd, void *old, void *newp) |
| static void | change_ID_pointer_to_real_ID_pointer (ListBase *mainlist, FileData *basefd, void *old, void *newp) |
| void | blo_make_old_idmap_from_main (FileData *fd, Main *bmain) |
| static void | blo_cache_storage_entry_register (ID *id, const IDCacheKey *key, void **cache_p, uint, void *cache_storage_v) |
| static void | blo_cache_storage_entry_restore_in_new (ID *id, const IDCacheKey *key, void **cache_p, const uint flags, void *cache_storage_v) |
| static void | blo_cache_storage_entry_clear_in_old (ID *, const IDCacheKey *key, void **cache_p, const uint, void *cache_storage_v) |
| void | blo_cache_storage_init (FileData *fd, Main *bmain) |
| void | blo_cache_storage_old_bmain_clear (FileData *fd, Main *bmain_old) |
| void | blo_cache_storage_end (FileData *fd) |
Read ID | |
| static void | after_liblink_id_process (BlendLibReader *reader, ID *id) |
| static void | after_liblink_id_embedded_id_process (BlendLibReader *reader, ID *id) |
| static void | direct_link_id_override_property (BlendDataReader *reader, IDOverrideLibraryProperty *op) |
| static void | direct_link_id_common (BlendDataReader *reader, Library *current_library, ID *id, ID *id_old, int id_tag, ID_Readfile_Data::Tags id_read_tags) |
| static void | direct_link_id_embedded_id (BlendDataReader *reader, Library *current_library, ID *id, ID *id_old) |
| static int | direct_link_id_restore_recalc_exceptions (const ID *id_current) |
| static int | direct_link_id_restore_recalc (const FileData *fd, const ID *id_target, const ID *id_current, const bool is_identical) |
| static void | readfile_id_runtime_data_ensure (ID &id) |
| ID_Readfile_Data::Tags | BLO_readfile_id_runtime_tags (ID &id) |
| ID_Readfile_Data::Tags & | BLO_readfile_id_runtime_tags_for_write (ID &id) |
| void | BLO_readfile_id_runtime_data_free (ID &id) |
| void | BLO_readfile_id_runtime_data_free_all (Main &bmain) |
Read ID: Shape Keys | |
| void | blo_do_versions_key_uidgen (Key *key) |
Read ID: Scene | |
| static void | lib_link_scenes_check_set (Main *bmain) |
Read ID: Library | |
| static bool | library_filepath_is_valid (const Library *lib) |
| static void | direct_link_library (FileData *fd, Library *lib, Main *main) |
| static void | fix_relpaths_library (const char *basepath, Main *main) |
Read Library Data Block | |
| static ID * | create_placeholder (Main *mainvar, const short idcode, const char *idname, const int tag, const bool was_liboverride) |
| static void | placeholders_ensure_valid (Main *bmain) |
| static bool | direct_link_id (FileData *fd, Main *main, const int tag, const ID_Readfile_Data::Tags id_read_tags, ID *id, ID *id_old) |
| static BHead * | read_data_into_datamap (FileData *fd, BHead *bhead, const char *allocname, const int id_type_index) |
| static bool | read_libblock_is_identical (FileData *fd, BHead *bhead) |
| static void | read_undo_reuse_noundo_local_ids (FileData *fd) |
| static void | read_undo_move_libmain_data (FileData *fd, Main *new_main, Main *old_main, Main *libmain, BHead *bhead) |
| static bool | read_libblock_undo_restore_library (FileData *fd, Main *new_main, const ID *id, ID *id_old, BHead *bhead) |
| static ID * | library_id_is_yet_read (FileData *fd, Main *mainvar, BHead *bhead) |
| static bool | read_libblock_undo_restore_linked (FileData *fd, Main *libmain, const ID *id, ID **r_id_old, BHead *bhead) |
| static void | read_libblock_undo_restore_identical (FileData *fd, Main *main, const ID *, ID *id_old, BHead *bhead, const int id_tag) |
| static void | read_libblock_undo_restore_at_old_address (FileData *fd, Main *main, ID *id, ID *id_old) |
| static bool | read_libblock_undo_restore (FileData *fd, Main *main, BHead *bhead, const int id_tag, ID **r_id_old) |
| static BHead * | read_libblock (FileData *fd, Main *main, BHead *bhead, int id_tag, ID_Readfile_Data::Tags id_read_tags, const bool placeholder_set_indirect_extern, ID **r_id) |
Read Asset Data | |
| BHead * | blo_read_asset_data_block (FileData *fd, BHead *bhead, AssetMetaData **r_asset_data) |
Read Global Data | |
| static BHead * | read_global (BlendFileData *bfd, FileData *fd, BHead *bhead) |
| static void | link_global (FileData *fd, BlendFileData *bfd) |
Versioning | |
| static void | do_versions_userdef (FileData *, BlendFileData *bfd) |
| static void | do_versions (FileData *fd, Library *lib, Main *main) |
| static void | do_versions_after_linking (FileData *fd, Main *main) |
Read Library Data Block (all) | |
| static int | lib_link_cb (LibraryIDLinkCallbackData *cb_data) |
| static void | lib_link_all (FileData *fd, Main *bmain) |
| static void | after_liblink_merged_bmain_process (Main *bmain, BlendFileReadReport *reports) |
Read User Preferences | |
| static void | direct_link_keymapitem (BlendDataReader *reader, wmKeyMapItem *kmi) |
| static size_t | user_menu_item_struct_size (const int type) |
| static BHead * | read_userdef (BlendFileData *bfd, FileData *fd, BHead *bhead) |
Read File (Internal) | |
| static int | read_undo_remap_noundo_data_cb (LibraryIDLinkCallbackData *cb_data) |
| static void | read_undo_remap_noundo_data (FileData *fd) |
| static void | blo_read_file_checks (Main *bmain) |
| BlendFileData * | blo_read_file_internal (FileData *fd, const char *filepath) |
Library Linking (expand pointers) | |
| static void | expand_doit_library (void *fdhandle, Main *mainvar, void *old) |
| static int | expand_cb (LibraryIDLinkCallbackData *cb_data) |
| void | BLO_expand_main (void *fdhandle, Main *mainvar, BLOExpandDoitCallback callback) |
Library Linking (helper functions) | |
| static ID * | link_named_part (Main *mainl, FileData *fd, const short idcode, const char *name, const int flag) |
| ID * | BLO_library_link_named_part (Main *mainl, BlendHandle **bh, const short idcode, const char *name, const LibraryLink_Params *params) |
| static Main * | library_link_begin (Main *mainvar, FileData *fd, const char *filepath, const int id_tag_extra) |
| void | BLO_library_link_params_init (LibraryLink_Params *params, Main *bmain, const int flag, const int id_tag_extra) |
| void | BLO_library_link_params_init_with_context (LibraryLink_Params *params, Main *bmain, const int flag, const int id_tag_extra, Scene *scene, ViewLayer *view_layer, const View3D *v3d) |
| Main * | BLO_library_link_begin (BlendHandle **bh, const char *filepath, const LibraryLink_Params *params) |
| static void | split_main_newid (Main *mainptr, Main *main_newid) |
| static void | library_link_end (Main *mainl, FileData **fd, const int flag, ReportList *reports) |
| void | BLO_library_link_end (Main *mainl, BlendHandle **bh, const LibraryLink_Params *params, ReportList *reports) |
| void * | BLO_library_read_struct (FileData *fd, BHead *bh, const char *blockname) |
Variables | |
| static CLG_LogRef | LOG = {"blo.readfile"} |
| static CLG_LogRef | LOG_UNDO = {"blo.readfile.undo"} |
| #define BHEAD_USE_READ_ON_DEMAND | ( | bhead | ) |
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 217 of file readfile.cc.
Referenced by blo_filedata_free(), and get_bhead().
| #define BHEADN_FROM_BHEAD | ( | bh | ) |
Definition at line 211 of file readfile.cc.
Referenced by blo_bhead_next(), blo_bhead_prev(), blo_bhead_read_data(), blo_bhead_read_full(), read_libblock_is_identical(), and read_struct().
| #define DNA_DEPRECATED_ALLOW |
Definition at line 34 of file readfile.cc.
| #define U (*((const UserDef *)&U)) |
Definition at line 120 of file readfile.cc.
| #define USE_BHEAD_READ_ON_DEMAND |
Definition at line 179 of file readfile.cc.
Definition at line 350 of file readfile.cc.
References add_main_to_main(), BKE_main_lists_get(), BLI_movelisttolist(), and Main::is_read_invalid.
Referenced by add_main_to_main(), blo_join_main(), library_link_end(), and read_libraries().
|
static |
Definition at line 2152 of file readfile.cc.
References after_liblink_id_embedded_id_process(), after_liblink_id_process(), CLOG_WARN, GS, bNodeTree::id, Collection::id, ID_SCE, LOG, Scene::master_collection, ID::name, blender::bke::node_tree_from_id(), bNodeTree::owner_id, and Collection::owner_id.
Referenced by after_liblink_id_embedded_id_process(), and after_liblink_id_process().
|
static |
Definition at line 2196 of file readfile.cc.
References after_liblink_id_embedded_id_process(), after_liblink_id_process(), BKE_idtype_get_info_from_id(), IDTypeInfo::blend_read_after_liblink, BLI_assert, GS, ID_WM, ID::name, and ID::properties.
Referenced by after_liblink_id_embedded_id_process(), after_liblink_id_process(), and lib_link_all().
|
static |
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 3727 of file readfile.cc.
References after_liblink_merged_bmain_process(), BKE_main_collections_parent_relations_rebuild(), BKE_main_namemap_validate_and_fix(), BKE_report(), BLI_assert, BLO_main_validate_embedded_flag(), BLO_main_validate_embedded_liboverrides(), BLO_main_validate_shapekeys(), lib_link_scenes_check_set(), Main::next, Main::prev, reports, and RPT_ERROR.
Referenced by after_liblink_merged_bmain_process(), blo_read_file_internal(), and library_link_end().
Return a pointer to data with type T in the bhead, with guard against corrupt files with too short a bhead.
Definition at line 835 of file readfile.cc.
References blo_bhead_data_at(), BHead::len, POINTER_OFFSET, and T.
Referenced by blo_bhead_data_at(), blo_bhead_id_asset_data_address(), and blo_bhead_string_at().
Definition at line 732 of file readfile.cc.
References BHeadN::bhead, FileData::bhead_list, blo_bhead_first(), ListBase::first, and get_bhead().
Referenced by blo_bhead_first(), BLO_blendhandle_get_datablock_info(), BLO_blendhandle_get_datablock_names(), BLO_blendhandle_get_linkable_groups(), BLO_blendhandle_get_preview_for_id(), blo_cache_storage_old_bmain_clear(), blo_read_file_internal(), find_bhead(), 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 869 of file readfile.cc.
References BLI_assert, blo_bhead_data_at(), blo_bhead_id_asset_data_address(), blo_bhead_is_id_valid_type(), and FileData::id_asset_data_offset.
Referenced by blo_bhead_id_asset_data_address(), blo_bhead_prev(), BLO_blendhandle_get_datablock_info(), and BLO_blendhandle_get_datablock_names().
Warning! Caller's responsibility to ensure given bhead is an ID one!
Will return nullptr if the name is not valid (e.g. because it has no null-char terminator, if it was saved in a version of Blender with higher MAX_ID_NAME value).
Definition at line 855 of file readfile.cc.
References blo_bhead_id_name(), blo_bhead_string_at(), FD_FLAGS_HAS_INVALID_ID_NAMES, FileData::flags, id_name(), FileData::id_name_offset, and MAX_ID_NAME.
Referenced by blo_bhead_id_name(), blo_bhead_prev(), BLO_blendhandle_get_datablock_info(), BLO_blendhandle_get_datablock_names(), BLO_blendhandle_get_preview_for_id(), expand_doit_library(), library_id_is_yet_read(), and read_file_bhead_idname_map_create().
|
static |
Definition at line 499 of file readfile.cc.
References blo_bhead_is_id(), and BHead::code.
Referenced by blo_bhead_is_id(), and blo_bhead_is_id_valid_type().
|
static |
Definition at line 506 of file readfile.cc.
References BKE_idtype_idcode_is_valid(), blo_bhead_is_id(), blo_bhead_is_id_valid_type(), and BHead::code.
Referenced by blo_bhead_id_asset_data_address(), blo_bhead_is_id_valid_type(), blo_read_asset_data_block(), blo_read_file_internal(), expand_doit_library(), link_named_part(), and read_file_bhead_idname_map_create().
Definition at line 760 of file readfile.cc.
References BHeadN::bhead, BHEADN_FROM_BHEAD, blo_bhead_next(), get_bhead(), and BHeadN::next.
Referenced by blo_bhead_next(), BLO_blendhandle_get_datablock_info(), BLO_blendhandle_get_datablock_names(), BLO_blendhandle_get_linkable_groups(), BLO_blendhandle_get_preview_for_id(), blo_blendhandle_read_preview_rects(), blo_cache_storage_old_bmain_clear(), blo_read_file_internal(), find_bhead(), 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 752 of file readfile.cc.
References BHEADN_FROM_BHEAD, blo_bhead_prev(), and BHeadN::prev.
Referenced by blo_bhead_prev(), blo_bhead_prev(), BLO_blendhandle_get_datablock_info(), and find_previous_lib().
Definition at line 787 of file readfile.cc.
References BHeadN::bhead, BHEADN_FROM_BHEAD, BLI_assert, blo_bhead_read_data(), 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_data(), blo_bhead_read_full(), and read_struct().
Definition at line 814 of file readfile.cc.
References BHeadN::bhead, BHEADN_FROM_BHEAD, blo_bhead_read_data(), blo_bhead_read_full(), BHeadN::file_offset, BHeadN::has_data, BHeadN::is_memchunk_identical, BHead::len, MEM_freeN(), and MEM_mallocN().
Referenced by blo_bhead_read_full(), and read_struct().
|
static |
Return a pointer to a string in the bhead, with guard against corrupt files.
Definition at line 844 of file readfile.cc.
References blo_bhead_data_at(), blo_bhead_string_at(), BHead::len, and str.
Referenced by blo_bhead_id_name(), and blo_bhead_string_at().
| void blo_cache_storage_end | ( | FileData * | fd | ) |
Definition at line 1830 of file readfile.cc.
References BLI_ghash_free(), BLI_memarena_free(), blo_cache_storage_end(), BLOCacheStorage::cache_map, FileData::cache_storage, MEM_freeN(), and BLOCacheStorage::memarena.
Referenced by blo_cache_storage_end(), blo_cache_storage_old_bmain_clear(), and blo_filedata_free().
|
static |
Clear as needed a cache data entry from old ID, when reading some undo memfile.
Definition at line 1743 of file readfile.cc.
References BLI_assert, BLI_ghash_lookup(), blo_cache_storage_entry_clear_in_old(), BLOCacheStorage::cache_map, BLOCacheStorageValue::cache_v, and BLOCacheStorageValue::new_usage_count.
Referenced by blo_cache_storage_entry_clear_in_old(), and blo_cache_storage_old_bmain_clear().
|
static |
Register a cache data entry to be preserved when reading some undo memfile.
Definition at line 1688 of file readfile.cc.
References BLI_assert, BLI_ghash_haskey(), BLI_ghash_insert(), BLI_memarena_alloc(), blo_cache_storage_entry_register(), BLOCacheStorage::cache_map, BLOCacheStorageValue::cache_v, IDCacheKey::id_session_uid, BLOCacheStorage::memarena, BLOCacheStorageValue::new_usage_count, ID::session_uid, and UNUSED_VARS_NDEBUG.
Referenced by blo_cache_storage_entry_register(), and blo_cache_storage_init().
|
static |
Restore a cache data entry from old ID into new one, when reading some undo memfile.
Definition at line 1708 of file readfile.cc.
References BLI_ghash_lookup(), blo_cache_storage_entry_restore_in_new(), BLOCacheStorage::cache_map, BLOCacheStorageValue::cache_v, ID_RECALC_SOURCE, IDTYPE_CACHE_CB_FLAGS_PERSISTENT, BLOCacheStorageValue::new_usage_count, and ID::recalc.
Referenced by blo_cache_storage_entry_restore_in_new(), and direct_link_id().
Definition at line 1767 of file readfile.cc.
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(), blo_cache_storage_init(), 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(), and BLOCacheStorage::memarena.
Referenced by blo_cache_storage_init(), blo_cache_storage_init(), and BLO_read_from_memfile().
Definition at line 1803 of file readfile.cc.
References BKE_idtype_get_info_from_id(), BKE_idtype_id_foreach_cache(), blo_cache_storage_entry_clear_in_old(), blo_cache_storage_old_bmain_clear(), 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, and ID_IS_LINKED.
Referenced by blo_cache_storage_old_bmain_clear(), blo_cache_storage_old_bmain_clear(), and BLO_read_from_memfile().
|
static |
Definition at line 1249 of file readfile.cc.
References BKE_reportf(), BKE_reports_print_test(), blo_decode_and_check(), blo_filedata_free(), CLOG_WARN, ENDIAN_ORDER, FD_FLAGS_FILE_FUTURE, FD_FLAGS_FILE_OK, FD_FLAGS_SWITCH_ENDIAN, FileData::flags, is_minversion_older_than_blender(), L_ENDIAN, LOG, read_blender_header(), read_file_dna(), FileData::relabase, reports, RPT_ERROR, and RPT_WARNING.
Referenced by blo_decode_and_check(), blo_filedata_from_file(), blo_filedata_from_memfile(), and blo_filedata_from_memory().
| void blo_do_versions_key_uidgen | ( | Key * | key | ) |
Definition at line 2529 of file readfile.cc.
References blo_do_versions_key_uidgen(), Key::block, LISTBASE_FOREACH, and Key::uidgen.
Referenced by blo_bhead_prev(), blo_do_versions_260(), and blo_do_versions_key_uidgen().
| void * blo_do_versions_newlibadr | ( | FileData * | fd, |
| ID * | self_id, | ||
| const bool | is_linked_only, | ||
| const void * | adr ) |
Only library data.
Definition at line 1593 of file readfile.cc.
References blo_do_versions_newlibadr(), and newlibadr().
Referenced by blo_bhead_prev(), blo_do_versions_250(), blo_do_versions_260(), blo_do_versions_newlibadr(), blo_do_versions_pre250(), and ntree_version_245().
| void blo_do_versions_oldnewmap_insert | ( | OldNewMap * | onm, |
| const void * | oldaddr, | ||
| void * | newaddr, | ||
| const int | nr ) |
Definition at line 291 of file readfile.cc.
References blo_do_versions_oldnewmap_insert(), and oldnewmap_insert().
Referenced by blo_bhead_prev(), blo_do_versions_oldnewmap_insert(), and blo_do_versions_pre250().
| void BLO_expand_main | ( | void * | fdhandle, |
| Main * | mainvar, | ||
| BLOExpandDoitCallback | callback ) |
Loop over all ID data in Main to mark relations. Set ID_Readfile_Data::Tags.needs_expanding to mark expanding. Flags get cleared after expanding.
| fdhandle | usually file-data, or own handle. May be nullptr. |
| mainvar | the Main database to expand. |
| calback | Called for each ID block it finds. |
Definition at line 4722 of file readfile.cc.
References BKE_library_foreach_ID_link(), BLO_expand_main(), BLO_readfile_id_runtime_tags(), BLO_readfile_id_runtime_tags_for_write(), expand_cb(), FD_FLAGS_IS_MEMFILE, FileData::flags, FOREACH_MAIN_ID_BEGIN, FOREACH_MAIN_ID_END, IDWALK_DO_DEPRECATED_POINTERS, IDWALK_NO_ORIG_POINTERS_ACCESS, IDWALK_NOP, IDWALK_READONLY, and ID_Readfile_Data::Tags::needs_expanding.
Referenced by BLO_expand_main(), library_link_end(), and read_libraries().
| void blo_filedata_free | ( | FileData * | fd | ) |
Definition at line 1460 of file readfile.cc.
References FileData::bhead_list, BHEAD_USE_READ_ON_DEMAND, FileData::bheadmap, BKE_main_idmap_destroy(), BLI_assert, BLI_freelistN(), blo_cache_storage_end(), blo_filedata_free(), FileReader::close, FileData::compflags, FileData::datamap, DNA_reconstruct_info_free(), DNA_sdna_free(), FileData::file, FileData::filesdna, FileData::globmap, FileData::libmap, LISTBASE_FOREACH_MUTABLE, MEM_freeN(), FileData::new_idmap_uid, FileData::old_idmap_uid, oldnewmap_free(), FileData::reconstruct_info, and FileReader::seek.
Referenced by BLO_blendhandle_close(), blo_cache_storage_old_bmain_clear(), blo_decode_and_check(), blo_filedata_free(), blo_filedata_from_file_minimal(), BLO_library_link_end(), blo_read_file_internal(), BLO_read_from_file(), BLO_read_from_memfile(), BLO_read_from_memory(), BLO_thumbnail_from_file(), BLO_version_from_file(), and library_link_end().
| FileData * blo_filedata_from_file | ( | const char * | filepath, |
| 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 1381 of file readfile.cc.
References blo_decode_and_check(), blo_filedata_from_file(), blo_filedata_from_file_open(), FileData::relabase, reports, and STRNCPY().
Referenced by BLO_blendhandle_from_file(), blo_filedata_from_file(), blo_read_file_internal(), BLO_read_from_file(), and read_library_file_data().
|
static |
Definition at line 1300 of file readfile.cc.
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(), blo_filedata_from_file_descriptor(), FileReader::close, FileData::file, filedata_new(), FileReader::read, reports, RPT_, RPT_WARNING, and FileReader::seek.
Referenced by blo_filedata_from_file_descriptor(), and 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 1397 of file readfile.cc.
References blo_filedata_free(), blo_filedata_from_file_minimal(), blo_filedata_from_file_open(), FD_FLAGS_FILE_OK, FileData::flags, and read_blender_header().
Referenced by blo_filedata_from_file_minimal(), BLO_thumbnail_from_file(), and BLO_version_from_file().
|
static |
Definition at line 1366 of file readfile.cc.
References BKE_reportf(), BLI_open(), blo_filedata_from_file_descriptor(), blo_filedata_from_file_open(), O_BINARY, reports, RPT_, and RPT_WARNING.
Referenced by blo_filedata_from_file(), blo_filedata_from_file_minimal(), and blo_filedata_from_file_open().
| FileData * blo_filedata_from_memfile | ( | MemFile * | memfile, |
| const BlendFileReadParams * | params, | ||
| BlendFileReadReport * | reports ) |
Definition at line 1443 of file readfile.cc.
References BKE_report(), blo_decode_and_check(), blo_filedata_from_memfile(), BLO_memfile_new_filereader(), FD_FLAGS_IS_MEMFILE, FileData::file, filedata_new(), FileData::flags, reports, RPT_WARNING, BlendFileReadParams::undo_direction, and FileData::undo_direction.
Referenced by blo_filedata_from_memfile(), blo_read_file_internal(), and BLO_read_from_memfile().
| FileData * blo_filedata_from_memory | ( | const void * | mem, |
| const int | memsize, | ||
| BlendFileReadReport * | reports ) |
Definition at line 1411 of file readfile.cc.
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(), blo_filedata_from_memory(), FileReader::close, FileData::file, filedata_new(), MIN_SIZEOFBLENDERHEADER, reports, RPT_, and RPT_WARNING.
Referenced by BLO_blendhandle_from_memory(), blo_filedata_from_memory(), blo_read_file_internal(), BLO_read_from_memory(), and read_library_file_data().
Definition at line 543 of file readfile.cc.
References BKE_id_new(), BKE_main_new(), BLI_addtail(), BLI_path_abs(), BLI_path_basename(), BLI_path_cmp, BLI_path_normalize(), blo_find_main(), CLOG_INFO, Main::curlib, FILE_MAX, Library::filepath, Main::filepath, ListBase::first, G, G_DEBUG, Library::id, ID_FAKE_USERS, id_us_ensure_real(), LISTBASE_FOREACH, LOG, FileData::mainlist, read_file_version(), Library::runtime, STRNCPY(), and ID::us.
Referenced by blo_find_main(), expand_doit_library(), and library_link_begin().
| void blo_join_main | ( | ListBase * | mainlist | ) |
Definition at line 364 of file readfile.cc.
References add_main_to_main(), BKE_main_free(), BKE_main_idmap_destroy(), BKE_main_namemap_clear(), BLI_assert, BLI_remlink(), blo_join_main(), Main::curlib, ListBase::first, Main::id_map, Main::is_asset_edit_file, LIBRARY_IS_ASSET_EDIT_FILE, Main::next, Main::prev, and Library::runtime.
Referenced by blo_join_main(), BLO_library_link_end(), BLO_main_validate_libraries(), blo_read_file_internal(), BLO_read_from_memfile(), and library_link_end().
| Main * BLO_library_link_begin | ( | BlendHandle ** | bh, |
| const char * | filepath, | ||
| const 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 4895 of file readfile.cc.
References BLO_library_link_begin(), LibraryLink_Params::bmain, LibraryLink_Params::id_tag_extra, and library_link_begin().
Referenced by BKE_blendfile_link(), BLO_library_link_begin(), and BLO_library_temp_load_id().
| void BLO_library_link_end | ( | Main * | mainl, |
| BlendHandle ** | bh, | ||
| const LibraryLink_Params * | params, | ||
| ReportList * | reports ) |
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 5052 of file readfile.cc.
References blo_filedata_free(), blo_join_main(), BLO_library_link_end(), LibraryLink_Params::bmain, LibraryLink_Params::flag, Main::is_read_invalid, Main::libraries, library_link_end(), LISTBASE_FOREACH, FileData::mainlist, MEM_freeN(), and reports.
Referenced by BKE_blendfile_link(), BLO_library_link_end(), and BLO_library_temp_load_id().
| ID * BLO_library_link_named_part | ( | Main * | mainl, |
| BlendHandle ** | bh, | ||
| short | idcode, | ||
| const char * | name, | ||
| const 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 4813 of file readfile.cc.
References BLO_library_link_named_part(), LibraryLink_Params::flag, Main::is_read_invalid, and link_named_part().
Referenced by BKE_blendfile_link(), BLO_library_link_named_part(), and BLO_library_temp_load_id().
| void BLO_library_link_params_init | ( | LibraryLink_Params * | params, |
| Main * | bmain, | ||
| const int | flag, | ||
| const int | id_tag_extra ) |
Definition at line 4867 of file readfile.cc.
References BLO_library_link_params_init(), LibraryLink_Params::bmain, LibraryLink_Params::flag, and LibraryLink_Params::id_tag_extra.
Referenced by BKE_copybuffer_read(), BLO_library_link_params_init(), BLO_library_link_params_init_with_context(), BLO_library_temp_load_id(), and bpy_lib_exit().
| void BLO_library_link_params_init_with_context | ( | LibraryLink_Params * | params, |
| Main * | bmain, | ||
| const int | flag, | ||
| const int | id_tag_extra, | ||
| Scene * | scene, | ||
| ViewLayer * | view_layer, | ||
| const View3D * | v3d ) |
Definition at line 4878 of file readfile.cc.
References BLO_library_link_params_init(), BLO_library_link_params_init_with_context(), and LibraryLink_Params::context.
Referenced by BKE_copybuffer_paste(), BLO_library_link_params_init_with_context(), wm_file_link_append_datablock_ex(), wm_id_linked_relocate_exec(), WM_lib_reload(), wm_lib_relocate_exec_do(), and wm_link_append_exec().
Definition at line 5089 of file readfile.cc.
References BLO_library_read_struct(), INDEX_ID_NULL, and read_struct().
Referenced by BLO_blendhandle_get_preview_for_id(), blo_blendhandle_read_preview_rects(), and BLO_library_read_struct().
Definition at line 1669 of file readfile.cc.
References BKE_main_idmap_create(), BKE_main_idmap_destroy(), blo_make_old_idmap_from_main(), MAIN_IDMAP_TYPE_UID, and FileData::old_idmap_uid.
Referenced by blo_make_old_idmap_from_main(), blo_make_old_idmap_from_main(), and BLO_read_from_memfile().
| BHead * blo_read_asset_data_block | ( | FileData * | fd, |
| BHead * | bhead, | ||
| AssetMetaData ** | r_asset_data ) |
Definition at line 3365 of file readfile.cc.
References BKE_asset_metadata_read(), BLI_assert, blo_bhead_is_id_valid_type(), blo_read_asset_data_block(), BLO_read_struct, FileData::datamap, INDEX_ID_NULL, oldnewmap_clear(), and read_data_into_datamap().
Referenced by BLO_blendhandle_get_datablock_info(), blo_read_asset_data_block(), and blo_read_asset_data_block().
| void BLO_read_char_array | ( | BlendDataReader * | reader, |
| const int64_t | array_size, | ||
| char ** | ptr_p ) |
Definition at line 5710 of file readfile.cc.
References BLO_read_char_array(), and BLO_read_struct_array_with_size().
Referenced by BLO_read_char_array(), console_blend_read_data(), IDP_DirectLinkString(), and object_blend_read_data().
| void BLO_read_data_globmap_add | ( | BlendDataReader * | reader, |
| void * | oldaddr, | ||
| void * | newaddr ) |
Definition at line 5922 of file readfile.cc.
References BLO_read_data_globmap_add(), BlendDataReader::fd, FileData::globmap, and oldnewmap_insert().
Referenced by BLO_read_data_globmap_add(), and window_manager_blend_read_data().
| void BLO_read_data_invalidate | ( | BlendDataReader * | reader, |
| const char * | message ) |
Definition at line 5937 of file readfile.cc.
References BLO_read_data_invalidate(), blo_readfile_invalidate(), BlendDataReader::fd, ListBase::last, and FileData::mainlist.
Referenced by blender::bke::CurvesGeometry::blend_read(), BLO_read_data_invalidate(), direct_link_area(), grease_pencil_blend_read_data(), and window_manager_blend_read_data().
| bool BLO_read_data_is_undo | ( | BlendDataReader * | reader | ) |
Definition at line 5917 of file readfile.cc.
References BLO_read_data_is_undo(), BlendDataReader::fd, FD_FLAGS_IS_MEMFILE, and FileData::flags.
Referenced by BKE_previewimg_blend_read(), BLO_read_data_is_undo(), blo_read_shared_impl(), direct_link_id_common(), image_blend_read_data(), object_blend_read_data(), and sound_blend_read_data().
| BlendFileReadReport * BLO_read_data_reports | ( | BlendDataReader * | reader | ) |
Definition at line 5932 of file readfile.cc.
References BLO_read_data_reports(), BlendDataReader::fd, and FileData::reports.
Referenced by BKE_fmodifiers_blend_read_data(), BKE_modifier_blend_read_data(), blender::bke::CurvesGeometry::blend_read(), BLO_read_data_reports(), and link_recurs_seq().
| void BLO_read_double_array | ( | BlendDataReader * | reader, |
| const int64_t | array_size, | ||
| double ** | ptr_p ) |
Definition at line 5773 of file readfile.cc.
References BLI_endian_switch_double_array(), BLO_read_double_array(), BLO_read_requires_endian_switch(), and BLO_read_struct_array_with_size().
Referenced by BLO_read_double_array(), IDP_DirectLinkArray(), and read_ui_data().
|
static |
Contains sanity/debug checks to be performed at the very end of the reading process (i.e. after data, liblink, linked data, etc. has been done).
Definition at line 3946 of file readfile.cc.
References BLI_assert, blo_read_file_checks(), Main::is_read_invalid, LISTBASE_FOREACH, Main::next, UNUSED_VARS_NDEBUG, and Main::wm.
Referenced by blo_read_file_checks(), blo_read_file_internal(), and library_link_end().
| BlendFileData * blo_read_file_internal | ( | FileData * | fd, |
| const char * | filepath ) |
Definition at line 3962 of file readfile.cc.
References after_liblink_merged_bmain_process(), ATTR_FALLTHROUGH, BKE_collections_after_lib_link(), BKE_id_delete(), BKE_layer_collection_resync_allow(), BKE_layer_collection_resync_forbid(), BKE_lib_override_library_main_update(), BKE_lib_override_library_main_validate(), BKE_main_collections_parent_relations_rebuild(), BKE_main_ensure_invariants(), BKE_main_id_refcount_recompute(), BKE_main_id_tag_all(), BKE_main_idmap_create(), BKE_main_new(), BKE_reportf(), BKE_view_layer_find(), Main::blen_thumb, BLEN_THUMB_MEMSIZE, BLEN_THUMB_MEMSIZE_FILE, BLEN_THUMB_MEMSIZE_IS_VALID, BLENFILETYPE_BLEND, BLI_addtail(), BLI_assert, BLI_SCOPED_DEFER, BLI_time_now_seconds(), blo_bhead_first(), blo_bhead_is_id_valid_type(), blo_bhead_next(), BLO_CODE_DATA, BLO_CODE_DNA1, BLO_CODE_ENDB, BLO_CODE_GLOB, BLO_CODE_REND, BLO_CODE_TEST, BLO_CODE_USER, blo_filedata_free(), blo_join_main(), blo_read_file_checks(), blo_read_file_internal(), BLO_READ_SKIP_DATA, BLO_READ_SKIP_USERDEF, blo_readfile_invalidate(), blo_split_main(), CLOG_INFO, BHead::code, BlendFileData::cur_view_layer, Main::curlib, BlendFileData::curscene, data, do_versions(), do_versions_after_linking(), do_versions_userdef(), BlendFileReadReport::duration, FD_FLAGS_FILE_OK, FD_FLAGS_HAS_INVALID_ID_NAMES, FD_FLAGS_IS_MEMFILE, BlendFileData::filepath, Main::filepath, FileData::fileversion, ListBase::first, fix_relpaths_library(), FileData::flags, FOREACH_MAIN_ID_BEGIN, FOREACH_MAIN_ID_END, G, Main::has_forward_compatibility_issues, BlendThumbnail::height, ID_LINK_PLACEHOLDER, Main::id_map, ID_SCR, ID_SCRN, ID_TAG_LOCAL, ID_TAG_NEW, Main::is_read_invalid, ListBase::last, ID::lib, lib_link_all(), Main::libraries, link_global(), LISTBASE_FOREACH, LISTBASE_FOREACH_MUTABLE, LOG_UNDO, long_id_names_ensure_unique_id_names(), long_id_names_process_action_slots_identifiers(), BlendFileData::main, MAIN_IDMAP_TYPE_UID, FileData::mainlist, MEM_mallocN(), ViewLayer::name, FileData::new_idmap_uid, Main::next, blender::bke::node_tree_update_all_new(), FileData::old_mainlist, placeholders_ensure_valid(), read_file_thumbnail(), read_global(), read_libblock(), read_libraries(), read_libraries_free_placeholders(), read_undo_move_libmain_data(), read_undo_remap_noundo_data(), read_undo_reuse_noundo_local_ids(), read_userdef(), BlendThumbnail::rect, FileData::relabase, BlendFileReadReport::reports, FileData::reports, RPT_ERROR, RPT_WARNING, FileData::skip_flags, STRNCPY(), BlendFileData::type, Main::versionfile, and BlendThumbnail::width.
Referenced by blo_read_file_internal(), blo_read_file_internal(), BLO_read_from_file(), BLO_read_from_memfile(), and BLO_read_from_memory().
| int BLO_read_fileversion_get | ( | BlendDataReader * | reader | ) |
Definition at line 5588 of file readfile.cc.
References BLO_read_fileversion_get(), BlendDataReader::fd, and FileData::fileversion.
Referenced by BKE_collection_blend_read_data(), BLO_read_fileversion_get(), brush_blend_read_data(), direct_link_area(), blender::bke::direct_link_node_socket_default_value(), blender::bke::node_tree_blend_read_data(), and scene_blend_read_data().
| void BLO_read_float3_array | ( | BlendDataReader * | reader, |
| const int64_t | array_size, | ||
| float ** | ptr_p ) |
Definition at line 5768 of file readfile.cc.
References BLO_read_float3_array(), and BLO_read_float_array().
Referenced by blend_read(), blend_read(), blend_read(), blend_read(), blend_read_mdisps(), BLO_read_float3_array(), lightprobe_grid_cache_frame_blend_read(), and blender::bke::read_array_data().
| void BLO_read_float_array | ( | BlendDataReader * | reader, |
| const int64_t | array_size, | ||
| float ** | ptr_p ) |
Definition at line 5758 of file readfile.cc.
References BLI_endian_switch_float_array(), BLO_read_float_array(), BLO_read_requires_endian_switch(), and BLO_read_struct_array_with_size().
Referenced by BKE_constraint_blend_read_data(), BKE_fmodifiers_blend_read_data(), blend_read(), blend_read(), blender::bke::CurvesGeometry::blend_read(), blend_read_layer_data(), blend_read_paint_mask(), BLO_read_float3_array(), BLO_read_float_array(), curve_blend_read_data(), direct_link_pointcache_mem(), IDP_DirectLinkArray(), lightprobe_grid_cache_frame_blend_read(), mask_blend_read_data(), and blender::bke::read_array_data().
| void * BLO_read_get_new_data_address | ( | BlendDataReader * | reader, |
| const void * | old_address ) |
Definition at line 5535 of file readfile.cc.
References BLO_read_get_new_data_address(), BlendDataReader::fd, and newdataadr().
Referenced by BLO_read_get_new_data_address().
| void * BLO_read_get_new_data_address_no_us | ( | BlendDataReader * | reader, |
| const void * | old_address, | ||
| size_t | expected_size ) |
Does not consider the read data as 'used'. It will still be freed by readfile code at the end of the reading process, if no other 'real' usage was detected for it.
Typical valid usages include:
Definition at line 5540 of file readfile.cc.
References BLO_read_get_new_data_address_no_us(), blo_verify_data_address(), BlendDataReader::fd, and newdataadr_no_us().
Referenced by BKE_modifier_blend_read_data(), BLO_read_get_new_data_address_no_us(), modifier_replace_with_fluid(), blender::ed::outliner::outliner_space_blend_read_data(), and scene_blend_read_data().
| void * blo_read_get_new_globaldata_address | ( | FileData * | fd, |
| const void * | adr ) |
Direct data-blocks with global linking.
Definition at line 1582 of file readfile.cc.
References blo_read_get_new_globaldata_address(), FileData::globmap, and oldnewmap_lookup_and_inc().
Referenced by blo_bhead_prev(), blo_do_versions_290(), blo_read_get_new_globaldata_address(), and link_global().
| ID * BLO_read_get_new_id_address | ( | BlendLibReader * | reader, |
| ID * | self_id, | ||
| const bool | is_linked_only, | ||
| ID * | id ) |
Search for the new address of given id, during library linking part of blend-file reading process.
| self_id | the ID owner of the given id pointer. Note that it may be an embedded ID. |
| is_linked_only | If true, only return found pointer if it is a linked ID. Used to prevent linked data to point to local IDs. |
Definition at line 5575 of file readfile.cc.
References BLO_read_get_new_id_address(), BlendLibReader::fd, and newlibadr().
Referenced by BLO_read_data_current_library(), BLO_read_get_new_id_address(), and lib_link_cb().
| ID * BLO_read_get_new_id_address_from_session_uid | ( | BlendLibReader * | reader, |
| uint | session_uid ) |
Search for the new address of the ID for the given session_uid.
Only IDs existing in the newly read Main will be returned. If no matching session_uid in new main can be found, nullptr is returned.
This expected to be used during library-linking and/or 'undo_preserve' processes in undo case (i.e. memfile reading), typically to find a valid value (or nullptr) for ID pointers values coming from the previous, existing Main data, when it is preserved in newly read Main. See e.g. the #scene_undo_preserve code-path.
Definition at line 5583 of file readfile.cc.
References BKE_main_idmap_lookup_uid(), BLO_read_get_new_id_address_from_session_uid(), BlendLibReader::fd, and FileData::new_idmap_uid.
Referenced by BLO_read_data_current_library(), BLO_read_get_new_id_address_from_session_uid(), and scene_foreach_toolsettings_id_pointer_process().
| void BLO_read_glob_list | ( | BlendDataReader * | reader, |
| ListBase * | list ) |
Definition at line 5927 of file readfile.cc.
References BLO_read_glob_list(), BlendDataReader::fd, and link_glob_list().
Referenced by BLO_read_glob_list(), and scene_blend_read_data().
| void BLO_read_int16_array | ( | BlendDataReader * | reader, |
| const int64_t | array_size, | ||
| int16_t ** | ptr_p ) |
Definition at line 5728 of file readfile.cc.
References BLI_endian_switch_int16_array(), BLO_read_int16_array(), BLO_read_requires_endian_switch(), and BLO_read_struct_array_with_size().
Referenced by BLO_read_int16_array(), and blender::bke::read_array_data().
| void BLO_read_int32_array | ( | BlendDataReader * | reader, |
| const int64_t | array_size, | ||
| int32_t ** | ptr_p ) |
Definition at line 5738 of file readfile.cc.
References BLI_endian_switch_int32_array(), BLO_read_int32_array(), BLO_read_requires_endian_switch(), and BLO_read_struct_array_with_size().
Referenced by blend_read(), blend_read(), blender::bke::CurvesGeometry::blend_read(), BLO_read_int32_array(), IDP_DirectLinkArray(), object_blend_read_data(), blender::bke::read_array_data(), read_layer(), and read_ui_data().
| void BLO_read_int8_array | ( | BlendDataReader * | reader, |
| const int64_t | array_size, | ||
| int8_t ** | ptr_p ) |
Definition at line 5722 of file readfile.cc.
References BLO_read_int8_array(), and BLO_read_struct_array_with_size().
Referenced by blend_read_mdisps(), BLO_read_int8_array(), IDP_DirectLinkArray(), lightprobe_grid_cache_frame_blend_read(), blender::bke::read_array_data(), and read_ui_data().
| Main * BLO_read_lib_get_main | ( | BlendLibReader * | reader | ) |
Definition at line 5950 of file readfile.cc.
References BLO_read_lib_get_main(), and BlendLibReader::main.
Referenced by BKE_pose_blend_read_after_liblink(), BLO_read_data_current_library(), BLO_read_lib_get_main(), object_blend_read_after_liblink(), and workspace_blend_read_after_liblink().
| bool BLO_read_lib_is_undo | ( | BlendLibReader * | reader | ) |
Definition at line 5945 of file readfile.cc.
References BLO_read_lib_is_undo(), BlendLibReader::fd, FD_FLAGS_IS_MEMFILE, and FileData::flags.
Referenced by BKE_pose_blend_read_after_liblink(), BLO_read_data_current_library(), BLO_read_lib_is_undo(), and blender::bke::ntree_blend_read_after_liblink().
| BlendFileReadReport * BLO_read_lib_reports | ( | BlendLibReader * | reader | ) |
Definition at line 5955 of file readfile.cc.
References BLO_read_lib_reports(), BlendLibReader::fd, and FileData::reports.
Referenced by BLO_read_data_current_library(), BLO_read_lib_reports(), object_blend_read_after_liblink(), and scene_blend_read_after_liblink().
| void BLO_read_pointer_array | ( | BlendDataReader * | reader, |
| const int64_t | array_size, | ||
| void ** | ptr_p ) |
Definition at line 5834 of file readfile.cc.
References BLI_assert_unreachable, BLO_read_pointer_array(), convert_pointer_array_32_to_64(), convert_pointer_array_64_to_32(), BlendDataReader::fd, FileData::filesdna, MEM_freeN(), MEM_malloc_arrayN(), FileData::memsdna, newdataadr(), and SDNA::pointer_size.
Referenced by BKE_gpencil_blend_read_data(), BLO_read_pointer_array(), curve_blend_read_data(), curves_blend_read_data(), direct_link_moviePlaneTracks(), grease_pencil_blend_read_data(), IDP_DirectLinkArray(), blender::bke::node_interface::item_types::item_read_data(), mesh_blend_read_data(), metaball_blend_read_data(), object_blend_read_data(), pointcloud_blend_read_data(), blender::bke::read_channelbag(), read_drawing_array(), blender::bke::read_layers(), blender::bke::read_slots(), blender::bke::read_strip_keyframe_data(), blender::bke::read_strip_keyframe_data_array(), blender::ed::spreadsheet::spreadsheet_blend_read_data(), blender::ed::spreadsheet::spreadsheet_table_blend_read(), and volume_blend_read_data().
| bool BLO_read_requires_endian_switch | ( | BlendDataReader * | reader | ) |
Definition at line 5593 of file readfile.cc.
References BLO_read_requires_endian_switch(), BlendDataReader::fd, FD_FLAGS_SWITCH_ENDIAN, and FileData::flags.
Referenced by blender::bke::action_blend_read_data(), BLO_read_double_array(), BLO_read_float_array(), BLO_read_int16_array(), BLO_read_int32_array(), BLO_read_requires_endian_switch(), BLO_read_uint32_array(), convert_pointer_array_64_to_32(), IDP_DirectLinkProperty(), ipo_blend_read_data(), mesh_blend_read_data(), blender::bke::read_slots(), and shapekey_blend_read_data().
| blender::ImplicitSharingInfoAndData blo_read_shared_impl | ( | BlendDataReader * | reader, |
| const void ** | ptr_p, | ||
| const blender::FunctionRef< const blender::ImplicitSharingInfo *()> | read_fn ) |
Definition at line 5874 of file readfile.cc.
References Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), BLO_read_data_is_undo(), blo_read_shared_impl(), BlendDataReader::fd, FD_FLAGS_IS_MEMFILE, FileData::file, FileData::flags, Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_default(), Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_ptr(), MemFileSharedStorage::map, UndoReader::memfile, BlendDataReader::shared_data_by_stored_address, and MemFile::shared_storage.
| void BLO_read_string | ( | BlendDataReader * | reader, |
| char ** | ptr_p ) |
Definition at line 5783 of file readfile.cc.
References BLI_assert_msg, BLO_read_data_address, BLO_read_string(), len(), MEM_allocN_len, and str.
Referenced by BKE_asset_catalog_path_list_blend_read_data(), BKE_asset_metadata_read(), BKE_asset_weak_reference_read(), BKE_fcurve_blend_read_data(), BKE_keyingsets_blend_read_data(), BKE_paint_blend_read_data(), BKE_preferences_extension_repo_read_data(), BKE_viewer_path_blend_read_data(), blender::bke::AttributeStorage::blend_read(), blender::blend_read(), blender::nodes::BakeItemsAccessor::blend_read_data_item(), blender::nodes::CaptureAttributeItemsAccessor::blend_read_data_item(), blender::nodes::ClosureInputItemsAccessor::blend_read_data_item(), blender::nodes::ClosureOutputItemsAccessor::blend_read_data_item(), blender::nodes::CombineBundleItemsAccessor::blend_read_data_item(), blender::nodes::EvaluateClosureInputItemsAccessor::blend_read_data_item(), blender::nodes::EvaluateClosureOutputItemsAccessor::blend_read_data_item(), blender::nodes::ForeachGeometryElementGenerationItemsAccessor::blend_read_data_item(), blender::nodes::ForeachGeometryElementInputItemsAccessor::blend_read_data_item(), blender::nodes::ForeachGeometryElementMainItemsAccessor::blend_read_data_item(), blender::nodes::FormatStringItemsAccessor::blend_read_data_item(), blender::nodes::MenuSwitchItemsAccessor::blend_read_data_item(), blender::nodes::RepeatItemsAccessor::blend_read_data_item(), blender::nodes::SeparateBundleItemsAccessor::blend_read_data_item(), blender::nodes::SimulationItemsAccessor::blend_read_data_item(), BLO_read_string(), BLO_read_string(), camera_blend_read_data(), curve_blend_read_data(), curves_blend_read_data(), direct_link_id_override_property(), blender::bke::direct_link_node_socket(), direct_link_panel_list(), blender::bke::node_interface::item_types::item_read_data(), mesh_blend_read_data(), blender::nodes::node_fn_input_string_cc::node_blend_read(), blender::bke::node_blend_read_data_storage(), blender::bke::node_tree_blend_read_data(), read_layer(), read_layer_tree_group(), read_ui_data(), blender::ed::asset::shelf::settings_blend_read_data(), blender::ed::spreadsheet::spreadsheet_blend_read_data(), blender::ed::spreadsheet::spreadsheet_column_blend_read(), blender::ed::spreadsheet::spreadsheet_column_id_blend_read(), and text_blend_read_data().
| void BLO_read_string | ( | BlendDataReader * | reader, |
| char *const * | ptr_p ) |
Definition at line 5802 of file readfile.cc.
References BLO_read_string().
| void * BLO_read_struct_array_with_size | ( | BlendDataReader * | reader, |
| const void * | old_address, | ||
| size_t | expected_size ) |
The 'main' read function and helper macros for non-basic data types.
NOTE: Currently the usage of the type info is very minimal/basic, it merely does a lose check on the data size.
Definition at line 5548 of file readfile.cc.
References BLO_read_struct_array_with_size(), blo_verify_data_address(), BlendDataReader::fd, newdataadr_entry(), NewAddress::newp, and NewAddress::nr.
Referenced by blender::nodes::socket_items::blend_read_data(), BLO_read_char_array(), BLO_read_double_array(), BLO_read_float_array(), BLO_read_int16_array(), BLO_read_int32_array(), BLO_read_int8_array(), BLO_read_struct_array_with_size(), BLO_read_struct_by_name_array(), BLO_read_struct_list_with_size(), BLO_read_uint32_array(), and BLO_read_uint8_array().
| void * BLO_read_struct_by_name_array | ( | BlendDataReader * | reader, |
| const char * | struct_name, | ||
| int64_t | items_num, | ||
| const void * | old_address ) |
Similar to BLO_read_struct_array_with_size, but can use a (DNA) type name instead of the type itself to find the expected data size.
Somewhat mirrors BLO_write_struct_array_by_name.
Definition at line 5563 of file readfile.cc.
References BLI_assert, BLO_read_struct_array_with_size(), BLO_read_struct_by_name_array(), DNA_struct_find_with_alias(), DNA_struct_identifier(), DNA_struct_size(), BlendDataReader::fd, FileData::memsdna, and STREQ.
Referenced by BKE_constraint_blend_read_data(), BKE_fmodifiers_blend_read_data(), BKE_pose_blend_read_data(), blend_read_layer_data(), BLO_read_struct_by_name_array(), and blender::bke::node_blend_read_data_storage().
| void BLO_read_struct_list_with_size | ( | BlendDataReader * | reader, |
| const size_t | expected_elem_size, | ||
| ListBase * | list ) |
Definition at line 5606 of file readfile.cc.
References BLI_listbase_is_empty(), BLO_read_struct_array_with_size(), BLO_read_struct_list_with_size(), ListBase::first, ListBase::last, Link::next, and Link::prev.
Referenced by BLO_read_struct_list_with_size().
| void BLO_read_struct_list_with_type_size | ( | BlendDataReader * | reader, |
| size_t | base_size, | ||
| ListBase * | list, | ||
| blender::FunctionRef< size_t(const void *data)> | type_size_fn ) |
Read functions for base structs with a type member indicating a derived struct, like modifiers. type_size_fn returns the size of the derived struct for data read as base struct. Data too small for its type is freed and the blend file is marked as invalid.
Definition at line 5647 of file readfile.cc.
References BLO_read_struct_list_with_type_size(), blo_read_verify_type_size(), blo_verify_data_address(), data, BlendDataReader::fd, ListBase::first, ListBase::last, newdataadr_entry(), NewAddress::newp, Link::next, NewAddress::nr, and Link::prev.
Referenced by BKE_gpencil_modifier_blend_read_data(), BKE_modifier_blend_read_data(), BKE_shaderfx_blend_read_data(), BKE_viewer_path_blend_read_data(), BLO_read_struct_list_with_type_size(), BLO_read_struct_list_with_type_size(), direct_link_area(), linestyle_modifiers_read(), blender::seq::modifier_blend_read_data(), particle_settings_blend_read_data(), read_layer_tree_group(), and read_userdef().
| int BLO_read_struct_member_offset | ( | const BlendDataReader * | reader, |
| const char * | stype, | ||
| const char * | vartype, | ||
| const char * | name ) |
Definition at line 5598 of file readfile.cc.
References BLO_read_struct_member_offset(), DNA_struct_member_offset_by_name_with_alias(), BlendDataReader::fd, and FileData::filesdna.
Referenced by BLO_read_data_current_library(), BLO_read_struct_member_offset(), and scene_blend_read_data().
| void * blo_read_struct_with_type_size_impl | ( | BlendDataReader * | reader, |
| const void * | old_address, | ||
| const size_t | base_size, | ||
| blender::FunctionRef< size_t(const void *data)> | type_size_fn ) |
Definition at line 5690 of file readfile.cc.
References blo_read_struct_with_type_size_impl(), blo_read_verify_type_size(), blo_verify_data_address(), data, BlendDataReader::fd, newdataadr_entry(), NewAddress::newp, and NewAddress::nr.
Referenced by BLO_read_struct_with_type_size(), and blo_read_struct_with_type_size_impl().
| void BLO_read_uint32_array | ( | BlendDataReader * | reader, |
| const int64_t | array_size, | ||
| uint32_t ** | ptr_p ) |
Definition at line 5748 of file readfile.cc.
References BLI_endian_switch_uint32_array(), BLO_read_requires_endian_switch(), BLO_read_struct_array_with_size(), and BLO_read_uint32_array().
Referenced by BKE_previewimg_blend_read(), blend_read(), BLO_read_uint32_array(), and direct_link_pointcache_mem().
| void BLO_read_uint8_array | ( | BlendDataReader * | reader, |
| const int64_t | array_size, | ||
| uint8_t ** | ptr_p ) |
Definition at line 5716 of file readfile.cc.
References BLO_read_struct_array_with_size(), and BLO_read_uint8_array().
Referenced by blend_read_layer_data(), BLO_read_uint8_array(), and blender::bke::read_array_data().
|
static |
Check data already verified for its base struct size against the struct size of its type. Data too small is freed and removed from the data map, so later reads resolve to null.
Definition at line 5631 of file readfile.cc.
References blo_read_verify_type_size(), blo_verify_data_address(), data, FileData::datamap, OldNewMap::map, MEM_freeN(), NewAddress::newp, NewAddress::nr, and Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::remove().
Referenced by BLO_read_struct_list_with_type_size(), blo_read_struct_with_type_size_impl(), and blo_read_verify_type_size().
| void BLO_readfile_id_runtime_data_free | ( | ID & | id | ) |
Free the ID_Readfile_Data of this ID. Does not deal with embedded IDs.
Definition at line 2369 of file readfile.cc.
References BLO_readfile_id_runtime_data_free(), and MEM_SAFE_FREE.
Referenced by BKE_libblock_free_runtime_data(), BLO_readfile_id_runtime_data_free(), BLO_readfile_id_runtime_data_free_all(), read_libraries_free_placeholders(), and read_library_linked_ids().
| void BLO_readfile_id_runtime_data_free_all | ( | Main & | bmain | ) |
Free the ID_Readfile_Data of all IDs in this bmain and all their embedded IDs.
This is typically called at the end of the versioning process, as after that ID.runtime.readfile_data should no longer be needed.
Definition at line 2374 of file readfile.cc.
References BLO_readfile_id_runtime_data_free(), BLO_readfile_id_runtime_data_free_all(), FOREACH_MAIN_ID_BEGIN, FOREACH_MAIN_ID_END, GS, bNodeTree::id, Collection::id, ID_SCE, ID::name, and blender::bke::node_tree_from_id().
Referenced by BKE_blendfile_append(), BKE_blendfile_link(), BLO_readfile_id_runtime_data_free_all(), and setup_app_data().
| ID_Readfile_Data::Tags BLO_readfile_id_runtime_tags | ( | ID & | id | ) |
Return id->runtime.readfile_data->tags if the readfile_data is allocated, otherwise return an all-zero set of tags.
Definition at line 2355 of file readfile.cc.
References BLO_readfile_id_runtime_tags().
Referenced by blo_do_versions_pre250(), BLO_expand_main(), BLO_readfile_id_runtime_tags(), blender::animrig::versioning::convert_legacy_action_assignments(), direct_link_id(), direct_link_id_common(), expand_doit_library(), has_linked_ids_to_read(), lib_link_all(), read_libraries_free_placeholders(), read_library_clear_weak_links(), read_library_linked_id(), and read_library_linked_ids().
| ID_Readfile_Data::Tags & BLO_readfile_id_runtime_tags_for_write | ( | ID & | id | ) |
Create the readfile_data if needed, and return id->runtime.readfile_data->tags.
Use it instead of BLO_readfile_id_runtime_tags when tags need to be set.
Definition at line 2363 of file readfile.cc.
References BLO_readfile_id_runtime_tags_for_write(), and readfile_id_runtime_data_ensure().
Referenced by blo_do_versions_pre250(), BLO_expand_main(), BLO_readfile_id_runtime_tags_for_write(), lib_link_all(), read_libblock_undo_restore_at_old_address(), and read_library_linked_id().
Definition at line 595 of file readfile.cc.
References blo_readfile_invalidate(), BLO_reportf_wrap(), Main::is_read_invalid, Main::prev, FileData::reports, and RPT_ERROR.
Referenced by BLO_read_data_invalidate(), blo_read_file_internal(), BLO_read_invalidate_message(), blo_readfile_invalidate(), blo_readfile_invalidate(), blo_verify_data_address(), direct_link_library(), read_global(), read_id_struct(), read_libblock(), read_libraries(), read_library_linked_ids(), read_library_struct(), read_struct(), read_struct_and_validate_size(), and read_userdef().
| void BLO_reportf_wrap | ( | BlendFileReadReport * | reports, |
| const eReportType | type, | ||
| const char * | format, | ||
| ... ) |
Definition at line 223 of file readfile.cc.
References BKE_report(), BKE_report_type_str(), BLO_reportf_wrap(), G, printf, and reports.
Definition at line 411 of file readfile.cc.
References BKE_main_idmap_destroy(), BKE_main_lists_get(), BKE_main_namemap_clear(), BKE_main_new(), BLENDER_FILE_SUBVERSION, BLENDER_FILE_VERSION, BLI_addtail(), BLI_listbase_count(), BLI_listbase_is_empty(), blo_split_main(), Main::curlib, ListBase::first, GS, Main::has_forward_compatibility_issues, i, ID_LI, Main::is_asset_edit_file, ListBase::last, LIBRARY_IS_ASSET_EDIT_FILE, main, MAIN_VERSION_FILE_OLDER_OR_EQUAL, MEM_freeN(), MEM_malloc_arrayN(), ID::name, split_libdata(), Main::subversionfile, and Main::versionfile.
Referenced by BLO_main_validate_libraries(), blo_read_file_internal(), BLO_read_from_memfile(), blo_split_main(), library_link_begin(), and library_link_end().
| 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 1517 of file readfile.cc.
References BLEN_THUMB_MEMSIZE, BLEN_THUMB_MEMSIZE_FILE, BLEN_THUMB_MEMSIZE_IS_VALID, BLI_assert, blo_filedata_free(), blo_filedata_from_file_minimal(), BLO_thumbnail_from_file(), data, MEM_mallocN(), and read_file_thumbnail().
Referenced by BLO_thumbnail_from_file(), imb_thumb_load_from_blendfile(), and uiTemplateRecentFiles_tooltip_func().
|
static |
Definition at line 5509 of file readfile.cc.
References blo_readfile_invalidate(), blo_verify_data_address(), ListBase::last, FileData::mainlist, and MEM_allocN_len.
Referenced by BLO_read_get_new_data_address_no_us(), BLO_read_struct_array_with_size(), BLO_read_struct_list_with_type_size(), blo_read_struct_with_type_size_impl(), blo_read_verify_type_size(), and blo_verify_data_address().
| short BLO_version_from_file | ( | const char * | filepath | ) |
Does a very light reading of given .blend file to extract its version.
| filepath | The path of the blend file to extract version from. |
Definition at line 1544 of file readfile.cc.
References blo_filedata_free(), blo_filedata_from_file_minimal(), BLO_version_from_file(), and FileData::fileversion.
Referenced by BLO_version_from_file(), file_draw_tooltip_custom_func(), and uiTemplateRecentFiles_tooltip_func().
Definition at line 1633 of file readfile.cc.
References change_ID_link_filedata_get(), Main::curlib, and Library::runtime.
Referenced by change_ID_link_filedata_get(), change_ID_pointer_to_real_ID_pointer(), and change_link_placeholder_to_real_ID_pointer().
|
static |
Definition at line 1656 of file readfile.cc.
References change_ID_link_filedata_get(), change_ID_pointer_to_real_ID_pointer(), change_ID_pointer_to_real_ID_pointer_fd(), and LISTBASE_FOREACH.
Referenced by change_ID_pointer_to_real_ID_pointer(), and direct_link_library().
|
static |
Definition at line 1620 of file readfile.cc.
References BKE_idtype_idcode_is_valid(), BLI_assert, change_ID_pointer_to_real_ID_pointer_fd(), GS, FileData::libmap, OldNewMap::map, and Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::values().
Referenced by change_ID_pointer_to_real_ID_pointer(), and change_ID_pointer_to_real_ID_pointer_fd().
|
static |
Definition at line 1643 of file readfile.cc.
References change_ID_link_filedata_get(), change_link_placeholder_to_real_ID_pointer(), change_link_placeholder_to_real_ID_pointer_fd(), and LISTBASE_FOREACH.
Referenced by change_link_placeholder_to_real_ID_pointer(), read_libraries_free_placeholders(), read_library_clear_weak_links(), and read_library_linked_ids().
|
static |
Definition at line 1602 of file readfile.cc.
References change_link_placeholder_to_real_ID_pointer_fd(), GS, ID_LINK_PLACEHOLDER, FileData::libmap, OldNewMap::map, and Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::values().
Referenced by change_link_placeholder_to_real_ID_pointer(), and change_link_placeholder_to_real_ID_pointer_fd().
|
static |
Definition at line 5823 of file readfile.cc.
References convert_pointer_array_32_to_64(), and i.
Referenced by BLO_read_pointer_array(), and convert_pointer_array_32_to_64().
|
static |
Definition at line 5812 of file readfile.cc.
References BLO_read_requires_endian_switch(), convert_pointer_array_64_to_32(), i, and uint32_from_uint64_ptr().
Referenced by BLO_read_pointer_array(), and convert_pointer_array_64_to_32().
|
static |
Definition at line 2712 of file readfile.cc.
References BKE_lib_libblock_session_uid_ensure(), BKE_libblock_alloc_notest(), BKE_libblock_init_empty(), BKE_main_idmap_insert_id(), BLI_addtail(), BLI_strncpy(), create_placeholder(), Main::curlib, ID::icon_id, ID_FAKE_USERS, Main::id_map, id_sort_by_name(), ID_TAG_LIBOVERRIDE_NEED_RESYNC, ID_TAG_MISSING, ID_TAG_TEMP_MAIN, ID::lib, ID::name, ID::tag, ID::us, and which_libbase().
Referenced by create_placeholder(), link_named_part(), and read_library_linked_id().
|
static |
Definition at line 2763 of file readfile.cc.
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(), BLO_readfile_id_runtime_tags(), FileData::cache_storage, Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::clear(), direct_link_id(), direct_link_id_common(), direct_link_library(), BlendDataReader::fd, IDTypeInfo::foreach_cache, GS, ID_LI, ID_SCR, ID_Readfile_Data::Tags::is_link_placeholder, main, ID::name, and BlendDataReader::shared_data_by_stored_address.
Referenced by direct_link_id(), and read_libblock().
|
static |
Definition at line 2397 of file readfile.cc.
References ID::asset_data, IDTypeInfo::asset_type_info, BKE_animdata_blend_read_data(), BKE_asset_metadata_read(), BKE_idtype_get_info_from_id(), BKE_idtype_idcode_is_valid(), BKE_lib_libblock_session_uid_ensure(), BLI_assert_msg, BLO_read_data_is_undo(), BLO_READ_SKIP_UNDO_OLD_MAIN, BLO_read_struct, BLO_read_struct_list, BLO_readfile_id_runtime_tags(), direct_link_id_common(), direct_link_id_embedded_id(), direct_link_id_override_property(), direct_link_id_restore_recalc(), BlendDataReader::fd, GS, ID_FAKE_USERS, ID_FLAG_FAKEUSER, ID_FLAG_INDIRECT_WEAK_LINK, ID_IS_LINKED, ID_TAG_KEEP_ON_UNDO, ID_TAG_TEMP_MAIN, IDP_BlendDataRead, ID_Readfile_Data::Tags::is_link_placeholder, ID::lib, ID::library_weak_reference, LISTBASE_FOREACH, MAIN_ID_SESSION_UID_UNSET, ID::name, ID::override_library, ID::properties, IDOverrideLibrary::properties, readfile_id_runtime_data_ensure(), FileData::skip_flags, ID::system_properties, and ID::tag.
Referenced by direct_link_id(), direct_link_id_common(), and direct_link_id_embedded_id().
|
static |
Definition at line 2233 of file readfile.cc.
References BKE_collection_blend_read_data(), BKE_id_name(), BKE_idtype_idcode_is_valid(), BLO_read_struct, BLO_reportf_wrap(), direct_link_id_common(), direct_link_id_embedded_id(), BlendDataReader::fd, GS, Collection::id, Scene::id, ID_SCE, Scene::master_collection, MEM_SAFE_FREE, ID::name, blender::bke::node_tree_blend_read_data(), blender::bke::node_tree_from_id(), blender::bke::node_tree_ptr_from_id(), FileData::reports, RPT_, and RPT_ERROR.
Referenced by direct_link_id_common(), and direct_link_id_embedded_id().
|
static |
Definition at line 2209 of file readfile.cc.
References BLO_read_string(), BLO_read_struct_list, direct_link_id_override_property(), LISTBASE_FOREACH, IDOverrideLibraryProperty::operations, IDOverrideLibraryProperty::rna_path, and IDOverrideLibraryProperty::tag.
Referenced by direct_link_id_common(), and direct_link_id_override_property().
|
static |
Definition at line 2301 of file readfile.cc.
References BLI_assert, direct_link_id_restore_recalc(), direct_link_id_restore_recalc_exceptions(), ID_RECALC_ALL, ID_RECALC_SYNC_TO_EVAL, ID::recalc, ID::recalc_up_to_undo_push, STEP_REDO, STEP_UNDO, and FileData::undo_direction.
Referenced by direct_link_id_common(), and direct_link_id_restore_recalc().
|
static |
Definition at line 2290 of file readfile.cc.
References direct_link_id_restore_recalc_exceptions(), GS, ID_OB, ID_RECALC_GEOMETRY, and ID::name.
Referenced by direct_link_id_restore_recalc(), direct_link_id_restore_recalc_exceptions(), and read_libblock_undo_restore_identical().
|
static |
Definition at line 3761 of file readfile.cc.
References BLO_read_struct, direct_link_keymapitem(), wmKeyMapItem::flag, IDP_BlendDataRead, KMI_UPDATE, wmKeyMapItem::properties, and wmKeyMapItem::ptr.
Referenced by direct_link_keymapitem(), and read_userdef().
Definition at line 2611 of file readfile.cc.
References BKE_main_new(), BKE_packedfile_blend_read(), BLI_addtail(), BLI_path_abs(), BLI_path_cmp, BLI_path_normalize(), BLI_remlink(), blo_readfile_invalidate(), BLO_reportf_wrap(), change_ID_pointer_to_real_ID_pointer(), Main::curlib, direct_link_library(), Library::filepath, Library::id, id_us_ensure_real(), library_filepath_is_valid(), LISTBASE_FOREACH, main, FileData::mainlist, MEM_freeN(), Library::packedfile, FileData::relabase, FileData::reports, RPT_, RPT_WARNING, Library::runtime, and STRNCPY().
Referenced by direct_link_id(), and direct_link_library().
Definition at line 3484 of file readfile.cc.
References 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_400(), blo_do_versions_410(), blo_do_versions_420(), blo_do_versions_430(), blo_do_versions_440(), blo_do_versions_450(), blo_do_versions_pre250(), CLOG_INFO, do_versions(), G, G_DEBUG, LIKELY, LOG, main, FileData::relabase, STRNCPY(), and version_forward_compat_system_idprops().
Referenced by blo_read_file_internal(), do_versions(), and read_libraries().
Definition at line 3566 of file readfile.cc.
References BLI_assert, CLOG_INFO, do_versions_after_linking(), 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_400(), do_versions_after_linking_410(), do_versions_after_linking_420(), do_versions_after_linking_430(), do_versions_after_linking_440(), do_versions_after_linking_450(), LOG, and main.
Referenced by blo_read_file_internal(), do_versions_after_linking(), and library_link_end().
|
static |
Definition at line 3473 of file readfile.cc.
References blo_do_versions_userdef(), do_versions_userdef(), and BlendFileData::user.
Referenced by blo_read_file_internal(), and do_versions_userdef().
|
static |
Definition at line 4692 of file readfile.cc.
References BlendExpander::callback, LibraryIDLinkCallbackData::cb_flag, expand_cb(), BlendExpander::fd, LibraryIDLinkCallbackData::id_pointer, IDWALK_CB_EMBEDDED, IDWALK_CB_EMBEDDED_NOT_OWNING, IDWALK_CB_LOOPBACK, IDWALK_CB_READFILE_IGNORE, IDWALK_RET_NOP, BlendExpander::main, and LibraryIDLinkCallbackData::user_data.
Referenced by BLO_expand_main(), and expand_cb().
|
static |
Definition at line 4560 of file readfile.cc.
References blo_bhead_id_name(), blo_bhead_is_id_valid_type(), blo_find_main(), BLO_readfile_id_runtime_tags(), BLO_reportf_wrap(), BHead::code, Main::curlib, expand_doit_library(), Library::filepath, find_bhead(), find_previous_lib(), G, G_DEBUG, GS, ID_FLAG_INDIRECT_WEAK_LINK, ID_LINK_PLACEHOLDER, ID_SCR, ID_SCRN, id_sort_by_name(), FileData::id_tag_extra, ID_TAG_INDIRECT, ID_Readfile_Data::Tags::is_link_placeholder, Main::is_read_invalid, library_id_is_yet_read(), MEM_freeN(), ID::name, ID_Readfile_Data::Tags::needs_expanding, BHead::old, oldnewmap_lib_insert(), ID::prev, printf, read_libblock(), read_library_struct(), FileData::relabase, FileData::reports, RPT_, RPT_WARNING, Library::runtime, and which_libbase().
Referenced by expand_doit_library(), library_link_end(), and read_libraries().
Root Main being read into, or null when not reading into a Main.
Definition at line 612 of file readfile.cc.
References filedata_main(), ListBase::first, and FileData::mainlist.
Referenced by filedata_main(), read_id_struct(), read_libblock(), read_library_struct(), read_struct(), and read_struct_and_validate_size().
|
static |
Definition at line 1174 of file readfile.cc.
References BLI_assert, FileData::datamap, DNA_sdna_current_get(), filedata_new(), FileData::globmap, FileData::libmap, FileData::memsdna, oldnewmap_new(), FileData::reports, and reports.
Referenced by blo_filedata_from_file_descriptor(), blo_filedata_from_memfile(), blo_filedata_from_memory(), and filedata_new().
Definition at line 4447 of file readfile.cc.
References BHeadSort::bhead, FileData::bheadmap, blo_bhead_first(), blo_bhead_next(), find_bhead(), BHead::old, BHeadSort::old, sort_bhead_old_map(), FileData::tot_bheadmap, and verg_bheadsort().
Referenced by expand_doit_library(), and find_bhead().
Definition at line 4481 of file readfile.cc.
References FileData::bhead_idname_map, BLI_strncpy(), find_bhead_from_code_name(), and MAX_ID_NAME.
Referenced by find_bhead_from_code_name(), find_bhead_from_idname(), and link_named_part().
Definition at line 4490 of file readfile.cc.
References FileData::bhead_idname_map, do_versions_new_to_old_idcode_get(), find_bhead_from_code_name(), find_bhead_from_idname(), GS, ID_LINK_PLACEHOLDER, and LIKELY.
Referenced by find_bhead_from_idname(), and read_library_linked_id().
Definition at line 4406 of file readfile.cc.
References blo_bhead_prev(), BHead::code, FD_FLAGS_IS_MEMFILE, find_previous_lib(), FileData::flags, and ID_LI.
Referenced by expand_doit_library(), and find_previous_lib().
|
static |
Definition at line 2678 of file readfile.cc.
References BLI_path_is_rel(), BLI_path_rel(), fix_relpaths_library(), LISTBASE_FOREACH, main, and STRNCPY().
Referenced by blo_read_file_internal(), fix_relpaths_library(), and library_link_end().
|
static |
Generate the final allocation string reference for read blocks of data. If blockname is given, use it as 'owner block' info, otherwise use the id type index to get that info.
Definition at line 1869 of file readfile.cc.
References intern::memutil::alloc_string_storage_get(), BKE_idtype_get_info_from_idtype_index(), BLI_assert, intern::memutil::AllocStringStorage< keyT, hashT >::contains(), DNA_struct_identifier(), FileData::filesdna, intern::memutil::AllocStringStorage< keyT, hashT >::find(), get_alloc_name(), INDEX_ID_MAX, INDEX_ID_NULL, intern::memutil::AllocStringStorage< keyT, hashT >::insert(), IDTypeInfo::name, BHead::nr, BHead::SDNAnr, FileData::storage_handle, UNLIKELY, and UNUSED_VARS_NDEBUG.
Referenced by get_alloc_name(), read_libblock(), and read_struct().
Definition at line 638 of file readfile.cc.
References BHeadN::bhead, FileData::bhead_list, BlenderHeader::bhead_type(), BHEAD_USE_READ_ON_DEMAND, FileData::blender_header, BLI_addtail(), BLI_assert, BLO_readfile_read_bhead(), FD_FLAGS_IS_MEMFILE, FD_FLAGS_SWITCH_ENDIAN, FileData::file, BHeadN::file_offset, FileData::flags, get_bhead(), BHeadN::has_data, FileData::is_eof, BHeadN::is_memchunk_identical, BHead::len, MEM_freeN(), MEM_mallocN(), BHeadN::next, FileReader::offset, BHeadN::prev, FileReader::read, FileReader::seek, and UNLIKELY.
Referenced by blo_bhead_first(), blo_bhead_next(), and get_bhead().
|
static |
Definition at line 5100 of file readfile.cc.
References BKE_main_lists_get(), BLO_readfile_id_runtime_tags(), has_linked_ids_to_read(), ID_FLAG_INDIRECT_WEAK_LINK, ID_Readfile_Data::Tags::is_link_placeholder, and LISTBASE_FOREACH.
Referenced by has_linked_ids_to_read(), and read_libraries().
|
static |
Check if the file's FileGlobal::minversion requires a newer Blender to open.
Should only be called after read_file_dna was successfully executed.
Definition at line 1199 of file readfile.cc.
References BKE_blender_version_blendfile_string_from_values(), BKE_reportf(), BLENDER_FILE_SUBVERSION, BLENDER_FILE_VERSION, BLI_assert, blo_bhead_first(), blo_bhead_next(), BLO_CODE_GLOB, CLOG_WARN, FileData::filesdna, FileData::fileversion, INDEX_ID_NULL, is_minversion_older_than_blender(), LOG, MEM_freeN(), FileGlobal::minsubversion, FileGlobal::minversion, read_struct_and_validate_size(), FileData::relabase, reports, RPT_ERROR, and FileGlobal::subversion.
Referenced by blo_decode_and_check(), and is_minversion_older_than_blender().
Definition at line 3655 of file readfile.cc.
References after_liblink_id_process(), BKE_idtype_get_info_from_id(), BKE_library_foreach_ID_link(), IDTypeInfo::blend_read_undo_preserve, BLI_assert, BLO_readfile_id_runtime_tags(), BLO_readfile_id_runtime_tags_for_write(), FD_FLAGS_IS_MEMFILE, FileData::flags, FOREACH_MAIN_ID_BEGIN, FOREACH_MAIN_ID_END, ID_TAG_UNDO_OLD_ID_REUSED_NOUNDO, ID_TAG_UNDO_OLD_ID_REUSED_UNCHANGED, IDWALK_DO_DEPRECATED_POINTERS, IDWALK_INCLUDE_UI, IDWALK_NO_ORIG_POINTERS_ACCESS, IDWALK_NOP, lib_link_all(), lib_link_cb(), ID_Readfile_Data::Tags::needs_linking, ID::orig_id, and ID::tag.
Referenced by blo_read_file_internal(), lib_link_all(), library_link_end(), and read_libraries().
|
static |
Definition at line 3627 of file readfile.cc.
References BLO_read_get_new_id_address(), LibraryIDLinkCallbackData::cb_flag, ID_IS_LINKED, LibraryIDLinkCallbackData::id_pointer, IDWALK_CB_EMBEDDED, IDWALK_CB_EMBEDDED_NOT_OWNING, IDWALK_CB_READFILE_IGNORE, IDWALK_RET_NOP, lib_link_cb(), LibraryIDLinkCallbackData::owner_id, and LibraryIDLinkCallbackData::user_data.
Referenced by lib_link_all(), and lib_link_cb().
|
static |
Definition at line 2579 of file readfile.cc.
References BLI_listbase_count(), CLOG_WARN, Scene::flag, Scene::id, lib_link_scenes_check_set(), LISTBASE_FOREACH, LOG, ID::name, SCE_READFILE_LIBLINK_NEED_SETSCENE_CHECK, Main::scenes, and UNUSED_VARS.
Referenced by after_liblink_merged_bmain_process(), and lib_link_scenes_check_set().
|
static |
Definition at line 2605 of file readfile.cc.
References Library::filepath, and library_filepath_is_valid().
Referenced by direct_link_library(), library_filepath_is_valid(), and read_library_struct().
Definition at line 4506 of file readfile.cc.
References 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, Main::id_map, library_id_is_yet_read(), MAIN_IDMAP_TYPE_NAME, offsetof, and which_libbase().
Referenced by expand_doit_library(), library_id_is_yet_read(), link_named_part(), and read_libblock_undo_restore_linked().
|
static |
Definition at line 4834 of file readfile.cc.
References BKE_main_blendfile_path(), BLI_assert, blo_find_main(), blo_split_main(), Main::curlib, FileData::fileversion, FileData::id_tag_extra, ID_TAG_TEMP_MAIN, library_link_begin(), FileData::mainlist, MEM_callocN(), read_file_bhead_idname_map_create(), read_file_version(), Library::runtime, and Main::versionfile.
Referenced by BLO_library_link_begin(), and library_link_begin().
|
static |
Definition at line 4926 of file readfile.cc.
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_collections_parent_relations_rebuild(), 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(), BLO_expand_main(), blo_filedata_free(), blo_join_main(), BLO_LIBLINK_COLLECTION_NO_HIERARCHY_REBUILD, blo_read_file_checks(), blo_split_main(), Main::curlib, do_versions_after_linking(), expand_doit_library(), FD_FLAGS_SWITCH_ENDIAN, FILE_RELPATH, Library::filepath, fix_relpaths_library(), Main::has_forward_compatibility_issues, Main::id_map, ID_TAG_NEW, Main::is_read_invalid, lib_link_all(), library_link_end(), MAIN_IDMAP_TYPE_NAME, FileData::mainlist, MEM_freeN(), Main::next, blender::bke::node_tree_update_all_new(), placeholders_ensure_valid(), read_libraries(), read_libraries_report_invalid_id_names(), reports, Library::runtime, split_main_newid(), STRNCPY(), and Main::versionfile.
Referenced by BLO_library_link_end(), and library_link_end().
|
static |
Definition at line 246 of file readfile.cc.
References library_parent_filepath(), and Library::runtime.
Referenced by library_parent_filepath(), read_library_file_data(), and read_library_linked_id().
Definition at line 2115 of file readfile.cc.
References BLI_listbase_is_empty(), ListBase::first, FileData::globmap, ListBase::last, link_glob_list(), newdataadr(), Link::next, oldnewmap_insert(), and Link::prev.
Referenced by BLO_read_glob_list(), and link_glob_list().
|
static |
Definition at line 3450 of file readfile.cc.
References blo_read_get_new_globaldata_address(), BlendFileData::cur_view_layer, BlendFileData::curscene, BlendFileData::curscreen, ListBase::first, link_global(), BlendFileData::main, newlibadr(), and Main::scenes.
Referenced by blo_read_file_internal(), and link_global().
|
static |
Definition at line 4762 of file readfile.cc.
References BKE_idtype_idcode_is_linkable(), BKE_idtype_idcode_is_valid(), BLI_assert, blo_bhead_is_id_valid_type(), BLO_LIBLINK_FORCE_INDIRECT, BLO_LIBLINK_USE_PLACEHOLDERS, CLOG_WARN, BHead::code, create_placeholder(), find_bhead_from_code_name(), ID_FLAG_INDIRECT_WEAK_LINK, id_sort_by_name(), ID_TAG_EXTERN, FileData::id_tag_extra, ID_TAG_INDIRECT, library_id_is_yet_read(), link_named_part(), LOG, ID::name, ID_Readfile_Data::Tags::needs_expanding, BHead::old, oldnewmap_lib_insert(), read_libblock(), ID::tag, and which_libbase().
Referenced by BLO_library_link_named_part(), and link_named_part().
|
static |
ID names are truncated the their maximum allowed length at a very low level of the readfile code (see read_id_struct).
However, ensuring they remain unique can only be done once all IDs have been read and put in Main.
Definition at line 1014 of file readfile.cc.
References blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_new(), BKE_id_new_name_validate(), BLI_assert, CLOG_INFO, blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::contains(), FOREACH_MAIN_LISTBASE_BEGIN, FOREACH_MAIN_LISTBASE_END, ID_IS_LINKED, LISTBASE_FOREACH_MUTABLE, LOG, long_id_names_ensure_unique_id_names(), and RenameExistingNever.
Referenced by blo_read_file_internal(), and long_id_names_ensure_unique_id_names().
|
static |
Iterate all IDs from Actions and look for non-null terminated ActionSlot.identifier. Also handle slot users (in Action constraint, AnimData, and NLA strips).
This is for forward compatibility, if the blendfile was saved from a version allowing larger MAX_ID_NAME value than the current one (introduced when switching from MAX_ID_NAME = 66 to MAX_ID_NAME = 258).
Definition at line 1056 of file readfile.cc.
References ATTR_FALLTHROUGH, BKE_animdata_from_id(), BLI_str_utf8_truncate_at_size(), BLI_uniquename_cb(), bPose::chanbase, CLOG_INFO, CONSTRAINT_TYPE_ACTION, Object::constraints, FOREACH_MAIN_ID_BEGIN, FOREACH_MAIN_ID_END, blender::bke::nla::foreach_strip_adt(), GS, i, ID_AC, ID_OB, ActionSlot::identifier, AnimData::last_slot_identifier, bActionConstraint::last_slot_identifier, NlaStrip::last_slot_identifier, LISTBASE_FOREACH, LOG, long_id_names_process_action_slots_identifiers(), MAX_ID_NAME, ID::name, Object::pose, bAction::slot_array, bAction::slot_array_num, and AnimData::tmp_last_slot_identifier.
Referenced by blo_read_file_internal(), and long_id_names_process_action_slots_identifiers().
|
static |
Definition at line 1562 of file readfile.cc.
References FileData::datamap, newdataadr(), and oldnewmap_lookup_and_inc().
Referenced by BLO_read_get_new_data_address(), BLO_read_pointer_array(), link_glob_list(), and newdataadr().
|
static |
Only direct data-blocks. Returns the map entry without adding a user, so that a user can be added once the data is verified. Invalid data is then freed along with unused data.
Definition at line 1577 of file readfile.cc.
References FileData::datamap, Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_ptr(), OldNewMap::map, and newdataadr_entry().
Referenced by BLO_read_struct_array_with_size(), BLO_read_struct_list_with_type_size(), blo_read_struct_with_type_size_impl(), and newdataadr_entry().
|
static |
Definition at line 1568 of file readfile.cc.
References FileData::datamap, newdataadr_no_us(), and oldnewmap_lookup_and_inc().
Referenced by BLO_read_get_new_data_address_no_us(), and newdataadr_no_us().
Definition at line 1588 of file readfile.cc.
References FileData::libmap, newlibadr(), and oldnewmap_liblookup().
Referenced by blo_do_versions_newlibadr(), BLO_read_get_new_id_address(), link_global(), and newlibadr().
|
static |
Definition at line 328 of file readfile.cc.
References Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::clear(), OldNewMap::map, MEM_freeN(), oldnewmap_clear(), and Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::values().
Referenced by blo_read_asset_data_block(), oldnewmap_clear(), read_libblock(), and read_userdef().
|
static |
Definition at line 339 of file readfile.cc.
References oldnewmap_free().
Referenced by blo_filedata_free(), oldnewmap_free(), and read_library_file_data().
|
static |
Definition at line 277 of file readfile.cc.
References Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_overwrite(), OldNewMap::map, and oldnewmap_insert().
Referenced by blo_do_versions_oldnewmap_insert(), BLO_read_data_globmap_add(), link_glob_list(), oldnewmap_insert(), oldnewmap_lib_insert(), and read_data_into_datamap().
|
static |
Definition at line 286 of file readfile.cc.
References FileData::libmap, oldnewmap_insert(), and oldnewmap_lib_insert().
Referenced by expand_doit_library(), link_named_part(), oldnewmap_lib_insert(), read_libblock(), read_libblock_undo_restore(), read_libblock_undo_restore_identical(), read_libblock_undo_restore_linked(), and read_undo_move_libmain_data().
|
static |
Definition at line 312 of file readfile.cc.
References ID_IS_LINKED, oldnewmap_liblookup(), and oldnewmap_lookup_and_inc().
Referenced by newlibadr(), and oldnewmap_liblookup().
|
static |
Definition at line 299 of file readfile.cc.
References Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_ptr(), OldNewMap::map, NewAddress::newp, NewAddress::nr, and oldnewmap_lookup_and_inc().
Referenced by blo_read_get_new_globaldata_address(), newdataadr(), newdataadr_no_us(), oldnewmap_liblookup(), and oldnewmap_lookup_and_inc().
|
static |
Definition at line 268 of file readfile.cc.
References oldnewmap_new().
Referenced by filedata_new(), oldnewmap_new(), and read_library_file_data().
Definition at line 2108 of file readfile.cc.
References BLI_assert, FD_FLAGS_IS_MEMFILE, FileData::flags, BHead::len, peek_struct_undo(), and UNUSED_VARS_NDEBUG.
Referenced by peek_struct_undo(), and read_libblock_undo_restore().
|
static |
Definition at line 2751 of file readfile.cc.
References BKE_object_materials_sync_length(), ID_TAG_MISSING, LISTBASE_FOREACH, Main::objects, placeholders_ensure_valid(), and ID::tag.
Referenced by blo_read_file_internal(), library_link_end(), and placeholders_ensure_valid().
|
static |
Definition at line 877 of file readfile.cc.
References FileData::blender_header, BLO_readfile_blender_header_decode(), BlenderHeader::endian, ENDIAN_ORDER, FD_FLAGS_FILE_FUTURE, FD_FLAGS_FILE_OK, FD_FLAGS_FILE_POINTSIZE_IS_4, FD_FLAGS_POINTSIZE_DIFFERS, FD_FLAGS_SWITCH_ENDIAN, FileData::file, BlenderHeader::file_version, FileData::fileversion, FileData::flags, BlenderHeader::pointer_size, and read_blender_header().
Referenced by blo_decode_and_check(), blo_filedata_from_file_minimal(), and read_blender_header().
|
static |
Definition at line 2815 of file readfile.cc.
References blo_bhead_next(), BLO_CODE_DATA, CLOG_ERROR, BHead::code, data, FileData::datamap, LOG, BHead::old, oldnewmap_insert(), read_data_into_datamap(), and read_struct().
Referenced by blo_read_asset_data_block(), read_data_into_datamap(), read_libblock(), and read_userdef().
|
static |
Definition at line 516 of file readfile.cc.
References FileData::bhead_idname_map, BKE_idtype_idcode_is_linkable(), blo_bhead_first(), blo_bhead_id_name(), blo_bhead_is_id_valid_type(), blo_bhead_next(), BLO_CODE_ENDB, and read_file_bhead_idname_map_create().
Referenced by library_link_begin(), read_file_bhead_idname_map_create(), and read_library_file_data().
|
static |
Definition at line 905 of file readfile.cc.
References BLI_assert, BLI_STATIC_ASSERT, blo_bhead_first(), blo_bhead_next(), BLO_CODE_DNA1, BLO_CODE_ENDB, BLO_CODE_GLOB, blo_do_versions_dna(), BHead::code, FileData::compflags, DNA_reconstruct_info_create(), DNA_sdna_alias_data_ensure_structs_map(), DNA_sdna_from_data(), DNA_struct_get_compareflags(), DNA_struct_member_offset_by_name_with_alias(), FD_FLAGS_SWITCH_ENDIAN, FileData::filesdna, FileData::fileversion, FileData::flags, FileData::id_asset_data_offset, FileData::id_name_offset, BHead::len, FileData::memsdna, num, offsetof, read_file_dna(), FileData::reconstruct_info, and FileGlobal::subvstr.
Referenced by blo_decode_and_check(), and read_file_dna().
|
static |
Definition at line 963 of file readfile.cc.
References BLEN_THUMB_MEMSIZE_FILE, BLEN_THUMB_MEMSIZE_IS_VALID, BLI_endian_switch_int32(), blo_bhead_first(), blo_bhead_next(), BLO_CODE_REND, BLO_CODE_TEST, BHead::code, data, FD_FLAGS_SWITCH_ENDIAN, FileData::flags, BHead::len, and read_file_thumbnail().
Referenced by blo_read_file_internal(), BLO_thumbnail_from_file(), and read_file_thumbnail().
Definition at line 463 of file readfile.cc.
References BLENDER_FILE_SUBVERSION, BLENDER_FILE_VERSION, BLI_assert, blo_bhead_first(), blo_bhead_next(), BLO_CODE_ENDB, BLO_CODE_GLOB, BHead::code, FileGlobal::fileflags, FileData::fileversion, G_FILE_ASSET_EDIT_FILE, INDEX_ID_NULL, LIBRARY_IS_ASSET_EDIT_FILE, main, MAIN_VERSION_FILE_OLDER_OR_EQUAL, MEM_freeN(), FileGlobal::minsubversion, FileGlobal::minversion, read_file_version(), read_struct_and_validate_size(), SET_FLAG_FROM_TEST, and FileGlobal::subversion.
Referenced by blo_find_main(), library_link_begin(), read_file_version(), and read_library_file_data().
|
static |
Read the required global (FileGlobal) block.
NOTE: this has to be kept for reading older files, version info is written here too.
Definition at line 3395 of file readfile.cc.
References BLENDER_FILE_SUBVERSION, BLENDER_FILE_VERSION, blo_bhead_next(), blo_readfile_invalidate(), FileGlobal::build_commit_timestamp, Main::build_commit_timestamp, FileGlobal::build_hash, Main::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, G, G_FILE_ASSET_EDIT_FILE, G_FILE_RECOVER_READ, BlendFileData::globalf, FileData::globalf, FileGlobal::globalf, Main::has_forward_compatibility_issues, INDEX_ID_NULL, Main::is_asset_edit_file, BlendFileData::main, MAIN_VERSION_FILE_OLDER_OR_EQUAL, MEM_freeN(), FileGlobal::minsubversion, Main::minsubversionfile, FileGlobal::minversion, Main::minversionfile, read_global(), read_struct_and_validate_size(), FileData::relabase, STRNCPY(), FileGlobal::subversion, and Main::subversionfile.
Referenced by blo_read_file_internal(), and read_global().
|
static |
Definition at line 2069 of file readfile.cc.
References BKE_idtype_get_info_from_idcode(), BLI_str_utf8_truncate_at_size(), blo_readfile_invalidate(), CLOG_INFO, BHead::code, FD_FLAGS_FILE_OK, FD_FLAGS_HAS_INVALID_ID_NAMES, filedata_main(), FileData::flags, GS, ID_LINK_PLACEHOLDER, LOG, MAX_ID_NAME, MEM_allocN_len, MEM_freeN(), ID::name, read_id_struct(), and read_struct().
Referenced by read_id_struct(), read_libblock(), and read_library_struct().
|
static |
Definition at line 3215 of file readfile.cc.
References BKE_id_free_ex(), BKE_idtype_idcode_to_index(), BKE_main_idmap_insert_id(), BLI_addtail(), BLI_remlink(), blo_bhead_next(), BLO_READ_SKIP_UNDO_OLD_MAIN, blo_readfile_invalidate(), CLOG_WARN, BHead::code, FileData::datamap, direct_link_id(), FD_FLAGS_FILE_OK, FD_FLAGS_IS_MEMFILE, filedata_main(), ID::flag, FileData::flags, get_alloc_name(), GS, ID_FLAG_INDIRECT_WEAK_LINK, ID_LINK_PLACEHOLDER, ID_TAG_EXTERN, ID_TAG_INDIRECT, ID_TAG_NEW, ID_Readfile_Data::Tags::is_link_placeholder, LIB_ID_FREE_NO_DEG_TAG, LIB_ID_FREE_NO_MAIN, LIB_ID_FREE_NO_UI_USER, LIB_ID_FREE_NO_USER_REFCOUNT, FileData::libmap, LOG, Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_ptr(), main, OldNewMap::map, MEM_freeN(), ID::name, ID_Readfile_Data::Tags::needs_linking, FileData::new_idmap_uid, NewAddress::newp, BHead::old, oldnewmap_clear(), oldnewmap_lib_insert(), read_data_into_datamap(), read_id_struct(), read_libblock(), read_libblock_undo_restore(), read_libblock_undo_restore_at_old_address(), Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::remove(), FileData::skip_flags, and which_libbase().
Referenced by blo_read_file_internal(), expand_doit_library(), link_named_part(), read_libblock(), and read_library_linked_id().
Definition at line 2841 of file readfile.cc.
References BHEADN_FROM_BHEAD, blo_bhead_next(), BLO_CODE_DATA, BHead::code, BHead::len, and read_libblock_is_identical().
Referenced by read_libblock_is_identical(), and read_libblock_undo_restore().
|
static |
Definition at line 3114 of file readfile.cc.
References BKE_idtype_get_info_from_id(), BKE_main_idmap_lookup_uid(), BLI_assert, BLO_READ_SKIP_UNDO_OLD_MAIN, CLOG_INFO, BHead::code, IDTypeInfo::flags, ID_LI, ID_LINK_PLACEHOLDER, IDTYPE_FLAGS_NO_MEMFILE_UNDO, LOG_UNDO, main, ID::name, FileData::new_idmap_uid, BHead::old, FileData::old_idmap_uid, oldnewmap_lib_insert(), peek_struct_undo(), read_libblock_is_identical(), read_libblock_undo_restore(), read_libblock_undo_restore_identical(), read_libblock_undo_restore_library(), read_libblock_undo_restore_linked(), ID::session_uid, and FileData::skip_flags.
Referenced by read_libblock(), and read_libblock_undo_restore().
|
static |
Definition at line 3072 of file readfile.cc.
References BKE_lib_id_swap_full(), BLI_addtail(), BLI_assert, BLI_remlink(), BLO_READ_SKIP_UNDO_OLD_MAIN, BLO_readfile_id_runtime_tags_for_write(), ListBase::first, GS, ID_REMAP_NO_ORIG_POINTERS_ACCESS, ID_REMAP_SKIP_NEVER_NULL_USAGE, ID_REMAP_SKIP_UPDATE_TAGGING, ID_REMAP_SKIP_USER_CLEAR, ID_REMAP_SKIP_USER_REFCOUNT, ID_TAG_UNDO_OLD_ID_REREAD_IN_PLACE, main, ID::name, ID_Readfile_Data::Tags::needs_linking, new_lb, old_bmain, FileData::old_mainlist, ID::orig_id, read_libblock_undo_restore_at_old_address(), FileData::skip_flags, ID::tag, and which_libbase().
Referenced by read_libblock(), and read_libblock_undo_restore_at_old_address().
|
static |
Definition at line 3024 of file readfile.cc.
References BKE_main_idmap_insert_id(), BLI_addtail(), BLI_assert, BLI_remlink(), BLO_READ_SKIP_UNDO_OLD_MAIN, BHead::code, direct_link_id_restore_recalc_exceptions(), ListBase::first, GS, ID_FAKE_USERS, ID_OB, ID_TAG_KEEP_ON_UNDO, ID_TAG_UNDO_OLD_ID_REUSED_UNCHANGED, ID::lib, main, Object::mode, ID::name, FileData::new_idmap_uid, new_lb, ID::newid, OB_MODE_EDIT, BHead::old, old_bmain, FileData::old_mainlist, oldnewmap_lib_insert(), ID::orig_id, read_libblock_undo_restore_identical(), ID::recalc, ID::recalc_after_undo_push, FileData::skip_flags, ID::tag, ID::us, and which_libbase().
Referenced by read_libblock_undo_restore(), and read_libblock_undo_restore_identical().
|
static |
Definition at line 2927 of file readfile.cc.
References CLOG_INFO, Main::curlib, ListBase::first, Library::id, LOG_UNDO, ID::name, Main::next, FileData::old_mainlist, read_libblock_undo_restore_library(), read_undo_move_libmain_data(), and Library::runtime.
Referenced by read_libblock_undo_restore(), and read_libblock_undo_restore_library().
|
static |
Definition at line 2975 of file readfile.cc.
References BKE_main_idmap_lookup_uid(), BLI_assert, CLOG_INFO, Main::curlib, Library::filepath, GS, Library::id, library_id_is_yet_read(), LOG_UNDO, ID::name, FileData::new_idmap_uid, BHead::old, oldnewmap_lib_insert(), read_libblock_undo_restore_linked(), and ID::session_uid.
Referenced by read_libblock_undo_restore(), and read_libblock_undo_restore_linked().
Definition at line 5383 of file readfile.cc.
References add_main_to_main(), BKE_main_free(), BKE_main_idmap_create(), BKE_main_new(), BLI_SCOPED_DEFER, BLO_expand_main(), blo_readfile_invalidate(), CLOG_INFO, do_versions(), expand_doit_library(), FD_FLAGS_FILE_OK, ListBase::first, FileData::flags, has_linked_ids_to_read(), Main::is_read_invalid, lib_link_all(), LOG, MAIN_IDMAP_TYPE_NAME, Main::next, read_libraries(), read_libraries_free_placeholders(), read_library_clear_weak_links(), read_library_file_data(), read_library_linked_ids(), and split_main_newid().
Referenced by blo_read_file_internal(), library_link_end(), and read_libraries().
Free link placeholders not replaced by real data-blocks, after reading libraries failed. They are only ID structs, which can't be freed like regular IDs.
Definition at line 5362 of file readfile.cc.
References BKE_main_idmap_remove_id(), BKE_main_lists_get(), BLI_remlink(), BLO_readfile_id_runtime_data_free(), BLO_readfile_id_runtime_tags(), change_link_placeholder_to_real_ID_pointer(), ListBase::first, ID_Readfile_Data::Tags::is_link_placeholder, LISTBASE_FOREACH_MUTABLE, MEM_freeN(), Main::next, and read_libraries_free_placeholders().
Referenced by blo_read_file_internal(), read_libraries(), and read_libraries_free_placeholders().
|
static |
Definition at line 4523 of file readfile.cc.
References BKE_reportf(), FD_FLAGS_HAS_INVALID_ID_NAMES, FileData::flags, read_libraries_report_invalid_id_names(), reports, RPT_ERROR, and RPT_WARNING.
Referenced by library_link_end(), read_libraries_report_invalid_id_names(), and read_library_linked_ids().
|
static |
Definition at line 5253 of file readfile.cc.
References BKE_main_lists_get(), BLI_freelinkN(), BLO_readfile_id_runtime_tags(), change_link_placeholder_to_real_ID_pointer(), CLOG_INFO, ID::flag, ID_FLAG_INDIRECT_WEAK_LINK, ID_Readfile_Data::Tags::is_link_placeholder, LOG, ID::name, and read_library_clear_weak_links().
Referenced by read_libraries(), and read_library_clear_weak_links().
|
static |
Definition at line 5279 of file readfile.cc.
References blo_filedata_from_file(), blo_filedata_from_memory(), BLO_reportf_wrap(), BlendFileReadReport::count, Main::curlib, Library::filepath, FileData::fileversion, Library::id, ID_TAG_MISSING, FileData::libmap, library_parent_filepath(), FileData::mainlist, oldnewmap_free(), oldnewmap_new(), Library::packedfile, pf, read_file_bhead_idname_map_create(), read_file_version(), read_library_file_data(), FileData::relabase, FileData::reports, RPT_, RPT_INFO, Library::runtime, STRNCPY(), Main::subversionfile, ID::tag, and Main::versionfile.
Referenced by read_libraries(), and read_library_file_data().
|
static |
Definition at line 5117 of file readfile.cc.
References BKE_idtype_idcode_is_linkable(), BKE_idtype_idcode_to_name(), BLO_readfile_id_runtime_tags(), BLO_readfile_id_runtime_tags_for_write(), BLO_reportf_wrap(), CLOG_INFO, BlendFileReadReport::count, create_placeholder(), Main::curlib, find_bhead_from_idname(), GS, ID_FLAG_INDIRECT_WEAK_LINK, ID_TAG_EXTERN, ID_Readfile_Data::Tags::is_link_placeholder, library_parent_filepath(), LOG, ID::name, ID_Readfile_Data::Tags::needs_expanding, ID::override_library, read_libblock(), read_library_linked_id(), FileData::reports, RPT_, RPT_ERROR, Library::runtime, and ID::tag.
Referenced by read_library_linked_id(), and read_library_linked_ids().
|
static |
Definition at line 5173 of file readfile.cc.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_overwrite(), BKE_main_idmap_remove_id(), BKE_main_lists_get(), BLI_remlink(), BLO_readfile_id_runtime_data_free(), BLO_readfile_id_runtime_tags(), blo_readfile_invalidate(), change_link_placeholder_to_real_ID_pointer(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::clear(), Main::curlib, FD_FLAGS_FILE_OK, ID::flag, FileData::flags, Main::has_forward_compatibility_issues, ID_FLAG_INDIRECT_WEAK_LINK, Main::id_map, ID_Readfile_Data::Tags::is_link_placeholder, Main::is_read_invalid, blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_default(), MEM_freeN(), ID::name, read_libraries_report_invalid_id_names(), read_library_linked_id(), read_library_linked_ids(), ID_Runtime::readfile_data, BlendFileReadReport::reports, FileData::reports, ID::runtime, and Library::runtime.
Referenced by read_libraries(), and read_library_linked_ids().
Definition at line 4422 of file readfile.cc.
References blo_readfile_invalidate(), FD_FLAGS_FILE_OK, filedata_main(), FileData::flags, GS, ID_LI, INDEX_ID_NULL, library_filepath_is_valid(), MEM_freeN(), ID::name, read_id_struct(), and read_library_struct().
Referenced by expand_doit_library(), and read_library_struct().
|
static |
Definition at line 1946 of file readfile.cc.
References BHEADN_FROM_BHEAD, BLI_STATIC_ASSERT, blo_bhead_read_data(), blo_bhead_read_full(), blo_readfile_invalidate(), FileData::compflags, DNA_struct_alignment(), DNA_struct_reconstruct(), DNA_struct_size(), FD_FLAGS_FILE_OK, FD_FLAGS_SWITCH_ENDIAN, filedata_main(), FileData::filesdna, FileData::flags, get_alloc_name(), BHead::len, MEM_freeN(), MEM_mallocN_aligned(), BHead::nr, read_struct(), FileData::reconstruct_info, SDNA_CMP_NOT_EQUAL, SDNA_CMP_REMOVED, SDNA_RAW_DATA_STRUCT_INDEX, BHead::SDNAnr, SDNA::structs_num, switch_endian_structs(), and UNLIKELY.
Referenced by BLO_library_read_struct(), read_data_into_datamap(), read_id_struct(), read_struct(), and read_struct_and_validate_size().
|
static |
Like read_struct, but fails if allocation is smaller than min_size.
Definition at line 2050 of file readfile.cc.
References blo_readfile_invalidate(), data, FD_FLAGS_FILE_OK, filedata_main(), FileData::flags, MEM_allocN_len, MEM_freeN(), read_struct(), and read_struct_and_validate_size().
Referenced by is_minversion_older_than_blender(), read_file_version(), read_global(), read_struct_and_validate_size(), and read_userdef().
|
static |
Definition at line 2903 of file readfile.cc.
References BKE_main_idmap_insert_id(), BLI_addtail(), BLI_remlink(), BLI_remlink_safe(), Main::curlib, FOREACH_MAIN_ID_BEGIN, FOREACH_MAIN_ID_END, GS, Library::id, ID_TAG_UNDO_OLD_ID_REUSED_NOUNDO, Main::libraries, FileData::mainlist, ID::name, FileData::new_idmap_uid, BHead::old, FileData::old_mainlist, oldnewmap_lib_insert(), read_undo_move_libmain_data(), and ID::tag.
Referenced by blo_read_file_internal(), read_libblock_undo_restore_library(), and read_undo_move_libmain_data().
|
static |
Definition at line 3924 of file readfile.cc.
References BKE_library_foreach_ID_link(), ListBase::first, FOREACH_MAIN_ID_BEGIN, FOREACH_MAIN_ID_END, ID_IS_LINKED, ID_TAG_UNDO_OLD_ID_REUSED_NOUNDO, IDWALK_INCLUDE_UI, FileData::mainlist, new_bmain, FileData::new_idmap_uid, read_undo_remap_noundo_data(), read_undo_remap_noundo_data_cb(), and ID::tag.
Referenced by blo_read_file_internal(), and read_undo_remap_noundo_data().
|
static |
Definition at line 3902 of file readfile.cc.
References BKE_main_idmap_lookup_uid(), LibraryIDLinkCallbackData::cb_flag, LibraryIDLinkCallbackData::id_pointer, IDWALK_CB_EMBEDDED, IDWALK_CB_EMBEDDED_NOT_OWNING, IDWALK_RET_NOP, read_undo_remap_noundo_data_cb(), and LibraryIDLinkCallbackData::user_data.
Referenced by read_undo_remap_noundo_data(), and read_undo_remap_noundo_data_cb().
|
static |
Definition at line 2869 of file readfile.cc.
References BKE_idtype_get_info_from_id(), BKE_main_idmap_insert_id(), BKE_main_lists_get(), BLI_assert, BLI_listbase_is_empty(), BLI_listbase_is_single(), BLI_movelisttolist(), ListBase::first, IDTypeInfo::flags, i, IDTypeInfo::id_code, ID_TAG_UNDO_OLD_ID_REUSED_NOUNDO, IDTYPE_FLAGS_NO_MEMFILE_UNDO, LISTBASE_FOREACH, FileData::mainlist, new_bmain, FileData::new_idmap_uid, new_lb, old_bmain, FileData::old_mainlist, read_undo_reuse_noundo_local_ids(), and which_libbase().
Referenced by blo_read_file_internal(), and read_undo_reuse_noundo_local_ids().
|
static |
Read the user-preferences (UserDef) block.
Definition at line 3789 of file readfile.cc.
References UserDef::addons, UserDef::app_template, UserDef::asset_libraries, UserDef::asset_shelves_settings, UserDef::autoexec_paths, BKE_asset_catalog_path_list_blend_read_data(), BKE_preferences_extension_repo_read_data(), BLO_read_struct, BLO_read_struct_list, BLO_read_struct_list_with_type_size(), blo_readfile_invalidate(), FileData::datamap, direct_link_keymapitem(), UserDef::edit_studio_light, UserDef::extension_repos, ListBase::first, IDP_BlendDataRead, INDEX_ID_NULL, UserDef_Runtime::is_dirty, KEYMAP_UPDATE, ListBase::last, LISTBASE_FOREACH, BlendFileData::main, oldnewmap_clear(), bUserMenuItem_Op::prop, read_data_into_datamap(), read_struct_and_validate_size(), read_userdef(), UserDef::runtime, UserDef::script_directories, Main::subversionfile, UserDef::subversionfile, UserDef::themes, bUserMenuItem::type, 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(), and read_userdef().
|
static |
Definition at line 2347 of file readfile.cc.
References MEM_callocN(), and readfile_id_runtime_data_ensure().
Referenced by BLO_readfile_id_runtime_tags_for_write(), direct_link_id_common(), and readfile_id_runtime_data_ensure().
|
static |
Definition at line 4381 of file readfile.cc.
References BHeadSort::bhead, FileData::bheadmap, blo_bhead_first(), blo_bhead_next(), MEM_malloc_arrayN(), BHead::old, BHeadSort::old, sort_bhead_old_map(), FileData::tot_bheadmap, and verg_bheadsort().
Referenced by find_bhead(), and sort_bhead_old_map().
|
static |
Definition at line 389 of file readfile.cc.
References BLI_addtail(), BLI_remlink(), CLOG_ERROR, Main::curlib, ListBase::first, GS, LOG, split_libdata(), and which_libbase().
Referenced by blo_split_main(), and split_libdata().
Definition at line 4903 of file readfile.cc.
References BKE_main_lists_get(), BLI_addtail(), BLI_listbase_clear(), BLI_remlink(), Main::curlib, Main::filepath, i, ID_TAG_NEW, LISTBASE_FOREACH_MUTABLE, split_main_newid(), STRNCPY(), Main::subversionfile, and Main::versionfile.
Referenced by library_link_end(), read_libraries(), and split_main_newid().
Definition at line 1846 of file readfile.cc.
References data, DNA_struct_size(), DNA_struct_switch_endian(), BHead::nr, BHead::SDNAnr, and switch_endian_structs().
Referenced by read_struct(), and switch_endian_structs().
|
static |
Definition at line 3769 of file readfile.cc.
References user_menu_item_struct_size(), USER_MENU_TYPE_MENU, USER_MENU_TYPE_OPERATOR, USER_MENU_TYPE_PROP, and USER_MENU_TYPE_SEP.
Referenced by user_menu_item_struct_size().
|
static |
Definition at line 4367 of file readfile.cc.
References BHeadSort::old, v2, and verg_bheadsort().
Referenced by find_bhead(), sort_bhead_old_map(), and verg_bheadsort().
|
static |
Definition at line 181 of file readfile.cc.
|
static |
Definition at line 182 of file readfile.cc.
Referenced by blo_read_file_internal(), read_libblock_undo_restore(), read_libblock_undo_restore_library(), and read_libblock_undo_restore_linked().