diff options
Diffstat (limited to 'source/blender/blenloader/intern/versioning_250.c')
-rw-r--r-- | source/blender/blenloader/intern/versioning_250.c | 103 |
1 files changed, 45 insertions, 58 deletions
diff --git a/source/blender/blenloader/intern/versioning_250.c b/source/blender/blenloader/intern/versioning_250.c index dad86f80813..c86ad639216 100644 --- a/source/blender/blenloader/intern/versioning_250.c +++ b/source/blender/blenloader/intern/versioning_250.c @@ -23,7 +23,7 @@ #else # include "BLI_winstuff.h" # include "winsock2.h" -# include <io.h> // for open close read +# include <io.h> /* for open close read */ # include <zlib.h> /* odd include order-issue */ #endif @@ -65,7 +65,7 @@ #include "BKE_anim_visualization.h" #include "BKE_armature.h" #include "BKE_colortools.h" -#include "BKE_global.h" // for G +#include "BKE_global.h" /* for G */ #include "BKE_lib_id.h" #include "BKE_main.h" #include "BKE_modifier.h" @@ -73,10 +73,11 @@ #include "BKE_particle.h" #include "BKE_pointcache.h" #include "BKE_screen.h" -#include "BKE_sequencer.h" #include "BKE_sound.h" #include "BKE_texture.h" +#include "SEQ_sequencer.h" + #include "NOD_socket.h" #include "BLO_readfile.h" @@ -113,7 +114,7 @@ static void area_add_header_region(ScrArea *area, ListBase *lb) static void sequencer_init_preview_region(ARegion *region) { - // XXX a bit ugly still, copied from space_sequencer + /* XXX a bit ugly still, copied from space_sequencer */ /* NOTE: if you change values here, also change them in space_sequencer.c, sequencer_new */ region->regiontype = RGN_TYPE_PREVIEW; region->alignment = RGN_ALIGN_TOP; @@ -266,7 +267,7 @@ static void area_add_window_regions(ScrArea *area, SpaceLink *sl, ListBase *lb) /* and we split view3d */ switch (sl->spacetype) { case SPACE_VIEW3D: - blo_do_versions_view3d_split_250((View3D *)sl, lb); + BKE_screen_view3d_do_versions_250((View3D *)sl, lb); break; case SPACE_OUTLINER: { @@ -781,7 +782,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; @@ -799,20 +800,6 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) // BLI_freelistN(&pidlist); - if (ob->type == OB_MESH) { - Mesh *me = blo_do_versions_newlibadr(fd, lib, ob->data); - void *olddata = ob->data; - ob->data = me; - - /* XXX - library meshes crash on loading most yoFrankie levels, - * the multires pointer gets invalid - Campbell */ - if (me && me->id.lib == NULL && me->mr && me->mr->level_count > 1) { - multires_load_old(ob, me); - } - - ob->data = olddata; - } - if (ob->totcol && ob->matbits == NULL) { int a; @@ -849,7 +836,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 +846,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 +938,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 +960,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 +1028,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 +1126,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; @@ -1152,7 +1139,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) if (bmain->versionfile == 250 && bmain->subversionfile > 1) { for (me = bmain->meshes.first; me; me = me->id.next) { - multires_load_old_250(me); + CustomData_free_layer_active(&me->fdata, CD_MDISPS, me->totface); } for (ob = bmain->objects.first; ob; ob = ob->id.next) { @@ -1169,7 +1156,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 */ @@ -1179,7 +1166,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) if (md->type == eModifierType_Cloth) { ClothModifierData *clmd = (ClothModifierData *)md; if (clmd->sim_parms->velocity_smooth < 0.01f) { - clmd->sim_parms->velocity_smooth = 0.f; + clmd->sim_parms->velocity_smooth = 0.0f; } } } @@ -1225,7 +1212,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 +1258,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 +1320,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 +1346,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 +1378,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 +1469,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; @@ -1514,9 +1501,9 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) while (node) { if (node->type == CMP_NODE_COLORBALANCE) { NodeColorBalance *n = (NodeColorBalance *)node->storage; - n->lift[0] += 1.f; - n->lift[1] += 1.f; - n->lift[2] += 1.f; + n->lift[0] += 1.0f; + n->lift[1] += 1.0f; + n->lift[2] += 1.0f; } node = node->next; } @@ -1529,9 +1516,9 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) while (node) { if (node->type == CMP_NODE_COLORBALANCE) { NodeColorBalance *n = (NodeColorBalance *)node->storage; - n->lift[0] += 1.f; - n->lift[1] += 1.f; - n->lift[2] += 1.f; + n->lift[0] += 1.0f; + n->lift[1] += 1.0f; + n->lift[2] += 1.0f; } node = node->next; @@ -1540,7 +1527,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 +1535,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 +1732,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 +1773,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 +1819,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; @@ -1849,7 +1836,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) } part->flag &= ~PART_HAIR_REGROW; /* this was a deprecated flag before */ - part->kink_amp_clump = 1.f; /* keep old files looking similar */ + part->kink_amp_clump = 1.0f; /* keep old files looking similar */ } for (screen = bmain->screens.first; screen; screen = screen->id.next) { @@ -1881,7 +1868,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 +1921,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 +1945,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 +2028,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 +2073,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 +2081,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 +2098,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 +2145,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 +2234,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 +2275,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 +2326,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; |