Blender V5.3
blender::FileData Struct Reference

#include <readfile.hh>

Public Attributes

ListBaseT< BHeadN > bhead_list = {}
enum eFileDataFlag flags = eFileDataFlag(0)
bool is_eof = false
BlenderHeader blender_header = {}
FileReader * file = nullptr
std::optional< BLI_stat_t > file_stat
int undo_direction = 0
char relabase [FILE_MAX] = {}
std::unique_ptr< SDNA > filesdna
const SDNA * memsdna = nullptr
const char * compflags = nullptr
DNA_ReconstructInfo * reconstruct_info = nullptr
int fileversion = 0
int filesubversion = 0
int id_name_offset = 0
int id_asset_data_offset = 0
int id_flag_offset = 0
int id_deep_hash_offset = 0
int library_filepath_offset = 0
int library_flag_offset = 0
int globalf = 0
int fileflags = 0
eBLOReadSkip skip_flags = BLO_READ_SKIP_NONE
eID_Tag id_tag_extra = {}
OldNewMap * datamap = nullptr
OldNewMap * globmap = nullptr
std::shared_ptr< Map< IDHash, ID * > > id_by_deep_hash
OldNewMap * libmap = nullptr
BLOCacheStorage * cache_storage = nullptr
BHeadSort * bheadmap = nullptr
int tot_bheadmap = 0
std::optional< Map< StringRefNull, BHead * > > bhead_idname_map
Main * bmain = nullptr
Main * old_bmain = nullptr
Main * fd_bmain = nullptr
IDNameLib_Map * old_idmap_uid = nullptr
IDNameLib_Map * new_idmap_uid = nullptr
BlendFileReadReport * reports = nullptr
void * storage_handle = nullptr
bool need_preview_render_restart = false

Detailed Description

General data used during a blend-file reading.

Note that this data (and its accesses) are absolutely not thread-safe currently. It should never be accessed concurrently.

Definition at line 82 of file readfile.hh.

Member Data Documentation

◆ bhead_idname_map

std::optional<Map<StringRefNull, BHead *> > blender::FileData::bhead_idname_map

◆ bhead_list

ListBaseT<BHeadN> blender::FileData::bhead_list = {}

Linked list of BHeadN's.

Definition at line 84 of file readfile.hh.

Referenced by blender::blo_bhead_first(), blender::blo_filedata_free(), and blender::get_bhead().

◆ bheadmap

BHeadSort* blender::FileData::bheadmap = nullptr

◆ blender_header

BlenderHeader blender::FileData::blender_header = {}

Definition at line 87 of file readfile.hh.

Referenced by blender::get_bhead(), and blender::read_blender_header().

◆ bmain

◆ cache_storage

◆ compflags

const char* blender::FileData::compflags = nullptr

◆ datamap

◆ fd_bmain

Main* blender::FileData::fd_bmain = nullptr

The main for the (local) data loaded from this filedata.

This is the same as bmain when opening a blend-file, but not when reading/loading from libraries blend-files.

Definition at line 189 of file readfile.hh.

Referenced by blender::blo_read_file_internal(), blender::library_link_begin(), and blender::read_library_file_data().

◆ file

◆ file_stat

std::optional<BLI_stat_t> blender::FileData::file_stat

◆ fileflags

int blender::FileData::fileflags = 0

Definition at line 141 of file readfile.hh.

Referenced by blender::read_global().

◆ filesdna

◆ filesubversion

int blender::FileData::filesubversion = 0

Unlike the fileversion which is read from the header, this is initialized from #read_file_dna.

Definition at line 122 of file readfile.hh.

Referenced by blender::BLO_blendhandle_get_version(), and blender::read_file_dna().

◆ fileversion

◆ flags

◆ globalf

int blender::FileData::globalf = 0

For do_versions patching.

Definition at line 140 of file readfile.hh.

Referenced by blender::read_global().

◆ globmap

◆ id_asset_data_offset

int blender::FileData::id_asset_data_offset = 0

Used to retrieve asset data from (bhead+1). NOTE: This may not be available in old files, will be -1 then!

Definition at line 130 of file readfile.hh.

Referenced by blender::blo_bhead_id_asset_data_address(), and blender::read_file_dna().

◆ id_by_deep_hash

std::shared_ptr<Map<IDHash, ID *> > blender::FileData::id_by_deep_hash

Used to keep track of already loaded packed IDs to avoid loading them multiple times.

Definition at line 157 of file readfile.hh.

Referenced by blender::filedata_new(), blender::library_id_is_yet_read_deep_hash(), blender::library_link_begin(), blender::read_libblock(), and blender::read_library_file_data().

◆ id_deep_hash_offset

int blender::FileData::id_deep_hash_offset = 0

Definition at line 132 of file readfile.hh.

Referenced by blender::blo_bhead_id_deep_hash(), and blender::read_file_dna().

◆ id_flag_offset

int blender::FileData::id_flag_offset = 0

Definition at line 131 of file readfile.hh.

Referenced by blender::blo_bhead_id_flag(), and blender::read_file_dna().

◆ id_name_offset

int blender::FileData::id_name_offset = 0

Used to retrieve ID names from (bhead+1).

Definition at line 125 of file readfile.hh.

Referenced by blender::blo_bhead_id_name(), and blender::read_file_dna().

