Blender  V3.3
Macros | Functions
versioning_dna.c File Reference
#include "BLI_compiler_attrs.h"
#include "BLI_utildefines.h"
#include "DNA_genfile.h"
#include "DNA_listBase.h"
#include "BLO_readfile.h"
#include "readfile.h"

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.c.

Macro Definition Documentation

◆ DNA_VERSION_ATLEAST

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

Function Documentation

◆ blo_do_versions_dna()

void blo_do_versions_dna ( struct 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 18 of file versioning_dna.c.

References DNA_sdna_patch_struct(), DNA_sdna_patch_struct_member(), and DNA_VERSION_ATLEAST.

Referenced by read_file_dna().