Files
test2/source/blender/blenloader/intern/versioning_dna.c
Sergey Sharybin c1bc70b711 Cleanup: Add a copyright notice to files and use SPDX format
A lot of files were missing copyright field in the header and
the Blender Foundation contributed to them in a sense of bug
fixing and general maintenance.

This change makes it explicit that those files are at least
partially copyrighted by the Blender Foundation.

Note that this does not make it so the Blender Foundation is
the only holder of the copyright in those files, and developers
who do not have a signed contract with the foundation still
hold the copyright as well.

Another aspect of this change is using SPDX format for the
header. We already used it for the license specification,
and now we state it for the copyright as well, following the
FAQ:

    https://reuse.software/faq/
2023-05-31 16:19:06 +02:00

41 lines
1.4 KiB
C

/* SPDX-FileCopyrightText: 2023 Blender Foundation
*
* SPDX-License-Identifier: GPL-2.0-or-later */
/** \file
* \ingroup blenloader
*
* Apply edits to DNA at load time to behave as if old files were written with new names.
*/
#include "BLI_compiler_attrs.h"
#include "BLI_utildefines.h"
#include "DNA_genfile.h"
#include "DNA_listBase.h"
#include "BLO_readfile.h"
#include "readfile.h"
void blo_do_versions_dna(SDNA *sdna, const int versionfile, const int subversionfile)
{
#define DNA_VERSION_ATLEAST(ver, subver) \
(versionfile > (ver) || (versionfile == (ver) && (subversionfile >= (subver))))
if (!DNA_VERSION_ATLEAST(280, 2)) {
/* Version files created in the 'blender2.8' branch
* between October 2016, and November 2017 (>=280.0 and < 280.2). */
if (versionfile >= 280) {
DNA_sdna_patch_struct(sdna, "SceneLayer", "ViewLayer");
DNA_sdna_patch_struct(sdna, "SceneLayerEngineData", "ViewLayerEngineData");
DNA_sdna_patch_struct_member(sdna, "FileGlobal", "cur_render_layer", "cur_view_layer");
DNA_sdna_patch_struct_member(sdna, "ParticleEditSettings", "scene_layer", "view_layer");
DNA_sdna_patch_struct_member(sdna, "Scene", "active_layer", "active_view_layer");
DNA_sdna_patch_struct_member(sdna, "Scene", "render_layers", "view_layers");
DNA_sdna_patch_struct_member(sdna, "WorkSpace", "render_layer", "view_layer");
}
}
#undef DNA_VERSION_ATLEAST
}