◆ id_tag_extra

eID_Tag blender::FileData::id_tag_extra = {}

Tag to apply to all loaded ID data-blocks.

Note
This is initialized from #LibraryLink_Params.id_tag_extra since passing it as an argument would need an additional argument to be passed around when expanding library data.

Definition at line 152 of file readfile.hh.

Referenced by blender::library_link_begin(), blender::link_named_part(), and blender::read_id_in_lib().

◆ is_eof

bool blender::FileData::is_eof = false

Definition at line 86 of file readfile.hh.

Referenced by blender::get_bhead().

◆ libmap

OldNewMap* blender::FileData::libmap = nullptr

Store mapping from old ID pointers (the values they have in the .blend file) to new ones, typically from value in bhead->old to address in memory where the ID was read. Used during library-linking process (see #lib_link_all).

Definition at line 164 of file readfile.hh.

Referenced by blender::blo_do_versions_pre250(), blender::blo_filedata_free(), blender::change_ID_pointer_to_real_ID_pointer_fd(), blender::change_link_placeholder_to_real_ID_pointer_fd(), blender::filedata_new(), blender::newlibadr(), blender::oldnewmap_lib_insert(), blender::read_libblock(), and blender::read_library_file_data().

◆ library_filepath_offset

int blender::FileData::library_filepath_offset = 0

Gives access to libraries' filepath and flag, useful for introspection of blendfiles' dependencies without having to fully read them.

Definition at line 137 of file readfile.hh.

Referenced by blender::blo_bhead_library_filepath(), and blender::read_file_dna().

◆ library_flag_offset

int blender::FileData::library_flag_offset = 0

Definition at line 138 of file readfile.hh.

Referenced by blender::blo_bhead_library_flag(), and blender::read_file_dna().

◆ memsdna

◆ need_preview_render_restart

bool blender::FileData::need_preview_render_restart = false

Set when reading a file from undo with incomplete preview, to trigger restart of preview jobs.

Definition at line 216 of file readfile.hh.

Referenced by blender::BLO_read_data_set_need_preview_render_restart(), and blender::blo_read_file_internal().

◆ new_idmap_uid

IDNameLib_Map* blender::FileData::new_idmap_uid = nullptr

IDMap using uids as keys of the IDs read (or moved) in the new main(s).

Used during undo to ensure that the ID pointers from the 'no undo' IDs remain valid (these IDs are re-used from old main even if their content is not the same as in the memfile undo step, so they could point e.g. to an ID that does not exist in the newly read undo step).

Also used to find current valid pointers (or none) of these 'no undo' IDs existing in read memfile.

Definition at line 206 of file readfile.hh.

Referenced by blender::blo_filedata_free(), blender::blo_read_file_internal(), blender::BLO_read_get_new_id_address_from_session_uid(), blender::read_libblock(), blender::read_libblock_undo_restore(), blender::read_libblock_undo_restore_identical(), blender::read_libblock_undo_restore_linked(), blender::read_undo_libraries_cleanup_unused_ids(), blender::read_undo_move_libmain_data(), blender::read_undo_remap_noundo_data(), and blender::read_undo_reuse_noundo_local_ids().

◆ old_bmain

◆ old_idmap_uid

IDNameLib_Map* blender::FileData::old_idmap_uid = nullptr

IDMap using UID's as keys of all the old IDs in the old bmain. Used during undo to find a matching old data when reading a new ID.

Definition at line 195 of file readfile.hh.

Referenced by blender::blo_filedata_free(), blender::blo_make_old_idmap_from_main(), and blender::read_libblock_undo_restore().

◆ reconstruct_info

DNA_ReconstructInfo* blender::FileData::reconstruct_info = nullptr

◆ relabase

char blender::FileData::relabase[FILE_MAX] = {}

Used for relative paths handling.

Typically the actual filepath of the read blend-file, except when recovering save-on-exit/autosave files. In the latter case, it will be the path of the file that generated the auto-saved one being recovered.

NOTE: Currently expected to be the same path as #BlendFileData.filepath.

Definition at line 108 of file readfile.hh.

Referenced by blender::blo_decode_and_check(), blender::blo_filedata_from_file(), blender::blo_read_file_internal(), blender::BLO_read_from_memfile(), blender::direct_link_library(), blender::do_versions(), blender::expand_doit_library(), blender::is_minversion_older_than_blender(), blender::read_global(), and blender::read_library_file_data().

◆ reports

◆ skip_flags

◆ storage_handle

void* blender::FileData::storage_handle = nullptr

Opaque handle to the storage system used for non-static allocation strings.

Definition at line 211 of file readfile.hh.

Referenced by blender::get_alloc_name().

◆ tot_bheadmap

int blender::FileData::tot_bheadmap = 0

Definition at line 169 of file readfile.hh.

Referenced by blender::find_bhead(), and blender::sort_bhead_old_map().

◆ undo_direction

int blender::FileData::undo_direction = 0

Whether we are undoing (< 0) or redoing (> 0), used to choose which 'unchanged' flag to use to detect unchanged data from memfile. eUndoStepDir.

Definition at line 97 of file readfile.hh.

Referenced by blender::blo_filedata_from_memfile(), and blender::direct_link_id_restore_recalc().


The documentation for this struct was generated from the following file: