Blender V4.3
versioning_dna.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
11#include "BLI_compiler_attrs.h"
12#include "BLI_utildefines.h"
13
14#include "DNA_genfile.h"
15#include "DNA_listBase.h"
16
17#include "BLO_readfile.hh"
18#include "readfile.hh"
19
20void blo_do_versions_dna(SDNA *sdna, const int versionfile, const int subversionfile)
21{
22#define DNA_VERSION_ATLEAST(ver, subver) \
23 (versionfile > (ver) || (versionfile == (ver) && (subversionfile >= (subver))))
24
25 if (!DNA_VERSION_ATLEAST(280, 2)) {
26 /* Version files created in the 'blender2.8' branch
27 * between October 2016, and November 2017 (>=280.0 and < 280.2). */
28 if (versionfile >= 280) {
29 DNA_sdna_patch_struct_by_name(sdna, "SceneLayer", "ViewLayer");
30 DNA_sdna_patch_struct_by_name(sdna, "SceneLayerEngineData", "ViewLayerEngineData");
32 sdna, "FileGlobal", "cur_render_layer", "cur_view_layer");
34 sdna, "ParticleEditSettings", "scene_layer", "view_layer");
35 DNA_sdna_patch_struct_member_by_name(sdna, "Scene", "active_layer", "active_view_layer");
36 DNA_sdna_patch_struct_member_by_name(sdna, "Scene", "render_layers", "view_layers");
37 DNA_sdna_patch_struct_member_by_name(sdna, "WorkSpace", "render_layer", "view_layer");
38 }
39 }
40
41#undef DNA_VERSION_ATLEAST
42}
external readfile function prototypes.
blenloader genfile private function prototypes
bool DNA_sdna_patch_struct_by_name(struct SDNA *sdna, const char *old_type_name, const char *new_type_name)
bool DNA_sdna_patch_struct_member_by_name(struct SDNA *sdna, const char *type_name, const char *old_member_name, const char *new_member_name)
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)