Blender  V3.3
versioning_dna.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
9 #include "BLI_compiler_attrs.h"
10 #include "BLI_utildefines.h"
11 
12 #include "DNA_genfile.h"
13 #include "DNA_listBase.h"
14 
15 #include "BLO_readfile.h"
16 #include "readfile.h"
17 
18 void blo_do_versions_dna(SDNA *sdna, const int versionfile, const int subversionfile)
19 {
20 #define DNA_VERSION_ATLEAST(ver, subver) \
21  (versionfile > (ver) || (versionfile == (ver) && (subversionfile >= (subver))))
22 
23  if (!DNA_VERSION_ATLEAST(280, 2)) {
24  /* Version files created in the 'blender2.8' branch
25  * between October 2016, and November 2017 (>=280.0 and < 280.2). */
26  if (versionfile >= 280) {
27  DNA_sdna_patch_struct(sdna, "SceneLayer", "ViewLayer");
28  DNA_sdna_patch_struct(sdna, "SceneLayerEngineData", "ViewLayerEngineData");
29  DNA_sdna_patch_struct_member(sdna, "FileGlobal", "cur_render_layer", "cur_view_layer");
30  DNA_sdna_patch_struct_member(sdna, "ParticleEditSettings", "scene_layer", "view_layer");
31  DNA_sdna_patch_struct_member(sdna, "Scene", "active_layer", "active_view_layer");
32  DNA_sdna_patch_struct_member(sdna, "Scene", "render_layers", "view_layers");
33  DNA_sdna_patch_struct_member(sdna, "WorkSpace", "render_layer", "view_layer");
34  }
35  }
36 
37 #undef DNA_VERSION_ATLEAST
38 }
external readfile function prototypes.
blenloader genfile private function prototypes
bool DNA_sdna_patch_struct_member(struct SDNA *sdna, const char *struct_name, const char *elem_old, const char *elem_new)
Definition: dna_genfile.c:1719
bool DNA_sdna_patch_struct(struct SDNA *sdna, const char *struct_name_old, const char *struct_name_new)
Definition: dna_genfile.c:1662
These structs are the foundation for all linked lists in the library system.
#define DNA_VERSION_ATLEAST(ver, subver)
void blo_do_versions_dna(SDNA *sdna, const int versionfile, const int subversionfile)