diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-10-10 14:40:38 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-10-10 14:43:11 +0300 |
commit | 4427a67c86450a704bd35b0f7539c0adf152fea2 (patch) | |
tree | 60c1f2751e2e34774bab744724defae6166a1cfc /source | |
parent | 5336555c31b3716f68e4c74f6a047c03c066049c (diff) |
Cleanup: use macro for comparing file versions
Already done in most of the versioning code.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenloader/intern/versioning_250.c | 60 | ||||
-rw-r--r-- | source/blender/blenloader/intern/versioning_260.c | 94 | ||||
-rw-r--r-- | source/blender/blenloader/intern/versioning_280.c | 2 | ||||
-rw-r--r-- | source/blender/blenloader/intern/versioning_legacy.c | 30 |
4 files changed, 93 insertions, 93 deletions
diff --git a/source/blender/blenloader/intern/versioning_250.c b/source/blender/blenloader/intern/versioning_250.c index b1a76c65ce9..5046ee6aab1 100644 --- a/source/blender/blenloader/intern/versioning_250.c +++ b/source/blender/blenloader/intern/versioning_250.c @@ -781,7 +781,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) } } - if (bmain->versionfile < 250 || (bmain->versionfile == 250 && bmain->subversionfile < 1)) { + if (!MAIN_VERSION_ATLEAST(bmain, 250, 1)) { Object *ob; Tex *tex; Scene *sce; @@ -849,7 +849,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) } } - if (bmain->versionfile < 250 || (bmain->versionfile == 250 && bmain->subversionfile < 2)) { + if (!MAIN_VERSION_ATLEAST(bmain, 250, 2)) { Object *ob; for (ob = bmain->objects.first; ob; ob = ob->id.next) { @@ -859,7 +859,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) } } - if (bmain->versionfile < 250 || (bmain->versionfile == 250 && bmain->subversionfile < 4)) { + if (!MAIN_VERSION_ATLEAST(bmain, 250, 4)) { Scene *sce; Object *ob; ParticleSettings *part; @@ -951,7 +951,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) } } - if (bmain->versionfile < 250 || (bmain->versionfile == 250 && bmain->subversionfile < 6)) { + if (!MAIN_VERSION_ATLEAST(bmain, 250, 6)) { Object *ob; /* New variables for axis-angle rotations and/or quaternion rotations were added, @@ -973,7 +973,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) } } - if (bmain->versionfile < 250 || (bmain->versionfile == 250 && bmain->subversionfile < 7)) { + if (!MAIN_VERSION_ATLEAST(bmain, 250, 7)) { Mesh *me; Nurb *nu; Lattice *lt; @@ -1041,7 +1041,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) } } - if (bmain->versionfile < 250 || (bmain->versionfile == 250 && bmain->subversionfile < 8)) { + if (!MAIN_VERSION_ATLEAST(bmain, 250, 8)) { { Scene *sce = bmain->scenes.first; while (sce) { @@ -1139,7 +1139,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) } } - if (bmain->versionfile < 250 || (bmain->versionfile == 250 && bmain->subversionfile < 9)) { + if (!MAIN_VERSION_ATLEAST(bmain, 250, 9)) { Scene *sce; Mesh *me; Object *ob; @@ -1169,7 +1169,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) } } - if (bmain->versionfile < 250 || (bmain->versionfile == 250 && bmain->subversionfile < 10)) { + if (!MAIN_VERSION_ATLEAST(bmain, 250, 10)) { Object *ob; /* properly initialize hair clothsim data on old files */ @@ -1225,7 +1225,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) } } - if (bmain->versionfile < 250 || (bmain->versionfile == 250 && bmain->subversionfile < 11)) { + if (!MAIN_VERSION_ATLEAST(bmain, 250, 11)) { { /* fix for new view type in sequencer */ bScreen *screen; @@ -1271,7 +1271,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) } } - if (bmain->versionfile < 250 || (bmain->versionfile == 250 && bmain->subversionfile < 12)) { + if (!MAIN_VERSION_ATLEAST(bmain, 250, 12)) { Object *ob; Brush *brush; @@ -1333,7 +1333,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) } } - if (bmain->versionfile < 250 || (bmain->versionfile == 250 && bmain->subversionfile < 13)) { + if (!MAIN_VERSION_ATLEAST(bmain, 250, 13)) { /* NOTE: if you do more conversion, be sure to do it outside of this and * increase subversion again, otherwise it will not be correct */ Object *ob; @@ -1359,7 +1359,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) } } - if (bmain->versionfile < 250 || (bmain->versionfile == 250 && bmain->subversionfile < 14)) { + if (!MAIN_VERSION_ATLEAST(bmain, 250, 14)) { /* fix for bad View2D extents for Animation Editors */ bScreen *screen; ScrArea *area; @@ -1391,7 +1391,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) } } - if (bmain->versionfile < 250 || (bmain->versionfile == 250 && bmain->subversionfile < 17)) { + if (!MAIN_VERSION_ATLEAST(bmain, 250, 17)) { Scene *sce; Sequence *seq; @@ -1482,7 +1482,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) } } - if (bmain->versionfile < 252 || (bmain->versionfile == 252 && bmain->subversionfile < 1)) { + if (!MAIN_VERSION_ATLEAST(bmain, 252, 1)) { Brush *brush; Object *ob; Scene *scene; @@ -1540,7 +1540,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) } /* old-track -> constraints (this time we're really doing it!) */ - if (bmain->versionfile < 252 || (bmain->versionfile == 252 && bmain->subversionfile < 2)) { + if (!MAIN_VERSION_ATLEAST(bmain, 252, 2)) { Object *ob; for (ob = bmain->objects.first; ob; ob = ob->id.next) { @@ -1548,7 +1548,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) } } - if (bmain->versionfile < 252 || (bmain->versionfile == 252 && bmain->subversionfile < 5)) { + if (!MAIN_VERSION_ATLEAST(bmain, 252, 5)) { bScreen *screen; /* Image editor scopes */ @@ -1745,7 +1745,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) } /* New Settings */ - if (bmain->versionfile < 252 || (bmain->versionfile == 252 && bmain->subversionfile < 5)) { + if (!MAIN_VERSION_ATLEAST(bmain, 252, 5)) { brush->flag |= BRUSH_SPACE_ATTEN; // explicitly enable adaptive space /* spacing was originally in pixels, convert it to percentage for new version @@ -1786,7 +1786,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) } } - if (bmain->versionfile < 253 || (bmain->versionfile == 253 && bmain->subversionfile < 1)) { + if (!MAIN_VERSION_ATLEAST(bmain, 253, 1)) { Object *ob; for (ob = bmain->objects.first; ob; ob = ob->id.next) { @@ -1832,7 +1832,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) } } - if (bmain->versionfile < 255 || (bmain->versionfile == 255 && bmain->subversionfile < 1)) { + if (!MAIN_VERSION_ATLEAST(bmain, 255, 1)) { Brush *br; ParticleSettings *part; bScreen *screen; @@ -1881,7 +1881,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) } } - if (bmain->versionfile < 255 || (bmain->versionfile == 255 && bmain->subversionfile < 3)) { + if (!MAIN_VERSION_ATLEAST(bmain, 255, 3)) { Object *ob; /* ocean res is now squared, reset old ones - will be massive */ @@ -1934,7 +1934,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) } } - if (bmain->versionfile < 256 || (bmain->versionfile == 256 && bmain->subversionfile < 1)) { + if (!MAIN_VERSION_ATLEAST(bmain, 256, 1)) { /* fix for bones that didn't have arm_roll before */ bArmature *arm; Bone *bone; @@ -1958,7 +1958,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) } } - if (bmain->versionfile < 256 || (bmain->versionfile == 256 && bmain->subversionfile < 2)) { + if (!MAIN_VERSION_ATLEAST(bmain, 256, 2)) { bNodeTree *ntree; bNode *node; bNodeSocket *sock, *gsock; @@ -2041,7 +2041,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) } } - if (bmain->versionfile < 256 || (bmain->versionfile == 256 && bmain->subversionfile < 3)) { + if (!MAIN_VERSION_ATLEAST(bmain, 256, 3)) { bScreen *screen; Brush *brush; Object *ob; @@ -2086,7 +2086,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) } if (0) { - if (bmain->versionfile < 256 || (bmain->versionfile == 256 && bmain->subversionfile < 6)) { + if (!MAIN_VERSION_ATLEAST(bmain, 256, 6)) { for (Mesh *me = bmain->meshes.first; me; me = me->id.next) { /* Vertex normal calculation from legacy 'MFace' has been removed. * update after calculating polygons in file reading code instead. */ @@ -2094,7 +2094,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) } } - if (bmain->versionfile < 256 || (bmain->versionfile == 256 && bmain->subversionfile < 2)) { + if (!MAIN_VERSION_ATLEAST(bmain, 256, 2)) { /* update blur area sizes from 0..1 range to 0..100 percentage */ Scene *scene; bNode *node; @@ -2111,7 +2111,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) } } - if (bmain->versionfile < 258 || (bmain->versionfile == 258 && bmain->subversionfile < 1)) { + if (!MAIN_VERSION_ATLEAST(bmain, 258, 1)) { /* screen view2d settings were not properly initialized T27164. * v2d->scroll caused the bug but best reset other values too * which are in old blend files only. @@ -2158,7 +2158,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) } } - if (bmain->versionfile < 259 || (bmain->versionfile == 259 && bmain->subversionfile < 1)) { + if (!MAIN_VERSION_ATLEAST(bmain, 259, 1)) { { Scene *scene; Sequence *seq; @@ -2247,7 +2247,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) } } - if (bmain->versionfile < 259 || (bmain->versionfile == 259 && bmain->subversionfile < 2)) { + if (!MAIN_VERSION_ATLEAST(bmain, 259, 2)) { { /* Convert default socket values from bNodeStack */ FOREACH_NODETREE_BEGIN (bmain, ntree, id) { @@ -2288,7 +2288,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) } } - if (bmain->versionfile < 259 || (bmain->versionfile == 259 && bmain->subversionfile < 4)) { + if (!MAIN_VERSION_ATLEAST(bmain, 259, 4)) { { /* Adaptive time step for particle systems */ ParticleSettings *part; @@ -2339,7 +2339,7 @@ static void lib_node_do_versions_group_indices(bNode *gnode) void do_versions_after_linking_250(Main *bmain) { - if (bmain->versionfile < 256 || (bmain->versionfile == 256 && bmain->subversionfile < 2)) { + if (!MAIN_VERSION_ATLEAST(bmain, 256, 2)) { FOREACH_NODETREE_BEGIN (bmain, ntree, id) { /* updates external links for all group nodes in a tree */ bNode *node; diff --git a/source/blender/blenloader/intern/versioning_260.c b/source/blender/blenloader/intern/versioning_260.c index d8a19bfa59e..a7c5d7b933c 100644 --- a/source/blender/blenloader/intern/versioning_260.c +++ b/source/blender/blenloader/intern/versioning_260.c @@ -700,7 +700,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - if (bmain->versionfile < 260 || (bmain->versionfile == 260 && bmain->subversionfile < 1)) { + if (!MAIN_VERSION_ATLEAST(bmain, 260, 1)) { Object *ob; for (ob = bmain->objects.first; ob; ob = ob->id.next) { @@ -721,7 +721,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - if (bmain->versionfile < 260 || (bmain->versionfile == 260 && bmain->subversionfile < 2)) { + if (!MAIN_VERSION_ATLEAST(bmain, 260, 2)) { FOREACH_NODETREE_BEGIN (bmain, ntree, id) { if (ntree->type == NTREE_SHADER) { bNode *node; @@ -740,7 +740,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) FOREACH_NODETREE_END; } - if (bmain->versionfile < 260 || (bmain->versionfile == 260 && bmain->subversionfile < 4)) { + if (!MAIN_VERSION_ATLEAST(bmain, 260, 4)) { { /* Convert node angles to radians! */ Scene *sce; @@ -830,7 +830,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - if (bmain->versionfile < 260 || (bmain->versionfile == 260 && bmain->subversionfile < 6)) { + if (!MAIN_VERSION_ATLEAST(bmain, 260, 6)) { Scene *sce; MovieClip *clip; @@ -880,7 +880,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - if (bmain->versionfile < 260 || (bmain->versionfile == 260 && bmain->subversionfile < 8)) { + if (!MAIN_VERSION_ATLEAST(bmain, 260, 8)) { Brush *brush; for (brush = bmain->brushes.first; brush; brush = brush->id.next) { @@ -890,7 +890,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - if (bmain->versionfile < 261 || (bmain->versionfile == 261 && bmain->subversionfile < 1)) { + if (!MAIN_VERSION_ATLEAST(bmain, 261, 1)) { { /* update use flags for node sockets (was only temporary before) */ Scene *sce; @@ -975,7 +975,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - if (bmain->versionfile < 261 || (bmain->versionfile == 261 && bmain->subversionfile < 2)) { + if (!MAIN_VERSION_ATLEAST(bmain, 261, 2)) { { /* convert deprecated sculpt_paint_unified_* fields to * UnifiedPaintSettings */ @@ -991,7 +991,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - if (bmain->versionfile < 261 || (bmain->versionfile == 261 && bmain->subversionfile < 3)) { + if (!MAIN_VERSION_ATLEAST(bmain, 261, 3)) { { /* convert extended ascii to utf-8 for text editor */ Text *text; @@ -1068,7 +1068,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - if (bmain->versionfile < 262 || (bmain->versionfile == 262 && bmain->subversionfile < 1)) { + if (!MAIN_VERSION_ATLEAST(bmain, 262, 1)) { /* update use flags for node sockets (was only temporary before) */ Scene *sce; bNodeTree *ntree; @@ -1095,7 +1095,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - if (bmain->versionfile < 262 || (bmain->versionfile == 262 && bmain->subversionfile < 2)) { + if (!MAIN_VERSION_ATLEAST(bmain, 262, 2)) { /* Set new idname of keyingsets from their now "label-only" name. */ Scene *scene; for (scene = bmain->scenes.first; scene; scene = scene->id.next) { @@ -1108,7 +1108,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - if (bmain->versionfile < 262 || (bmain->versionfile == 262 && bmain->subversionfile < 3)) { + if (!MAIN_VERSION_ATLEAST(bmain, 262, 3)) { Object *ob; ModifierData *md; @@ -1122,7 +1122,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - if (bmain->versionfile < 262 || (bmain->versionfile == 262 && bmain->subversionfile < 4)) { + if (!MAIN_VERSION_ATLEAST(bmain, 262, 4)) { /* Read Viscosity presets from older files */ Object *ob; @@ -1152,7 +1152,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 1)) { + if (!MAIN_VERSION_ATLEAST(bmain, 263, 1)) { /* file output node paths are now stored in the file info struct instead socket name */ Scene *sce; bNodeTree *ntree; @@ -1167,7 +1167,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 3)) { + if (!MAIN_VERSION_ATLEAST(bmain, 263, 3)) { Scene *scene; Brush *brush; @@ -1188,7 +1188,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 2)) { + if (!MAIN_VERSION_ATLEAST(bmain, 263, 2)) { bScreen *screen; for (screen = bmain->screens.first; screen; screen = screen->id.next) { @@ -1223,7 +1223,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 4)) { + if (!MAIN_VERSION_ATLEAST(bmain, 263, 4)) { Camera *cam; Curve *cu; @@ -1242,7 +1242,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 5)) { + if (!MAIN_VERSION_ATLEAST(bmain, 263, 5)) { { /* file output node paths are now stored in the file info struct instead socket name */ Scene *sce; @@ -1261,7 +1261,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 6)) { + if (!MAIN_VERSION_ATLEAST(bmain, 263, 6)) { /* update use flags for node sockets (was only temporary before) */ Scene *sce; Material *mat; @@ -1304,7 +1304,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 7)) { + if (!MAIN_VERSION_ATLEAST(bmain, 263, 7)) { Object *ob; for (ob = bmain->objects.first; ob; ob = ob->id.next) { @@ -1322,7 +1322,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 9)) { + if (!MAIN_VERSION_ATLEAST(bmain, 263, 9)) { FOREACH_NODETREE_BEGIN (bmain, ntree, id) { if (ntree->type == NTREE_SHADER) { bNode *node; @@ -1340,7 +1340,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) FOREACH_NODETREE_END; } - if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 10)) { + if (!MAIN_VERSION_ATLEAST(bmain, 263, 10)) { { Scene *scene; /* composite redesign */ @@ -1399,7 +1399,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 11)) { + if (!MAIN_VERSION_ATLEAST(bmain, 263, 11)) { MovieClip *clip; for (clip = bmain->movieclips.first; clip; clip = clip->id.next) { @@ -1414,7 +1414,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 13)) { + if (!MAIN_VERSION_ATLEAST(bmain, 263, 13)) { FOREACH_NODETREE_BEGIN (bmain, ntree, id) { if (ntree->type == NTREE_COMPOSIT) { bNode *node; @@ -1432,7 +1432,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) FOREACH_NODETREE_END; } - if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 14)) { + if (!MAIN_VERSION_ATLEAST(bmain, 263, 14)) { ParticleSettings *part; FOREACH_NODETREE_BEGIN (bmain, ntree, id) { @@ -1461,7 +1461,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 17)) { + if (!MAIN_VERSION_ATLEAST(bmain, 263, 17)) { FOREACH_NODETREE_BEGIN (bmain, ntree, id) { if (ntree->type == NTREE_COMPOSIT) { bNode *node; @@ -1482,7 +1482,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) FOREACH_NODETREE_END; } - if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 18)) { + if (!MAIN_VERSION_ATLEAST(bmain, 263, 18)) { Scene *scene; for (scene = bmain->scenes.first; scene; scene = scene->id.next) { @@ -1518,7 +1518,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } /* color management pipeline changes compatibility code */ - if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 19)) { + if (!MAIN_VERSION_ATLEAST(bmain, 263, 19)) { Scene *scene; Image *ima; bool colormanagement_disabled = false; @@ -1556,14 +1556,14 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 20)) { + if (!MAIN_VERSION_ATLEAST(bmain, 263, 20)) { Key *key; for (key = bmain->shapekeys.first; key; key = key->id.next) { blo_do_versions_key_uidgen(key); } } - if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 21)) { + if (!MAIN_VERSION_ATLEAST(bmain, 263, 21)) { { Mesh *me; for (me = bmain->meshes.first; me; me = me->id.next) { @@ -1589,7 +1589,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - if (bmain->versionfile < 264 || (bmain->versionfile == 264 && bmain->subversionfile < 1)) { + if (!MAIN_VERSION_ATLEAST(bmain, 264, 1)) { FOREACH_NODETREE_BEGIN (bmain, ntree, id) { if (ntree->type == NTREE_SHADER) { bNode *node; @@ -1603,7 +1603,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) FOREACH_NODETREE_END; } - if (bmain->versionfile < 264 || (bmain->versionfile == 264 && bmain->subversionfile < 2)) { + if (!MAIN_VERSION_ATLEAST(bmain, 264, 2)) { MovieClip *clip; for (clip = bmain->movieclips.first; clip; clip = clip->id.next) { @@ -1620,7 +1620,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - if (bmain->versionfile < 264 || (bmain->versionfile == 264 && bmain->subversionfile < 3)) { + if (!MAIN_VERSION_ATLEAST(bmain, 264, 3)) { /* smoke branch */ { Object *ob; @@ -1683,7 +1683,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - if (bmain->versionfile < 264 || (bmain->versionfile == 264 && bmain->subversionfile < 5)) { + if (!MAIN_VERSION_ATLEAST(bmain, 264, 5)) { /* set a unwrapping margin and ABF by default */ Scene *scene; @@ -1695,7 +1695,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - if (bmain->versionfile < 264 || (bmain->versionfile == 264 && bmain->subversionfile < 6)) { + if (!MAIN_VERSION_ATLEAST(bmain, 264, 6)) { /* Fix for bug T32982, internal_links list could get corrupted from r51630 onward. * Simply remove bad internal_links lists to avoid NULL pointers. */ @@ -1715,7 +1715,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) FOREACH_NODETREE_END; } - if (bmain->versionfile < 264 || (bmain->versionfile == 264 && bmain->subversionfile < 7)) { + if (!MAIN_VERSION_ATLEAST(bmain, 264, 7)) { /* convert tiles size from resolution and number of tiles */ { Scene *scene; @@ -1739,7 +1739,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - if (bmain->versionfile < 264 || (bmain->versionfile == 264 && bmain->subversionfile < 7)) { + if (!MAIN_VERSION_ATLEAST(bmain, 264, 7)) { MovieClip *clip; for (clip = bmain->movieclips.first; clip; clip = clip->id.next) { @@ -1758,7 +1758,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - if (bmain->versionfile < 265 || (bmain->versionfile == 265 && bmain->subversionfile < 3)) { + if (!MAIN_VERSION_ATLEAST(bmain, 265, 3)) { bScreen *screen; for (screen = bmain->screens.first; screen; screen = screen->id.next) { ScrArea *area; @@ -1797,7 +1797,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - if (bmain->versionfile < 265 || (bmain->versionfile == 265 && bmain->subversionfile < 5)) { + if (!MAIN_VERSION_ATLEAST(bmain, 265, 5)) { Scene *scene; Tex *tex; @@ -1858,7 +1858,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } FOREACH_NODETREE_END; } - else if (bmain->versionfile < 266 || (bmain->versionfile == 266 && bmain->subversionfile < 1)) { + else if (!MAIN_VERSION_ATLEAST(bmain, 266, 1)) { /* texture use alpha was removed for 2.66 but added back again for 2.66a, * for compatibility all textures assumed it to be enabled */ Tex *tex; @@ -1870,7 +1870,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - if (bmain->versionfile < 265 || (bmain->versionfile == 265 && bmain->subversionfile < 7)) { + if (!MAIN_VERSION_ATLEAST(bmain, 265, 7)) { Curve *cu; for (cu = bmain->curves.first; cu; cu = cu->id.next) { @@ -1905,14 +1905,14 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - if (MAIN_VERSION_OLDER(bmain, 265, 9)) { + if (!MAIN_VERSION_ATLEAST(bmain, 265, 9)) { Mesh *me; for (me = bmain->meshes.first; me; me = me->id.next) { BKE_mesh_do_versions_cd_flag_init(me); } } - if (MAIN_VERSION_OLDER(bmain, 265, 10)) { + if (!MAIN_VERSION_ATLEAST(bmain, 265, 10)) { Brush *br; for (br = bmain->brushes.first; br; br = br->id.next) { if (br->ob_mode & OB_MODE_TEXTURE_PAINT) { @@ -1922,7 +1922,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } /* add storage for compositor translate nodes when not existing */ - if (MAIN_VERSION_OLDER(bmain, 265, 11)) { + if (!MAIN_VERSION_ATLEAST(bmain, 265, 11)) { FOREACH_NODETREE_BEGIN (bmain, ntree, id) { if (ntree->type == NTREE_COMPOSIT) { bNode *node; @@ -1936,14 +1936,14 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) FOREACH_NODETREE_END; } - if (MAIN_VERSION_OLDER(bmain, 266, 2)) { + if (!MAIN_VERSION_ATLEAST(bmain, 266, 2)) { FOREACH_NODETREE_BEGIN (bmain, ntree, id) { do_versions_nodetree_customnodes(ntree, ((ID *)ntree == id)); } FOREACH_NODETREE_END; } - if (MAIN_VERSION_OLDER(bmain, 266, 2)) { + if (!MAIN_VERSION_ATLEAST(bmain, 266, 2)) { bScreen *screen; for (screen = bmain->screens.first; screen; screen = screen->id.next) { ScrArea *area; @@ -1977,7 +1977,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - if (MAIN_VERSION_OLDER(bmain, 266, 3)) { + if (!MAIN_VERSION_ATLEAST(bmain, 266, 3)) { { /* Fix for a very old issue: * Node names were nominally made unique in r24478 (2.50.8), but the do_versions check @@ -2152,7 +2152,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - if (MAIN_VERSION_OLDER(bmain, 267, 1)) { + if (!MAIN_VERSION_ATLEAST(bmain, 267, 1)) { Object *ob; for (ob = bmain->objects.first; ob; ob = ob->id.next) { diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index dc945038933..c44e9b5efff 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -1665,7 +1665,7 @@ void do_versions_after_linking_280(Main *bmain, ReportList *UNUSED(reports)) BKE_mesh_tessface_clear(me); /* Moved from do_versions because we need updated polygons for calculating normals. */ - if (MAIN_VERSION_OLDER(bmain, 256, 6)) { + if (!MAIN_VERSION_ATLEAST(bmain, 256, 6)) { BKE_mesh_calc_normals(me); } } diff --git a/source/blender/blenloader/intern/versioning_legacy.c b/source/blender/blenloader/intern/versioning_legacy.c index b8d9b92a75d..666806479b2 100644 --- a/source/blender/blenloader/intern/versioning_legacy.c +++ b/source/blender/blenloader/intern/versioning_legacy.c @@ -2150,7 +2150,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) } } - if ((bmain->versionfile < 245) || (bmain->versionfile == 245 && bmain->subversionfile < 2)) { + if (!MAIN_VERSION_ATLEAST(bmain, 245, 2)) { Image *ima; /* initialize 1:1 Aspect */ @@ -2159,7 +2159,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) } } - if ((bmain->versionfile < 245) || (bmain->versionfile == 245 && bmain->subversionfile < 4)) { + if (!MAIN_VERSION_ATLEAST(bmain, 245, 4)) { bArmature *arm; ModifierData *md; Object *ob; @@ -2177,7 +2177,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) } } - if ((bmain->versionfile < 245) || (bmain->versionfile == 245 && bmain->subversionfile < 5)) { + if (!MAIN_VERSION_ATLEAST(bmain, 245, 5)) { /* foreground color needs to be something other then black */ Scene *sce; for (sce = bmain->scenes.first; sce; sce = sce->id.next) { @@ -2187,7 +2187,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) } } - if ((bmain->versionfile < 245) || (bmain->versionfile == 245 && bmain->subversionfile < 6)) { + if (!MAIN_VERSION_ATLEAST(bmain, 245, 6)) { Scene *sce; /* fix frs_sec_base */ for (sce = bmain->scenes.first; sce; sce = sce->id.next) { @@ -2197,7 +2197,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) } } - if ((bmain->versionfile < 245) || (bmain->versionfile == 245 && bmain->subversionfile < 7)) { + if (!MAIN_VERSION_ATLEAST(bmain, 245, 7)) { Object *ob; bPoseChannel *pchan; @@ -2227,7 +2227,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) } } - if ((bmain->versionfile < 245) || (bmain->versionfile == 245 && bmain->subversionfile < 8)) { + if (!MAIN_VERSION_ATLEAST(bmain, 245, 8)) { Scene *sce; Object *ob; PartEff *paf = NULL; @@ -2394,7 +2394,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) } } - if ((bmain->versionfile < 245) || (bmain->versionfile == 245 && bmain->subversionfile < 10)) { + if (!MAIN_VERSION_ATLEAST(bmain, 245, 10)) { Object *ob; /* dupliface scale */ @@ -2403,7 +2403,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) } } - if ((bmain->versionfile < 245) || (bmain->versionfile == 245 && bmain->subversionfile < 11)) { + if (!MAIN_VERSION_ATLEAST(bmain, 245, 11)) { Object *ob; bActionStrip *strip; @@ -2437,7 +2437,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) } } - if ((bmain->versionfile < 245) || (bmain->versionfile == 245 && bmain->subversionfile < 14)) { + if (!MAIN_VERSION_ATLEAST(bmain, 245, 14)) { Scene *sce; Sequence *seq; @@ -2452,7 +2452,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) } /* fix broken group lengths in id properties */ - if ((bmain->versionfile < 245) || (bmain->versionfile == 245 && bmain->subversionfile < 15)) { + if (!MAIN_VERSION_ATLEAST(bmain, 245, 15)) { idproperties_fix_group_lengths(bmain->scenes); idproperties_fix_group_lengths(bmain->libraries); idproperties_fix_group_lengths(bmain->objects); @@ -2481,7 +2481,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) } /* convert fluids to modifier */ - if (bmain->versionfile < 246 || (bmain->versionfile == 246 && bmain->subversionfile < 1)) { + if (!MAIN_VERSION_ATLEAST(bmain, 246, 1)) { Object *ob; for (ob = bmain->objects.first; ob; ob = ob->id.next) { @@ -2502,7 +2502,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) } } - if (bmain->versionfile < 246 || (bmain->versionfile == 246 && bmain->subversionfile < 1)) { + if (!MAIN_VERSION_ATLEAST(bmain, 246, 1)) { Object *ob; for (ob = bmain->objects.first; ob; ob = ob->id.next) { if (ob->pd && (ob->pd->forcefield == PFIELD_WIND)) { @@ -2512,7 +2512,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) } /* set the curve radius interpolation to 2.47 default - easy */ - if (bmain->versionfile < 247 || (bmain->versionfile == 247 && bmain->subversionfile < 6)) { + if (!MAIN_VERSION_ATLEAST(bmain, 247, 6)) { Curve *cu; Nurb *nu; @@ -2532,7 +2532,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) } } - if (bmain->versionfile < 248 || (bmain->versionfile == 248 && bmain->subversionfile < 2)) { + if (!MAIN_VERSION_ATLEAST(bmain, 248, 2)) { Scene *sce; /* Note, these will need to be added for painting */ @@ -2542,7 +2542,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) } } - if (bmain->versionfile < 248 || (bmain->versionfile == 248 && bmain->subversionfile < 3)) { + if (!MAIN_VERSION_ATLEAST(bmain, 248, 3)) { bScreen *screen; /* adjust default settings for Animation Editors */ |