2 * ***** BEGIN GPL LICENSE BLOCK *****
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * Contributor(s): Blender Foundation
20 * ***** END GPL LICENSE BLOCK *****
24 /** \file blender/blenloader/intern/versioning_270.c
28 #include "BLI_utildefines.h"
29 #include "BLI_compiler_attrs.h"
31 /* for MinGW32 definition of NULL, could use BLI_blenlib.h instead too */
34 /* allow readfile to use deprecated functionality */
35 #define DNA_DEPRECATED_ALLOW
37 #include "DNA_sdna_types.h"
38 #include "DNA_space_types.h"
39 #include "DNA_screen_types.h"
40 #include "DNA_object_types.h"
41 #include "DNA_modifier_types.h"
42 #include "DNA_sdna_types.h"
44 #include "DNA_genfile.h"
50 #include "BLO_readfile.h"
55 void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
57 if (!MAIN_VERSION_ATLEAST(main, 270, 0)) {
59 if (!DNA_struct_elem_find(fd->filesdna, "BevelModifierData", "float", "profile")) {
62 for (ob = main->object.first; ob; ob = ob->id.next) {
64 for (md = ob->modifiers.first; md; md = md->next) {
65 if (md->type == eModifierType_Bevel) {
66 BevelModifierData *bmd = (BevelModifierData *)md;
68 bmd->val_flags = MOD_BEVEL_AMT_OFFSET;
74 /* nodes don't use fixed node->id any more, clean up */
75 FOREACH_NODETREE(main, ntree, id) {
76 if (ntree->type == NTREE_COMPOSIT) {
78 for (node = ntree->nodes.first; node; node = node->next) {
79 if (ELEM(node->type, CMP_NODE_COMPOSITE, CMP_NODE_OUTPUT_FILE)) {
84 } FOREACH_NODETREE_END
89 for (screen = main->screen.first; screen; screen = screen->id.next) {
91 for (area = screen->areabase.first; area; area = area->next) {
92 SpaceLink *space_link;
93 for (space_link = area->spacedata.first; space_link; space_link = space_link->next) {
94 if (space_link->spacetype == SPACE_CLIP) {
95 SpaceClip *space_clip = (SpaceClip *) space_link;
96 if (space_clip->mode != SC_MODE_MASKEDIT) {
97 space_clip->mode = SC_MODE_TRACKING;
105 if (!DNA_struct_elem_find(fd->filesdna, "MovieTrackingSettings", "float", "default_weight")) {
107 for (clip = main->movieclip.first; clip; clip = clip->id.next) {
108 clip->tracking.settings.default_weight = 1.0f;