diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-05 18:02:50 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-05 18:02:50 +0300 |
commit | f0d9dbae0dae4deae84824833096c38e625073cb (patch) | |
tree | a9fa826eb5860e9b62d16c3498703bde1bb5d4aa /source/blender/blenloader/intern/versioning_250.c | |
parent | ce6db959c7d96792edad3a6d606e3662a4ef0798 (diff) | |
parent | 481cdb08ed6f33a09d0e6843d1024db93c301178 (diff) |
Merge branch 'master' into blender2.8
Conflicts:
source/blender/blenkernel/intern/blendfile.c
source/blender/blenloader/intern/readfile.h
source/blender/blenloader/intern/versioning_250.c
source/blender/blenloader/intern/versioning_260.c
source/blender/blenloader/intern/versioning_270.c
source/blender/blenloader/intern/versioning_legacy.c
source/blender/editors/render/render_shading.c
source/blender/makesrna/intern/rna_movieclip.c
source/blender/render/intern/source/pipeline.c
source/blender/render/intern/source/voxeldata.c
Diffstat (limited to 'source/blender/blenloader/intern/versioning_250.c')
-rw-r--r-- | source/blender/blenloader/intern/versioning_250.c | 254 |
1 files changed, 127 insertions, 127 deletions
diff --git a/source/blender/blenloader/intern/versioning_250.c b/source/blender/blenloader/intern/versioning_250.c index 3f85011db0b..d51289bee43 100644 --- a/source/blender/blenloader/intern/versioning_250.c +++ b/source/blender/blenloader/intern/versioning_250.c @@ -641,11 +641,11 @@ static void do_versions_socket_default_value_259(bNodeSocket *sock) } } -void blo_do_versions_250(FileData *fd, Library *lib, Main *main) +void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) { /* WATCH IT!!!: pointers from libdata have not been converted */ - if (main->versionfile < 250) { + if (bmain->versionfile < 250) { bScreen *screen; Scene *scene; Base *base; @@ -663,22 +663,22 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) bSound *sound; Sequence *seq; - for (sound = main->sound.first; sound; sound = sound->id.next) { + for (sound = bmain->sound.first; sound; sound = sound->id.next) { if (sound->newpackedfile) { sound->packedfile = sound->newpackedfile; sound->newpackedfile = NULL; } } - for (scene = main->scene.first; scene; scene = scene->id.next) { + for (scene = bmain->scene.first; scene; scene = scene->id.next) { if (scene->ed && scene->ed->seqbasep) { SEQ_BEGIN (scene->ed, seq) { if (seq->type == SEQ_TYPE_SOUND_HD) { char str[FILE_MAX]; BLI_join_dirfile(str, sizeof(str), seq->strip->dir, seq->strip->stripdata->name); - BLI_path_abs(str, main->name); - seq->sound = BKE_sound_new_file(main, str); + BLI_path_abs(str, BKE_main_blendfile_path(bmain)); + seq->sound = BKE_sound_new_file(bmain, str); } #define SEQ_USE_PROXY_CUSTOM_DIR (1 << 19) #define SEQ_USE_PROXY_CUSTOM_FILE (1 << 21) @@ -695,21 +695,21 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) } } - for (screen = main->screen.first; screen; screen = screen->id.next) { + for (screen = bmain->screen.first; screen; screen = screen->id.next) { do_versions_windowmanager_2_50(screen); - do_versions_gpencil_2_50(main, screen); + do_versions_gpencil_2_50(bmain, screen); } /* shader, composite and texture node trees have id.name empty, put something in * to have them show in RNA viewer and accessible otherwise. */ - for (ma = main->mat.first; ma; ma = ma->id.next) { + for (ma = bmain->mat.first; ma; ma = ma->id.next) { if (ma->nodetree && ma->nodetree->id.name[0] == '\0') strcpy(ma->nodetree->id.name, "NTShader Nodetree"); } /* and composite trees */ - for (sce = main->scene.first; sce; sce = sce->id.next) { + for (sce = bmain->scene.first; sce; sce = sce->id.next) { if (sce->nodetree && sce->nodetree->id.name[0] == '\0') strcpy(sce->nodetree->id.name, "NTCompositing Nodetree"); @@ -729,7 +729,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) } /* and texture trees */ - for (tx = main->tex.first; tx; tx = tx->id.next) { + for (tx = bmain->tex.first; tx; tx = tx->id.next) { bNode *node; if (tx->nodetree) { @@ -744,12 +744,12 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) } /* copy standard draw flag to meshes(used to be global, is not available here) */ - for (me = main->mesh.first; me; me = me->id.next) { + for (me = bmain->mesh.first; me; me = me->id.next) { me->drawflag = ME_DRAWEDGES|ME_DRAWFACES|ME_DRAWCREASES; } /* particle draw and render types */ - for (part = main->particle.first; part; part = part->id.next) { + for (part = bmain->particle.first; part; part = part->id.next) { if (part->draw_as) { if (part->draw_as == PART_DRAW_DOT) { part->ren_as = PART_DRAW_HALO; @@ -768,7 +768,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) } /* set old pointcaches to have disk cache flag */ - for (ob = main->object.first; ob; ob = ob->id.next) { + for (ob = bmain->object.first; ob; ob = ob->id.next) { //BKE_ptcache_ids_from_object(&pidlist, ob); @@ -779,7 +779,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) } /* type was a mixed flag & enum. move the 2d flag elsewhere */ - for (cu = main->curve.first; cu; cu = cu->id.next) { + for (cu = bmain->curve.first; cu; cu = cu->id.next) { Nurb *nu; for (nu = cu->nurb.first; nu; nu = nu->next) { @@ -789,7 +789,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) } } - if (main->versionfile < 250 || (main->versionfile == 250 && main->subversionfile < 1)) { + if (bmain->versionfile < 250 || (bmain->versionfile == 250 && bmain->subversionfile < 1)) { Object *ob; Tex *tex; Scene *sce; @@ -797,7 +797,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) //PTCacheID *pid; //ListBase pidlist; - for (ob = main->object.first; ob; ob = ob->id.next) { + for (ob = bmain->object.first; ob; ob = ob->id.next) { //BKE_ptcache_ids_from_object(&pidlist, ob); //for (pid = pidlist.first; pid; pid = pid->next) { @@ -831,12 +831,12 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) } /* texture filter */ - for (tex = main->tex.first; tex; tex = tex->id.next) { + for (tex = bmain->tex.first; tex; tex = tex->id.next) { if (tex->afmax == 0) tex->afmax = 8; } - for (sce = main->scene.first; sce; sce = sce->id.next) { + for (sce = bmain->scene.first; sce; sce = sce->id.next) { ts = sce->toolsettings; if (!ts->uv_selectmode || ts->vgroup_weight == 0.0f) { ts->selectmode = SCE_SELECT_VERTEX; @@ -854,26 +854,26 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) } } - if (main->versionfile < 250 || (main->versionfile == 250 && main->subversionfile < 2)) { + if (bmain->versionfile < 250 || (bmain->versionfile == 250 && bmain->subversionfile < 2)) { Object *ob; - for (ob = main->object.first; ob; ob = ob->id.next) { + for (ob = bmain->object.first; ob; ob = ob->id.next) { if (ob->flag & 8192) // OB_POSEMODE = 8192 ob->mode |= OB_MODE_POSE; } } - if (main->versionfile < 250 || (main->versionfile == 250 && main->subversionfile < 4)) { + if (bmain->versionfile < 250 || (bmain->versionfile == 250 && bmain->subversionfile < 4)) { Scene *sce; Object *ob; ParticleSettings *part; bool do_gravity = false; - for (sce = main->scene.first; sce; sce = sce->id.next) + for (sce = bmain->scene.first; sce; sce = sce->id.next) if (sce->unit.scale_length == 0.0f) sce->unit.scale_length = 1.0f; - for (ob = main->object.first; ob; ob = ob->id.next) { + for (ob = bmain->object.first; ob; ob = ob->id.next) { /* fluid-sim stuff */ FluidsimModifierData *fluidmd = (FluidsimModifierData *) modifiers_findByType(ob, eModifierType_Fluidsim); if (fluidmd) @@ -883,7 +883,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) ob->rotmode = ROT_MODE_EUL; } - for (sce = main->scene.first; sce; sce = sce->id.next) { + for (sce = bmain->scene.first; sce; sce = sce->id.next) { if (sce->audio.main == 0.0f) sce->audio.main = 1.0f; @@ -895,7 +895,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) } /* Add default gravity to scenes */ - for (sce = main->scene.first; sce; sce = sce->id.next) { + for (sce = bmain->scene.first; sce; sce = sce->id.next) { if ((sce->physics_settings.flag & PHYS_GLOBAL_GRAVITY) == 0 && is_zero_v3(sce->physics_settings.gravity)) { @@ -908,11 +908,11 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) /* Assign proper global gravity weights for dynamics (only z-coordinate is taken into account) */ if (do_gravity) { - for (part = main->particle.first; part; part = part->id.next) + for (part = bmain->particle.first; part; part = part->id.next) part->effector_weights->global_gravity = part->acc[2]/-9.81f; } - for (ob = main->object.first; ob; ob = ob->id.next) { + for (ob = bmain->object.first; ob; ob = ob->id.next) { ModifierData *md; if (do_gravity) { @@ -941,11 +941,11 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) } } - if (main->versionfile < 250 || (main->versionfile == 250 && main->subversionfile < 6)) { + if (bmain->versionfile < 250 || (bmain->versionfile == 250 && bmain->subversionfile < 6)) { Object *ob; /* New variables for axis-angle rotations and/or quaternion rotations were added, and need proper initialization */ - for (ob = main->object.first; ob; ob = ob->id.next) { + for (ob = bmain->object.first; ob; ob = ob->id.next) { /* new variables for all objects */ ob->quat[0] = 1.0f; ob->rotAxis[1] = 1.0f; @@ -962,7 +962,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) } } - if (main->versionfile < 250 || (main->versionfile == 250 && main->subversionfile < 7)) { + if (bmain->versionfile < 250 || (bmain->versionfile == 250 && bmain->subversionfile < 7)) { Mesh *me; Nurb *nu; Lattice *lt; @@ -974,7 +974,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) /* shape keys are no longer applied to the mesh itself, but rather * to the derivedmesh/displist, so here we ensure that the basis * shape key is always set in the mesh coordinates. */ - for (me = main->mesh.first; me; me = me->id.next) { + for (me = bmain->mesh.first; me; me = me->id.next) { if ((key = blo_do_versions_newlibadr(fd, lib, me->key)) && key->refkey) { data = key->refkey->data; tot = MIN2(me->totvert, key->refkey->totelem); @@ -984,7 +984,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) } } - for (lt = main->latt.first; lt; lt = lt->id.next) { + for (lt = bmain->latt.first; lt; lt = lt->id.next) { if ((key = blo_do_versions_newlibadr(fd, lib, lt->key)) && key->refkey) { data = key->refkey->data; tot = MIN2(lt->pntsu*lt->pntsv*lt->pntsw, key->refkey->totelem); @@ -994,7 +994,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) } } - for (cu = main->curve.first; cu; cu = cu->id.next) { + for (cu = bmain->curve.first; cu; cu = cu->id.next) { if ((key = blo_do_versions_newlibadr(fd, lib, cu->key)) && key->refkey) { data = key->refkey->data; @@ -1022,9 +1022,9 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) } } - if (main->versionfile < 250 || (main->versionfile == 250 && main->subversionfile < 8)) { + if (bmain->versionfile < 250 || (bmain->versionfile == 250 && bmain->subversionfile < 8)) { { - Scene *sce = main->scene.first; + Scene *sce = bmain->scene.first; while (sce) { if (sce->r.frame_step == 0) sce->r.frame_step = 1; @@ -1039,7 +1039,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) { /* ensure all nodes have unique names */ - bNodeTree *ntree = main->nodetree.first; + bNodeTree *ntree = bmain->nodetree.first; while (ntree) { bNode *node = ntree->nodes.first; @@ -1053,7 +1053,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) } { - Object *ob = main->object.first; + Object *ob = bmain->object.first; while (ob) { /* shaded mode disabled for now */ if (ob->dt == OB_MATERIAL) @@ -1067,7 +1067,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) ScrArea *sa; SpaceLink *sl; - for (screen = main->screen.first; screen; screen = screen->id.next) { + for (screen = bmain->screen.first; screen; screen = screen->id.next) { for (sa = screen->areabase.first; sa; sa = sa->next) { for (sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_VIEW3D) { @@ -1081,10 +1081,10 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) } /* only convert old 2.50 files with color management */ - if (main->versionfile == 250) { - Scene *sce = main->scene.first; - Material *ma = main->mat.first; - Tex *tex = main->tex.first; + if (bmain->versionfile == 250) { + Scene *sce = bmain->scene.first; + Material *ma = bmain->mat.first; + Tex *tex = bmain->tex.first; int i, convert = 0; /* convert to new color management system: @@ -1120,20 +1120,20 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) } } - if (main->versionfile < 250 || (main->versionfile == 250 && main->subversionfile < 9)) { + if (bmain->versionfile < 250 || (bmain->versionfile == 250 && bmain->subversionfile < 9)) { Scene *sce; Mesh *me; Object *ob; - for (sce = main->scene.first; sce; sce = sce->id.next) + for (sce = bmain->scene.first; sce; sce = sce->id.next) if (!sce->toolsettings->particle.selectmode) sce->toolsettings->particle.selectmode = SCE_SELECT_PATH; - if (main->versionfile == 250 && main->subversionfile > 1) { - for (me = main->mesh.first; me; me = me->id.next) + if (bmain->versionfile == 250 && bmain->subversionfile > 1) { + for (me = bmain->mesh.first; me; me = me->id.next) multires_load_old_250(me); - for (ob = main->object.first; ob; ob = ob->id.next) { + for (ob = bmain->object.first; ob; ob = ob->id.next) { MultiresModifierData *mmd = (MultiresModifierData *) modifiers_findByType(ob, eModifierType_Multires); if (mmd) { @@ -1146,11 +1146,11 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) } } - if (main->versionfile < 250 || (main->versionfile == 250 && main->subversionfile < 10)) { + if (bmain->versionfile < 250 || (bmain->versionfile == 250 && bmain->subversionfile < 10)) { Object *ob; /* properly initialize hair clothsim data on old files */ - for (ob = main->object.first; ob; ob = ob->id.next) { + for (ob = bmain->object.first; ob; ob = ob->id.next) { ModifierData *md; for (md = ob->modifiers.first; md; md = md->next) { if (md->type == eModifierType_Cloth) { @@ -1163,14 +1163,14 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) } /* fix bad area setup in subversion 10 */ - if (main->versionfile == 250 && main->subversionfile == 10) { + if (bmain->versionfile == 250 && bmain->subversionfile == 10) { /* fix for new view type in sequencer */ bScreen *screen; ScrArea *sa; SpaceLink *sl; /* remove all preview window in wrong spaces */ - for (screen = main->screen.first; screen; screen = screen->id.next) { + for (screen = bmain->screen.first; screen; screen = screen->id.next) { for (sa = screen->areabase.first; sa; sa = sa->next) { for (sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype != SPACE_SEQ) { @@ -1200,14 +1200,14 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) } } - if (main->versionfile < 250 || (main->versionfile == 250 && main->subversionfile < 11)) { + if (bmain->versionfile < 250 || (bmain->versionfile == 250 && bmain->subversionfile < 11)) { { /* fix for new view type in sequencer */ bScreen *screen; ScrArea *sa; SpaceLink *sl; - for (screen = main->screen.first; screen; screen = screen->id.next) { + for (screen = bmain->screen.first; screen; screen = screen->id.next) { for (sa = screen->areabase.first; sa; sa = sa->next) { for (sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_SEQ) { @@ -1243,12 +1243,12 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) } } - if (main->versionfile < 250 || (main->versionfile == 250 && main->subversionfile < 12)) { + if (bmain->versionfile < 250 || (bmain->versionfile == 250 && bmain->subversionfile < 12)) { Object *ob; Brush *brush; /* anim viz changes */ - for (ob = main->object.first; ob; ob = ob->id.next) { + for (ob = bmain->object.first; ob; ob = ob->id.next) { /* initialize object defaults */ animviz_settings_init(&ob->avs); @@ -1323,19 +1323,19 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) } /* brush texture changes */ - for (brush = main->brush.first; brush; brush = brush->id.next) { + for (brush = bmain->brush.first; brush; brush = brush->id.next) { BKE_texture_mtex_default(&brush->mtex); BKE_texture_mtex_default(&brush->mask_mtex); } } - if (main->versionfile < 250 || (main->versionfile == 250 && main->subversionfile < 13)) { + if (bmain->versionfile < 250 || (bmain->versionfile == 250 && bmain->subversionfile < 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; /* convert degrees to radians for internal use */ - for (ob = main->object.first; ob; ob = ob->id.next) { + for (ob = bmain->object.first; ob; ob = ob->id.next) { bPoseChannel *pchan; do_version_constraints_radians_degrees_250(&ob->constraints); @@ -1355,13 +1355,13 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) } } - if (main->versionfile < 250 || (main->versionfile == 250 && main->subversionfile < 14)) { + if (bmain->versionfile < 250 || (bmain->versionfile == 250 && bmain->subversionfile < 14)) { /* fix for bad View2D extents for Animation Editors */ bScreen *screen; ScrArea *sa; SpaceLink *sl; - for (screen = main->screen.first; screen; screen = screen->id.next) { + for (screen = bmain->screen.first; screen; screen = screen->id.next) { for (sa = screen->areabase.first; sa; sa = sa->next) { for (sl = sa->spacedata.first; sl; sl = sl->next) { ListBase *regionbase; @@ -1385,12 +1385,12 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) } } - if (main->versionfile < 250 || (main->versionfile == 250 && main->subversionfile < 17)) { + if (bmain->versionfile < 250 || (bmain->versionfile == 250 && bmain->subversionfile < 17)) { Scene *sce; Sequence *seq; /* initialize to sane default so toggling on border shows something */ - for (sce = main->scene.first; sce; sce = sce->id.next) { + for (sce = bmain->scene.first; sce; sce = sce->id.next) { if (sce->r.border.xmin == 0.0f && sce->r.border.ymin == 0.0f && sce->r.border.xmax == 0.0f && sce->r.border.ymax == 0.0f) { @@ -1411,7 +1411,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) } /* particle brush strength factor was changed from int to float */ - for (sce = main->scene.first; sce; sce = sce->id.next) { + for (sce = bmain->scene.first; sce; sce = sce->id.next) { ParticleEditSettings *pset = &sce->toolsettings->particle; int a; @@ -1425,7 +1425,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) ScrArea *sa; SpaceLink *sl; - for (screen = main->screen.first; screen; screen = screen->id.next) { + for (screen = bmain->screen.first; screen; screen = screen->id.next) { for (sa = screen->areabase.first; sa; sa = sa->next) { for (sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_SEQ) { @@ -1454,14 +1454,14 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) } /* sequencer changes */ } - if (main->versionfile <= 251) { /* 2.5.1 had no subversions */ + if (bmain->versionfile <= 251) { /* 2.5.1 had no subversions */ bScreen *sc; /* Blender 2.5.2 - subversion 0 introduced a new setting: V3D_RENDER_OVERRIDE. * This bit was used in the past for V3D_TRANSFORM_SNAP, which is now deprecated. * Here we clear it for old files so they don't come in with V3D_RENDER_OVERRIDE set, * which would cause cameras, lamps, etc to become invisible */ - for (sc = main->screen.first; sc; sc = sc->id.next) { + for (sc = bmain->screen.first; sc; sc = sc->id.next) { ScrArea *sa; for (sa = sc->areabase.first; sa; sa = sa->next) { SpaceLink *sl; @@ -1475,19 +1475,19 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) } } - if (main->versionfile < 252 || (main->versionfile == 252 && main->subversionfile < 1)) { + if (bmain->versionfile < 252 || (bmain->versionfile == 252 && bmain->subversionfile < 1)) { Brush *brush; Object *ob; Scene *scene; bNodeTree *ntree; - for (brush = main->brush.first; brush; brush = brush->id.next) { + for (brush = bmain->brush.first; brush; brush = brush->id.next) { if (brush->curve) brush->curve->preset = CURVE_PRESET_SMOOTH; } /* properly initialize active flag for fluidsim modifiers */ - for (ob = main->object.first; ob; ob = ob->id.next) { + for (ob = bmain->object.first; ob; ob = ob->id.next) { ModifierData *md; for (md = ob->modifiers.first; md; md = md->next) { if (md->type == eModifierType_Fluidsim) { @@ -1499,7 +1499,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) } /* adjustment to color balance node values */ - for (scene = main->scene.first; scene; scene = scene->id.next) { + for (scene = bmain->scene.first; scene; scene = scene->id.next) { if (scene->nodetree) { bNode *node = scene->nodetree->nodes.first; @@ -1515,7 +1515,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) } } /* check inside node groups too */ - for (ntree = main->nodetree.first; ntree; ntree = ntree->id.next) { + for (ntree = bmain->nodetree.first; ntree; ntree = ntree->id.next) { bNode *node = ntree->nodes.first; while (node) { @@ -1532,18 +1532,18 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) } /* old-track -> constraints (this time we're really doing it!) */ - if (main->versionfile < 252 || (main->versionfile == 252 && main->subversionfile < 2)) { + if (bmain->versionfile < 252 || (bmain->versionfile == 252 && bmain->subversionfile < 2)) { Object *ob; - for (ob = main->object.first; ob; ob = ob->id.next) + for (ob = bmain->object.first; ob; ob = ob->id.next) blo_do_version_old_trackto_to_constraints(ob); } - if (main->versionfile < 252 || (main->versionfile == 252 && main->subversionfile < 5)) { + if (bmain->versionfile < 252 || (bmain->versionfile == 252 && bmain->subversionfile < 5)) { bScreen *sc; /* Image editor scopes */ - for (sc = main->screen.first; sc; sc = sc->id.next) { + for (sc = bmain->screen.first; sc; sc = sc->id.next) { ScrArea *sa; for (sa = sc->areabase.first; sa; sa = sa->next) { @@ -1559,14 +1559,14 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) } } - if (main->versionfile < 253) { + if (bmain->versionfile < 253) { Object *ob; Scene *scene; bScreen *sc; Tex *tex; Brush *brush; - for (sc = main->screen.first; sc; sc = sc->id.next) { + for (sc = bmain->screen.first; sc; sc = sc->id.next) { ScrArea *sa; for (sa = sc->areabase.first; sa; sa = sa->next) { SpaceLink *sl; @@ -1600,10 +1600,10 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) } } - do_version_mdef_250(main); + do_version_mdef_250(bmain); /* parent type to modifier */ - for (ob = main->object.first; ob; ob = ob->id.next) { + for (ob = bmain->object.first; ob; ob = ob->id.next) { if (ob->parent) { Object *parent = (Object *) blo_do_versions_newlibadr(fd, lib, ob->parent); if (parent) { /* parent may not be in group */ @@ -1638,7 +1638,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) } /* initialize scene active layer */ - for (scene = main->scene.first; scene; scene = scene->id.next) { + for (scene = bmain->scene.first; scene; scene = scene->id.next) { int i; for (i = 0; i < 20; i++) { if (scene->lay & (1<<i)) { @@ -1648,7 +1648,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) } } - for (tex = main->tex.first; tex; tex = tex->id.next) { + for (tex = bmain->tex.first; tex; tex = tex->id.next) { /* if youre picky, this isn't correct until we do a version bump * since you could set saturation to be 0.0*/ if (tex->saturation == 0.0f) @@ -1657,12 +1657,12 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) { Curve *cu; - for (cu = main->curve.first; cu; cu = cu->id.next) { + for (cu = bmain->curve.first; cu; cu = cu->id.next) { cu->smallcaps_scale = 0.75f; } } - for (scene = main->scene.first; scene; scene = scene->id.next) { + for (scene = bmain->scene.first; scene; scene = scene->id.next) { if (scene) { Sequence *seq; SEQ_BEGIN (scene->ed, seq) @@ -1677,7 +1677,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) /* GSOC 2010 Sculpt - New settings for Brush */ - for (brush = main->brush.first; brush; brush = brush->id.next) { + for (brush = bmain->brush.first; brush; brush = brush->id.next) { /* Sanity Check */ /* infinite number of dabs */ @@ -1721,7 +1721,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) brush->rate = 0.1f; /* New Settings */ - if (main->versionfile < 252 || (main->versionfile == 252 && main->subversionfile < 5)) { + if (bmain->versionfile < 252 || (bmain->versionfile == 252 && bmain->subversionfile < 5)) { brush->flag |= BRUSH_SPACE_ATTEN; // explicitly enable adaptive space /* spacing was originally in pixels, convert it to percentage for new version @@ -1751,9 +1751,9 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) } /* GSOC Sculpt 2010 - Sanity check on Sculpt/Paint settings */ - if (main->versionfile < 253) { + if (bmain->versionfile < 253) { Scene *sce; - for (sce = main->scene.first; sce; sce = sce->id.next) { + for (sce = bmain->scene.first; sce; sce = sce->id.next) { if (sce->toolsettings->sculpt_paint_unified_alpha == 0) sce->toolsettings->sculpt_paint_unified_alpha = 0.5f; @@ -1765,10 +1765,10 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) } } - if (main->versionfile < 253 || (main->versionfile == 253 && main->subversionfile < 1)) { + if (bmain->versionfile < 253 || (bmain->versionfile == 253 && bmain->subversionfile < 1)) { Object *ob; - for (ob = main->object.first; ob; ob = ob->id.next) { + for (ob = bmain->object.first; ob; ob = ob->id.next) { ModifierData *md; for (md = ob->modifiers.first; md; md = md->next) { @@ -1788,7 +1788,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) /* for now just add it to all flow objects in the scene */ { Object *ob2; - for (ob2 = main->object.first; ob2; ob2 = ob2->id.next) { + for (ob2 = bmain->object.first; ob2; ob2 = ob2->id.next) { ModifierData *md2; for (md2 = ob2->modifiers.first; md2; md2 = md2->next) { if (md2->type == eModifierType_Smoke) { @@ -1811,17 +1811,17 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) } } - if (main->versionfile < 255 || (main->versionfile == 255 && main->subversionfile < 1)) { + if (bmain->versionfile < 255 || (bmain->versionfile == 255 && bmain->subversionfile < 1)) { Brush *br; ParticleSettings *part; bScreen *sc; - for (br = main->brush.first; br; br = br->id.next) { + for (br = bmain->brush.first; br; br = br->id.next) { if (br->ob_mode == 0) br->ob_mode = OB_MODE_ALL_PAINT; } - for (part = main->particle.first; part; part = part->id.next) { + for (part = bmain->particle.first; part; part = part->id.next) { if (part->boids) part->boids->pitch = 1.0f; @@ -1829,7 +1829,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) part->kink_amp_clump = 1.f; /* keep old files looking similar */ } - for (sc = main->screen.first; sc; sc = sc->id.next) { + for (sc = bmain->screen.first; sc; sc = sc->id.next) { ScrArea *sa; for (sa = sc->areabase.first; sa; sa = sa->next) { SpaceLink *sl; @@ -1856,11 +1856,11 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) } } - if (main->versionfile < 255 || (main->versionfile == 255 && main->subversionfile < 3)) { + if (bmain->versionfile < 255 || (bmain->versionfile == 255 && bmain->subversionfile < 3)) { Object *ob; /* ocean res is now squared, reset old ones - will be massive */ - for (ob = main->object.first; ob; ob = ob->id.next) { + for (ob = bmain->object.first; ob; ob = ob->id.next) { ModifierData *md; for (md = ob->modifiers.first; md; md = md->next) { if (md->type == eModifierType_Ocean) { @@ -1872,13 +1872,13 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) } } - if (main->versionfile < 256) { + if (bmain->versionfile < 256) { bScreen *sc; ScrArea *sa; Key *key; /* Fix for sample line scope initializing with no height */ - for (sc = main->screen.first; sc; sc = sc->id.next) { + for (sc = bmain->screen.first; sc; sc = sc->id.next) { sa = sc->areabase.first; while (sa) { SpaceLink *sl; @@ -1897,7 +1897,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) * 2.4x would never reveal this to users as a dummy value always ended up getting used * instead */ - for (key = main->key.first; key; key = key->id.next) { + for (key = bmain->key.first; key; key = key->id.next) { KeyBlock *kb; for (kb = key->block.first; kb; kb = kb->next) { @@ -1907,19 +1907,19 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) } } - if (main->versionfile < 256 || (main->versionfile == 256 && main->subversionfile < 1)) { + if (bmain->versionfile < 256 || (bmain->versionfile == 256 && bmain->subversionfile < 1)) { /* fix for bones that didn't have arm_roll before */ bArmature *arm; Bone *bone; Object *ob; - for (arm = main->armature.first; arm; arm = arm->id.next) + for (arm = bmain->armature.first; arm; arm = arm->id.next) for (bone = arm->bonebase.first; bone; bone = bone->next) do_version_bone_roll_256(bone); /* fix for objects which have zero dquat's * since this is multiplied with the quat rather than added */ - for (ob = main->object.first; ob; ob = ob->id.next) { + for (ob = bmain->object.first; ob; ob = ob->id.next) { if (is_zero_v4(ob->dquat)) { unit_qt(ob->dquat); } @@ -1929,7 +1929,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) } } - if (main->versionfile < 256 || (main->versionfile == 256 && main->subversionfile < 2)) { + if (bmain->versionfile < 256 || (bmain->versionfile == 256 && bmain->subversionfile < 2)) { bNodeTree *ntree; bNode *node; bNodeSocket *sock, *gsock; @@ -1938,7 +1938,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) /* node sockets are not exposed automatically any more, * this mimics the old behavior by adding all unlinked sockets to groups. */ - for (ntree=main->nodetree.first; ntree; ntree=ntree->id.next) { + for (ntree=bmain->nodetree.first; ntree; ntree=ntree->id.next) { /* this adds copies and links from all unlinked internal sockets to group inputs/outputs. */ /* first make sure the own_index for new sockets is valid */ @@ -2007,14 +2007,14 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) } } - if (main->versionfile < 256 || (main->versionfile == 256 && main->subversionfile < 3)) { + if (bmain->versionfile < 256 || (bmain->versionfile == 256 && bmain->subversionfile < 3)) { bScreen *sc; Brush *brush; Object *ob; ParticleSettings *part; /* redraws flag in SpaceTime has been moved to Screen level */ - for (sc = main->screen.first; sc; sc = sc->id.next) { + for (sc = bmain->screen.first; sc; sc = sc->id.next) { if (sc->redraws_flag == 0) { /* just initialize to default? */ /* XXX: we could also have iterated through areas, and taken them from the first timeline available... */ @@ -2022,13 +2022,13 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) } } - for (brush = main->brush.first; brush; brush = brush->id.next) { + for (brush = bmain->brush.first; brush; brush = brush->id.next) { if (brush->height == 0) brush->height = 0.4f; } /* replace 'rim material' option for in offset*/ - for (ob = main->object.first; ob; ob = ob->id.next) { + for (ob = bmain->object.first; ob; ob = ob->id.next) { ModifierData *md; for (md = ob->modifiers.first; md; md = md->next) { if (md->type == eModifierType_Solidify) { @@ -2042,24 +2042,24 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) } /* particle draw color from material */ - for (part = main->particle.first; part; part = part->id.next) { + for (part = bmain->particle.first; part; part = part->id.next) { if (part->draw & PART_DRAW_MAT_COL) part->draw_col = PART_DRAW_COL_MAT; } } - if (main->versionfile < 256 || (main->versionfile == 256 && main->subversionfile < 6)) { + if (bmain->versionfile < 256 || (bmain->versionfile == 256 && bmain->subversionfile < 6)) { Mesh *me; - for (me = main->mesh.first; me; me = me->id.next) + for (me = bmain->mesh.first; me; me = me->id.next) BKE_mesh_calc_normals_tessface(me->mvert, me->totvert, me->mface, me->totface, NULL); } - if (main->versionfile < 256 || (main->versionfile == 256 && main->subversionfile < 2)) { + if (bmain->versionfile < 256 || (bmain->versionfile == 256 && bmain->subversionfile < 2)) { /* update blur area sizes from 0..1 range to 0..100 percentage */ Scene *scene; bNode *node; - for (scene = main->scene.first; scene; scene = scene->id.next) + for (scene = bmain->scene.first; scene; scene = scene->id.next) if (scene->nodetree) for (node = scene->nodetree->nodes.first; node; node = node->next) if (node->type == CMP_NODE_BLUR) { @@ -2069,13 +2069,13 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) } } - if (main->versionfile < 258 || (main->versionfile == 258 && main->subversionfile < 1)) { + if (bmain->versionfile < 258 || (bmain->versionfile == 258 && bmain->subversionfile < 1)) { /* screen view2d settings were not properly initialized [#27164] * v2d->scroll caused the bug but best reset other values too which are in old blend files only. * need to make less ugly - possibly an iterator? */ bScreen *screen; - for (screen = main->screen.first; screen; screen = screen->id.next) { + for (screen = bmain->screen.first; screen; screen = screen->id.next) { ScrArea *sa; /* add regions */ for (sa = screen->areabase.first; sa; sa = sa->next) { @@ -2106,19 +2106,19 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) { ParticleSettings *part; - for (part = main->particle.first; part; part = part->id.next) { + for (part = bmain->particle.first; part; part = part->id.next) { /* Initialize particle billboard scale */ part->bb_size[0] = part->bb_size[1] = 1.0f; } } } - if (main->versionfile < 259 || (main->versionfile == 259 && main->subversionfile < 1)) { + if (bmain->versionfile < 259 || (bmain->versionfile == 259 && bmain->subversionfile < 1)) { { Scene *scene; Sequence *seq; - for (scene = main->scene.first; scene; scene = scene->id.next) { + for (scene = bmain->scene.first; scene; scene = scene->id.next) { scene->r.ffcodecdata.audio_channels = 2; scene->audio.volume = 1.0f; SEQ_BEGIN (scene->ed, seq) @@ -2131,7 +2131,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) { bScreen *screen; - for (screen = main->screen.first; screen; screen = screen->id.next) { + for (screen = bmain->screen.first; screen; screen = screen->id.next) { ScrArea *sa; /* add regions */ @@ -2172,7 +2172,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) bAction *act; FCurve *fcu; - for (act = main->action.first; act; act = act->id.next) { + for (act = bmain->action.first; act; act = act->id.next) { for (fcu = act->curves.first; fcu; fcu = fcu->next) { BezTriple *bezt; unsigned int i = 0; @@ -2197,10 +2197,10 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) } } - if (main->versionfile < 259 || (main->versionfile == 259 && main->subversionfile < 2)) { + if (bmain->versionfile < 259 || (bmain->versionfile == 259 && bmain->subversionfile < 2)) { { /* Convert default socket values from bNodeStack */ - FOREACH_NODETREE(main, ntree, id) { + FOREACH_NODETREE(bmain, ntree, id) { bNode *node; bNodeSocket *sock; @@ -2227,17 +2227,17 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) * associate them with specific node types for polling. */ bNodeTree *ntree; - /* all node trees in main->nodetree are considered groups */ - for (ntree = main->nodetree.first; ntree; ntree = ntree->id.next) + /* all node trees in bmain->nodetree are considered groups */ + for (ntree = bmain->nodetree.first; ntree; ntree = ntree->id.next) ntree->nodetype = NODE_GROUP; } } - if (main->versionfile < 259 || (main->versionfile == 259 && main->subversionfile < 4)) { + if (bmain->versionfile < 259 || (bmain->versionfile == 259 && bmain->subversionfile < 4)) { { /* Adaptive time step for particle systems */ ParticleSettings *part; - for (part = main->particle.first; part; part = part->id.next) { + for (part = bmain->particle.first; part; part = part->id.next) { part->courant_target = 0.2f; part->time_flag &= ~PART_TIME_AUTOSF; } |