Blender V4.5
FileData Struct Reference

#include <readfile.hh>

Public Attributes

ListBase bhead_list = {}
enum eFileDataFlag flags = eFileDataFlag(0)
bool is_eof = false
BlenderHeader blender_header = {}
FileReaderfile = nullptr
int undo_direction = 0
char relabase [FILE_MAX] = {}
SDNAfilesdna = nullptr
const SDNAmemsdna = nullptr
const char * compflags = nullptr
DNA_ReconstructInforeconstruct_info = nullptr
int fileversion = 0
int id_name_offset = 0
int id_asset_data_offset = 0
int globalf = 0
int fileflags = 0
eBLOReadSkip skip_flags = BLO_READ_SKIP_NONE
int id_tag_extra = 0
OldNewMapdatamap = nullptr
OldNewMapglobmap = nullptr
OldNewMaplibmap = nullptr
BLOCacheStoragecache_storage = nullptr
BHeadSortbheadmap = nullptr
int tot_bheadmap = 0
std::optional< blender::Map< blender::StringRefNull, BHead * > > bhead_idname_map
ListBasemainlist = nullptr
ListBaseold_mainlist = nullptr
IDNameLib_Mapold_idmap_uid = nullptr
IDNameLib_Mapnew_idmap_uid = nullptr
BlendFileReadReportreports = nullptr
void * storage_handle = nullptr

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 77 of file readfile.hh.

Member Data Documentation

◆ bhead_idname_map

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

◆ bhead_list

ListBase FileData::bhead_list = {}

Linked list of BHeadN's.

Definition at line 79 of file readfile.hh.

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

◆ bheadmap

BHeadSort* FileData::bheadmap = nullptr

Definition at line 142 of file readfile.hh.

Referenced by blo_filedata_free(), find_bhead(), and sort_bhead_old_map().

◆ blender_header

BlenderHeader FileData::blender_header = {}

Definition at line 82 of file readfile.hh.

Referenced by get_bhead(), and read_blender_header().

◆ cache_storage

◆ compflags

const char* FileData::compflags = nullptr

Array of eSDNA_StructCompare.

Definition at line 106 of file readfile.hh.

Referenced by blo_filedata_free(), read_file_dna(), and read_struct().

◆ datamap

◆ file

◆ fileflags

int FileData::fileflags = 0

Definition at line 117 of file readfile.hh.

Referenced by read_global().

◆ filesdna

◆ fileversion

◆ flags

◆ globalf

int FileData::globalf = 0

For do_versions patching.

Definition at line 116 of file readfile.hh.

Referenced by read_global().

◆ globmap

◆ id_asset_data_offset

int 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 114 of file readfile.hh.

Referenced by blo_bhead_id_asset_data_address(), and read_file_dna().

◆ id_name_offset

int FileData::id_name_offset = 0

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

Definition at line 111 of file readfile.hh.

Referenced by blo_bhead_id_name(), and read_file_dna().

◆ id_tag_extra

int FileData::id_tag_extra = 0

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 128 of file readfile.hh.

Referenced by expand_doit_library(), library_link_begin(), and link_named_part().

◆ is_eof

bool FileData::is_eof = false

Definition at line 81 of file readfile.hh.

Referenced by get_bhead().

◆ libmap

OldNewMap* 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 138 of file readfile.hh.

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

◆ mainlist

◆ memsdna

const SDNA* FileData::memsdna = nullptr

◆ new_idmap_uid

IDNameLib_Map* 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 163 of file readfile.hh.

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

◆ old_idmap_uid

IDNameLib_Map* 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 153 of file readfile.hh.

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

◆ old_mainlist

◆ reconstruct_info

DNA_ReconstructInfo* FileData::reconstruct_info = nullptr

Definition at line 107 of file readfile.hh.

Referenced by blo_filedata_free(), read_file_dna(), and read_struct().

◆ relabase

char 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 100 of file readfile.hh.

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

◆ reports

◆ skip_flags

◆ storage_handle

void* FileData::storage_handle = nullptr

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

Definition at line 168 of file readfile.hh.

Referenced by get_alloc_name().

◆ tot_bheadmap

int FileData::tot_bheadmap = 0

Definition at line 143 of file readfile.hh.

Referenced by find_bhead(), and sort_bhead_old_map().

◆ undo_direction

int 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 91 of file readfile.hh.

Referenced by blo_filedata_from_memfile(), and direct_link_id_restore_recalc().


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