Blender V4.3
versioning_dna.cc File Reference
#include "BLI_compiler_attrs.h"
#include "BLI_utildefines.h"
#include "DNA_genfile.h"
#include "DNA_listBase.h"
#include "BLO_readfile.hh"
#include "readfile.hh"

Go to the source code of this file.

Macros

#define DNA_VERSION_ATLEAST(ver, subver)    (versionfile > (ver) || (versionfile == (ver) && (subversionfile >= (subver))))
 

Functions

void blo_do_versions_dna (SDNA *sdna, const int versionfile, const int subversionfile)
 

Detailed Description

Apply edits to DNA at load time to behave as if old files were written with new names.

Definition in file versioning_dna.cc.

Macro Definition Documentation

◆ DNA_VERSION_ATLEAST

#define DNA_VERSION_ATLEAST ( ver,
subver )    (versionfile > (ver) || (versionfile == (ver) && (subversionfile >= (subver))))

Referenced by blo_do_versions_dna().

Function Documentation

◆ blo_do_versions_dna()

void blo_do_versions_dna ( SDNA * sdna,
int versionfile,
int subversionfile )

Manipulates SDNA before calling DNA_struct_get_compareflags, allowing us to rename structs and struct members.

  • This means older versions of Blender won't have access to this data USE WITH CARE.
  • These changes are applied on file load (run-time), similar to versioning for compatibility.
Attention
ONLY USE THIS KIND OF VERSIONING WHEN dna_rename_defs.h ISN'T SUFFICIENT.

Definition at line 20 of file versioning_dna.cc.

References DNA_sdna_patch_struct_by_name(), DNA_sdna_patch_struct_member_by_name(), and DNA_VERSION_ATLEAST.

Referenced by read_file_dna().