Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2018-06-05 16:10:33 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-06-05 17:33:46 +0300
commit481cdb08ed6f33a09d0e6843d1024db93c301178 (patch)
tree77166d130bfff2d5dca884676aaeff6bc0758f96 /source/blender/blenloader
parent1d97e948d2c4867306e7fb5ce5fccf8b72c13391 (diff)
Cleanup: use new accessors to blendfile path (Main.name).
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/readfile.c14
-rw-r--r--source/blender/blenloader/intern/readfile.h10
-rw-r--r--source/blender/blenloader/intern/undofile.c2
-rw-r--r--source/blender/blenloader/intern/versioning_250.c298
-rw-r--r--source/blender/blenloader/intern/versioning_260.c418
-rw-r--r--source/blender/blenloader/intern/versioning_270.c288
-rw-r--r--source/blender/blenloader/intern/versioning_legacy.c590
-rw-r--r--source/blender/blenloader/intern/writefile.c2
8 files changed, 811 insertions, 811 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 5a7151a7477..4df79250125 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -8409,11 +8409,11 @@ static BHead *read_global(BlendFileData *bfd, FileData *fd, BHead *bhead)
if (bfd->filename[0] == 0) {
if (fd->fileversion < 265 || (fd->fileversion == 265 && fg->subversion < 1))
if ((G.fileflags & G_FILE_RECOVER)==0)
- BLI_strncpy(bfd->filename, bfd->main->name, sizeof(bfd->filename));
+ BLI_strncpy(bfd->filename, BKE_main_blendfile_path(bfd->main), sizeof(bfd->filename));
/* early 2.50 version patch - filename not in FileGlobal struct at all */
if (fd->fileversion <= 250)
- BLI_strncpy(bfd->filename, bfd->main->name, sizeof(bfd->filename));
+ BLI_strncpy(bfd->filename, BKE_main_blendfile_path(bfd->main), sizeof(bfd->filename));
}
if (G.fileflags & G_FILE_RECOVER)
@@ -10309,7 +10309,7 @@ static Main *library_link_begin(Main *mainvar, FileData **fd, const char *filepa
blo_split_main((*fd)->mainlist, mainvar);
/* which one do we need? */
- mainl = blo_find_main(*fd, filepath, G.main->name);
+ mainl = blo_find_main(*fd, filepath, BKE_main_blendfile_path(mainvar));
/* needed for do_version */
mainl->versionfile = (*fd)->fileversion;
@@ -10384,7 +10384,7 @@ static void library_link_end(Main *mainl, FileData **fd, const short flag, Scene
BLI_strncpy(curlib->name, curlib->filepath, sizeof(curlib->name));
/* uses current .blend file as reference */
- BLI_path_rel(curlib->name, G.main->name);
+ BLI_path_rel(curlib->name, BKE_main_blendfile_path_from_global());
}
blo_join_main((*fd)->mainlist);
@@ -10412,7 +10412,7 @@ static void library_link_end(Main *mainl, FileData **fd, const short flag, Scene
BKE_main_id_tag_all(mainvar, LIB_TAG_NEW, false);
lib_verify_nodetree(mainvar, false);
- fix_relpaths_library(G.main->name, mainvar); /* make all relative paths, relative to the open blend file */
+ fix_relpaths_library(BKE_main_blendfile_path(mainvar), mainvar); /* make all relative paths, relative to the open blend file */
/* Give a base to loose objects. If group append, do it for objects too.
* Only directly linked objects & groups are instantiated by `BLO_library_link_named_part_ex()` & co,
@@ -10535,7 +10535,7 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
while (fd == NULL) {
char newlib_path[FILE_MAX] = {0};
printf("Missing library...'\n");
- printf(" current file: %s\n", G.main->name);
+ printf(" current file: %s\n", BKE_main_blendfile_path_from_global());
printf(" absolute lib: %s\n", mainptr->curlib->filepath);
printf(" relative lib: %s\n", mainptr->curlib->name);
printf(" enter a new path:\n");
@@ -10543,7 +10543,7 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
if (scanf("%1023s", newlib_path) > 0) { /* Warning, keep length in sync with FILE_MAX! */
BLI_strncpy(mainptr->curlib->name, newlib_path, sizeof(mainptr->curlib->name));
BLI_strncpy(mainptr->curlib->filepath, newlib_path, sizeof(mainptr->curlib->filepath));
- BLI_cleanup_path(G.main->name, mainptr->curlib->filepath);
+ BLI_cleanup_path(BKE_main_blendfile_path_from_global(), mainptr->curlib->filepath);
fd = blo_openblenderfile(mainptr->curlib->filepath, basefd->reports);
diff --git a/source/blender/blenloader/intern/readfile.h b/source/blender/blenloader/intern/readfile.h
index 62ce15a640e..ebb29b640e7 100644
--- a/source/blender/blenloader/intern/readfile.h
+++ b/source/blender/blenloader/intern/readfile.h
@@ -167,12 +167,12 @@ void blo_do_version_old_trackto_to_constraints(struct Object *ob);
void blo_do_versions_view3d_split_250(struct View3D *v3d, struct ListBase *regions);
void blo_do_versions_key_uidgen(struct Key *key);
-void blo_do_versions_pre250(struct FileData *fd, struct Library *lib, struct Main *main);
-void blo_do_versions_250(struct FileData *fd, struct Library *lib, struct Main *main);
-void blo_do_versions_260(struct FileData *fd, struct Library *lib, struct Main *main);
-void blo_do_versions_270(struct FileData *fd, struct Library *lib, struct Main *main);
+void blo_do_versions_pre250(struct FileData *fd, struct Library *lib, struct Main *bmain);
+void blo_do_versions_250(struct FileData *fd, struct Library *lib, struct Main *bmain);
+void blo_do_versions_260(struct FileData *fd, struct Library *lib, struct Main *bmain);
+void blo_do_versions_270(struct FileData *fd, struct Library *lib, struct Main *bmain);
-void do_versions_after_linking_270(struct Main *main);
+void do_versions_after_linking_270(struct Main *bmain);
#endif
diff --git a/source/blender/blenloader/intern/undofile.c b/source/blender/blenloader/intern/undofile.c
index 7133dee0e82..e1ae267ea11 100644
--- a/source/blender/blenloader/intern/undofile.c
+++ b/source/blender/blenloader/intern/undofile.c
@@ -130,7 +130,7 @@ void memfile_chunk_add(
struct Main *BLO_memfile_main_get(struct MemFile *memfile, struct Main *oldmain, struct Scene **r_scene)
{
struct Main *bmain_undo = NULL;
- BlendFileData *bfd = BLO_read_from_memfile(oldmain, oldmain->name, memfile, NULL, BLO_READ_SKIP_NONE);
+ BlendFileData *bfd = BLO_read_from_memfile(oldmain, BKE_main_blendfile_path(oldmain), memfile, NULL, BLO_READ_SKIP_NONE);
if (bfd) {
bmain_undo = bfd->main;
diff --git a/source/blender/blenloader/intern/versioning_250.c b/source/blender/blenloader/intern/versioning_250.c
index d308bd54da3..39c47c90b89 100644
--- a/source/blender/blenloader/intern/versioning_250.c
+++ b/source/blender/blenloader/intern/versioning_250.c
@@ -729,11 +729,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;
@@ -753,14 +753,14 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main)
bActuator *act;
int a;
- 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 (ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
for (act = ob->actuators.first; act; act = act->next) {
if (act->type == ACT_SOUND) {
bSoundActuator *sAct = (bSoundActuator*) act->data;
@@ -787,15 +787,15 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main)
}
}
- 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)
@@ -812,15 +812,15 @@ 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");
@@ -835,7 +835,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main)
}
/* 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");
@@ -855,7 +855,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) {
@@ -870,12 +870,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;
@@ -894,7 +894,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);
@@ -905,7 +905,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) {
@@ -915,7 +915,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;
Material *ma;
Tex *tex;
@@ -924,7 +924,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) {
@@ -958,12 +958,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 (ma = main->mat.first; ma; ma = ma->id.next) {
+ for (ma = bmain->mat.first; ma; ma = ma->id.next) {
int a;
if (ma->mode & MA_WIRE) {
@@ -1018,7 +1018,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main)
}
}
- 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->normalsize == 0.0f || !ts->uv_selectmode || ts->vgroup_weight == 0.0f) {
ts->normalsize = 0.1f;
@@ -1085,11 +1085,11 @@ 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)) {
Scene *sce;
Object *ob;
- for (sce = main->scene.first; sce; sce = sce->id.next) {
+ for (sce = bmain->scene.first; sce; sce = sce->id.next) {
if (fd->fileflags & G_FILE_ENABLE_ALL_FRAMES)
sce->gm.flag |= GAME_ENABLE_ALL_FRAMES;
if (fd->fileflags & G_FILE_SHOW_DEBUG_PROPS)
@@ -1123,13 +1123,13 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main)
sce->gm.flag |= GAME_DISPLAY_LISTS;
}
- 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;
Material *ma;
@@ -1139,11 +1139,11 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main)
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)
@@ -1153,7 +1153,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main)
ob->rotmode = ROT_MODE_EUL;
}
- for (ma = main->mat.first; ma; ma = ma->id.next) {
+ for (ma = bmain->mat.first; ma; ma = ma->id.next) {
if (ma->vol.reflection == 0.f) {
ma->vol.reflection = 1.f;
ma->vol.transmission_col[0] = ma->vol.transmission_col[1] = ma->vol.transmission_col[2] = 1.0f;
@@ -1163,18 +1163,18 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main)
do_version_mtex_factor_2_50(ma->mtex, ID_MA);
}
- for (la = main->lamp.first; la; la = la->id.next)
+ for (la = bmain->lamp.first; la; la = la->id.next)
do_version_mtex_factor_2_50(la->mtex, ID_LA);
- for (wo = main->world.first; wo; wo = wo->id.next)
+ for (wo = bmain->world.first; wo; wo = wo->id.next)
do_version_mtex_factor_2_50(wo->mtex, ID_WO);
- for (tex = main->tex.first; tex; tex = tex->id.next)
+ for (tex = bmain->tex.first; tex; tex = tex->id.next)
if (tex->vd)
if (tex->vd->extend == 0)
tex->vd->extend = TEX_CLIP;
- 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;
@@ -1186,7 +1186,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))
{
@@ -1199,11 +1199,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) {
@@ -1232,12 +1232,12 @@ 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;
Lamp *la;
/* 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;
@@ -1253,11 +1253,11 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main)
}
}
- for (la = main->lamp.first; la; la = la->id.next)
+ for (la = bmain->lamp.first; la; la = la->id.next)
la->compressthresh = 0.05f;
}
- 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;
@@ -1269,7 +1269,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);
@@ -1279,7 +1279,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);
@@ -1289,7 +1289,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;
@@ -1317,9 +1317,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;
@@ -1336,7 +1336,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;
@@ -1350,7 +1350,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)
@@ -1364,7 +1364,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) {
@@ -1378,11 +1378,11 @@ 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;
- World *wo = main->world.first;
- Tex *tex = main->tex.first;
+ if (bmain->versionfile == 250) {
+ Scene *sce = bmain->scene.first;
+ Material *ma = bmain->mat.first;
+ World *wo = bmain->world.first;
+ Tex *tex = bmain->tex.first;
int i, convert = 0;
/* convert to new color management system:
@@ -1443,20 +1443,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) {
@@ -1469,11 +1469,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) {
@@ -1486,14 +1486,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) {
@@ -1523,14 +1523,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) {
@@ -1566,19 +1566,19 @@ 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)) {
Scene *sce;
Object *ob;
Brush *brush;
Material *ma;
/* game engine changes */
- for (sce = main->scene.first; sce; sce = sce->id.next) {
+ for (sce = bmain->scene.first; sce; sce = sce->id.next) {
sce->gm.eyeseparation = 0.10f;
}
/* 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);
@@ -1653,12 +1653,12 @@ 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);
}
- for (ma = main->mat.first; ma; ma = ma->id.next) {
+ for (ma = bmain->mat.first; ma; ma = ma->id.next) {
if (ma->vol.ms_spread < 0.0001f) {
ma->vol.ms_spread = 0.2f;
ma->vol.ms_diff = 1.f;
@@ -1667,13 +1667,13 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main)
}
}
- 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);
@@ -1693,13 +1693,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;
@@ -1723,15 +1723,15 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile < 250 || (main->versionfile == 250 && main->subversionfile < 15)) {
+ if (bmain->versionfile < 250 || (bmain->versionfile == 250 && bmain->subversionfile < 15)) {
World *wo;
Material *ma;
/* ambient default from 0.5f to 1.0f */
- for (ma = main->mat.first; ma; ma = ma->id.next)
+ for (ma = bmain->mat.first; ma; ma = ma->id.next)
ma->amb *= 2.0f;
- for (wo = main->world.first; wo; wo = wo->id.next) {
+ for (wo = bmain->world.first; wo; wo = wo->id.next) {
/* ao splitting into ao/env/indirect */
wo->ao_env_energy = wo->aoenergy;
wo->aoenergy = 1.0f;
@@ -1754,13 +1754,13 @@ 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;
Material *ma;
/* 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)
{
@@ -1781,7 +1781,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;
@@ -1789,7 +1789,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main)
pset->brush[a].strength /= 100.0f;
}
- for (ma = main->mat.first; ma; ma = ma->id.next)
+ for (ma = bmain->mat.first; ma; ma = ma->id.next)
if (ma->mode & MA_TRACEBLE)
ma->shade_flag |= MA_APPROX_OCCLUSION;
@@ -1799,7 +1799,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) {
@@ -1828,14 +1828,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;
@@ -1849,19 +1849,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) {
@@ -1873,7 +1873,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;
@@ -1889,7 +1889,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) {
@@ -1906,18 +1906,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) {
@@ -1933,14 +1933,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;
@@ -1982,10 +1982,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 */
@@ -2020,7 +2020,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)) {
@@ -2030,7 +2030,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)
@@ -2039,12 +2039,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)
@@ -2059,7 +2059,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 */
@@ -2103,7 +2103,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
@@ -2133,9 +2133,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;
@@ -2147,10 +2147,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) {
@@ -2170,7 +2170,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) {
@@ -2193,18 +2193,18 @@ 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;
Object *ob;
- 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;
@@ -2212,7 +2212,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;
@@ -2240,7 +2240,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main)
/* fix rotation actuators for objects so they use real angles (radians)
* since before blender went opensource this strange scalar was used: (1 / 0.02) * 2 * math.pi/360 */
- for (ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
bActuator *act = ob->actuators.first;
while (act) {
if (act->type == ACT_OBJECT) {
@@ -2256,7 +2256,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main)
/* init facing axis property of steering actuators */
{
Object *ob;
- for (ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
bActuator *act;
for (act = ob->actuators.first; act; act = act->next) {
if (act->type == ACT_STEERING) {
@@ -2274,11 +2274,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) {
@@ -2290,13 +2290,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;
@@ -2315,7 +2315,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) {
@@ -2325,19 +2325,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);
}
@@ -2347,7 +2347,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;
@@ -2356,7 +2356,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 */
@@ -2425,7 +2425,7 @@ 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;
@@ -2433,7 +2433,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main)
Material *mat;
int tex_nr, transp_tex;
- for (mat = main->mat.first; mat; mat = mat->id.next) {
+ for (mat = bmain->mat.first; mat; mat = mat->id.next) {
if (!(mat->mode & MA_TRANSP) && !(mat->material_type & MA_TYPE_VOLUME)) {
transp_tex = 0;
@@ -2453,7 +2453,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main)
}
/* 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... */
@@ -2461,13 +2461,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) {
@@ -2481,24 +2481,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) {
@@ -2508,13 +2508,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) {
@@ -2546,7 +2546,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main)
{
/* Initialize texture point density curve falloff */
Tex *tex;
- for (tex = main->tex.first; tex; tex = tex->id.next) {
+ for (tex = bmain->tex.first; tex; tex = tex->id.next) {
if (tex->pd) {
if (tex->pd->falloff_speed_scale == 0.0f)
tex->pd->falloff_speed_scale = 100.0f;
@@ -2567,7 +2567,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main)
/* add default value for behind strength of camera actuator */
Object *ob;
bActuator *act;
- for (ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
for (act = ob->actuators.first; act; act = act->next) {
if (act->type == ACT_CAMERA) {
bCameraActuator *ba = act->data;
@@ -2580,19 +2580,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)
@@ -2605,7 +2605,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 */
@@ -2646,7 +2646,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;
@@ -2677,7 +2677,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main)
bIpoActuator *ia;
bActionActuator *aa;
- for (ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
for (act = ob->actuators.first; act; act = act->next) {
if (act->type == ACT_IPO) {
/* Create the new actuator */
@@ -2715,10 +2715,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;
@@ -2745,17 +2745,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;
}
@@ -2764,7 +2764,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main)
{
/* set defaults for obstacle avoidance, recast data */
Scene *sce;
- for (sce = main->scene.first; sce; sce = sce->id.next) {
+ for (sce = bmain->scene.first; sce; sce = sce->id.next) {
if (sce->gm.levelHeight == 0.f)
sce->gm.levelHeight = 2.f;
diff --git a/source/blender/blenloader/intern/versioning_260.c b/source/blender/blenloader/intern/versioning_260.c
index 79dfd572dbb..133db4aac40 100644
--- a/source/blender/blenloader/intern/versioning_260.c
+++ b/source/blender/blenloader/intern/versioning_260.c
@@ -631,15 +631,15 @@ static void do_versions_nodetree_customnodes(bNodeTree *ntree, int UNUSED(is_gro
}
}
-void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
+void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
{
- if (main->versionfile < 260) {
+ if (bmain->versionfile < 260) {
{
/* set default alpha value of Image outputs in image and render layer nodes to 0 */
Scene *sce;
bNodeTree *ntree;
- for (sce = main->scene.first; sce; sce = sce->id.next) {
+ for (sce = bmain->scene.first; sce; sce = sce->id.next) {
/* there are files with invalid audio_channels value, the real cause
* is unknown, but we fix it here anyway to avoid crashes */
if (sce->r.ffcodecdata.audio_channels == 0)
@@ -649,7 +649,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
do_versions_nodetree_image_default_alpha_output(sce->nodetree);
}
- for (ntree = main->nodetree.first; ntree; ntree = ntree->id.next)
+ for (ntree = bmain->nodetree.first; ntree; ntree = ntree->id.next)
do_versions_nodetree_image_default_alpha_output(ntree);
}
@@ -657,7 +657,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
/* support old particle dupliobject rotation settings */
ParticleSettings *part;
- for (part = main->particle.first; part; part = part->id.next) {
+ for (part = bmain->particle.first; part; part = part->id.next) {
if (ELEM(part->ren_as, PART_DRAW_OB, PART_DRAW_GR)) {
part->draw |= PART_DRAW_ROTATE_OB;
@@ -668,16 +668,16 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (main->versionfile < 260 || (main->versionfile == 260 && main->subversionfile < 1)) {
+ if (bmain->versionfile < 260 || (bmain->versionfile == 260 && 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) {
ob->collision_boundtype = ob->boundtype;
}
{
Camera *cam;
- for (cam = main->camera.first; cam; cam = cam->id.next) {
+ for (cam = bmain->camera.first; cam; cam = cam->id.next) {
if (cam->sensor_x < 0.01f)
cam->sensor_x = DEFAULT_SENSOR_WIDTH;
@@ -687,8 +687,8 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (main->versionfile < 260 || (main->versionfile == 260 && main->subversionfile < 2)) {
- FOREACH_NODETREE(main, ntree, id) {
+ if (bmain->versionfile < 260 || (bmain->versionfile == 260 && bmain->subversionfile < 2)) {
+ FOREACH_NODETREE(bmain, ntree, id) {
if (ntree->type == NTREE_SHADER) {
bNode *node;
for (node = ntree->nodes.first; node; node = node->next) {
@@ -705,24 +705,24 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
} FOREACH_NODETREE_END
}
- if (main->versionfile < 260 || (main->versionfile == 260 && main->subversionfile < 4)) {
+ if (bmain->versionfile < 260 || (bmain->versionfile == 260 && bmain->subversionfile < 4)) {
{
/* Convert node angles to radians! */
Scene *sce;
Material *mat;
bNodeTree *ntree;
- for (sce = main->scene.first; sce; sce = sce->id.next) {
+ for (sce = bmain->scene.first; sce; sce = sce->id.next) {
if (sce->nodetree)
do_versions_nodetree_convert_angle(sce->nodetree);
}
- for (mat = main->mat.first; mat; mat = mat->id.next) {
+ for (mat = bmain->mat.first; mat; mat = mat->id.next) {
if (mat->nodetree)
do_versions_nodetree_convert_angle(mat->nodetree);
}
- for (ntree = main->nodetree.first; ntree; ntree = ntree->id.next)
+ for (ntree = bmain->nodetree.first; ntree; ntree = ntree->id.next)
do_versions_nodetree_convert_angle(ntree);
}
@@ -731,7 +731,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
bScreen *sc;
MovieClip *clip;
- 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;
@@ -755,7 +755,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- for (clip = main->movieclip.first; clip; clip = clip->id.next) {
+ for (clip = bmain->movieclip.first; clip; clip = clip->id.next) {
MovieTrackingTrack *track;
if (clip->aspx < 1.0f) {
@@ -787,16 +787,16 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (main->versionfile < 260 || (main->versionfile == 260 && main->subversionfile < 6)) {
+ if (bmain->versionfile < 260 || (bmain->versionfile == 260 && bmain->subversionfile < 6)) {
Scene *sce;
MovieClip *clip;
bScreen *sc;
- for (sce = main->scene.first; sce; sce = sce->id.next) {
+ for (sce = bmain->scene.first; sce; sce = sce->id.next) {
do_versions_image_settings_2_60(sce);
}
- for (clip = main->movieclip.first; clip; clip = clip->id.next) {
+ for (clip = bmain->movieclip.first; clip; clip = clip->id.next) {
MovieTrackingSettings *settings = &clip->tracking.settings;
if (settings->default_pattern_size == 0.0f) {
@@ -807,7 +807,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- 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;
@@ -822,7 +822,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
{
Object *ob;
- for (ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
/* convert delta addition into delta scale */
int i;
for (i = 0; i < 3; i++) {
@@ -842,25 +842,25 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
/* sigh, this dscale vs dsize version patching was not done right, fix for fix,
* this intentionally checks an exact subversion, also note this was never in a release,
* at some point this could be removed. */
- else if (main->versionfile == 260 && main->subversionfile == 6) {
+ else if (bmain->versionfile == 260 && bmain->subversionfile == 6) {
Object *ob;
- for (ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
if (is_zero_v3(ob->dscale)) {
copy_vn_fl(ob->dscale, 3, 1.0f);
}
}
}
- if (main->versionfile < 260 || (main->versionfile == 260 && main->subversionfile < 8)) {
+ if (bmain->versionfile < 260 || (bmain->versionfile == 260 && bmain->subversionfile < 8)) {
Brush *brush;
- for (brush = main->brush.first; brush; brush = brush->id.next) {
+ for (brush = bmain->brush.first; brush; brush = brush->id.next) {
if (brush->sculpt_tool == SCULPT_TOOL_ROTATE)
brush->alpha = 1.0f;
}
}
- if (main->versionfile < 261 || (main->versionfile == 261 && main->subversionfile < 1)) {
+ if (bmain->versionfile < 261 || (bmain->versionfile == 261 && bmain->subversionfile < 1)) {
{
/* update use flags for node sockets (was only temporary before) */
Scene *sce;
@@ -870,39 +870,39 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
World *world;
bNodeTree *ntree;
- for (sce = main->scene.first; sce; sce = sce->id.next) {
+ for (sce = bmain->scene.first; sce; sce = sce->id.next) {
if (sce->nodetree)
do_versions_nodetree_socket_use_flags_2_62(sce->nodetree);
}
- for (mat = main->mat.first; mat; mat = mat->id.next) {
+ for (mat = bmain->mat.first; mat; mat = mat->id.next) {
if (mat->nodetree)
do_versions_nodetree_socket_use_flags_2_62(mat->nodetree);
}
- for (tex = main->tex.first; tex; tex = tex->id.next) {
+ for (tex = bmain->tex.first; tex; tex = tex->id.next) {
if (tex->nodetree)
do_versions_nodetree_socket_use_flags_2_62(tex->nodetree);
}
- for (lamp = main->lamp.first; lamp; lamp = lamp->id.next) {
+ for (lamp = bmain->lamp.first; lamp; lamp = lamp->id.next) {
if (lamp->nodetree)
do_versions_nodetree_socket_use_flags_2_62(lamp->nodetree);
}
- for (world = main->world.first; world; world = world->id.next) {
+ for (world = bmain->world.first; world; world = world->id.next) {
if (world->nodetree)
do_versions_nodetree_socket_use_flags_2_62(world->nodetree);
}
- for (ntree = main->nodetree.first; ntree; ntree = ntree->id.next) {
+ for (ntree = bmain->nodetree.first; ntree; ntree = ntree->id.next) {
do_versions_nodetree_socket_use_flags_2_62(ntree);
}
}
{
/* Initialize BGE exit key to esc key */
Scene *scene;
- for (scene = main->scene.first; scene; scene = scene->id.next) {
+ for (scene = bmain->scene.first; scene; scene = scene->id.next) {
if (!scene->gm.exitkey)
scene->gm.exitkey = 218; // Blender key code for ESC
}
@@ -911,7 +911,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
MovieClip *clip;
Object *ob;
- for (clip = main->movieclip.first; clip; clip = clip->id.next) {
+ for (clip = bmain->movieclip.first; clip; clip = clip->id.next) {
MovieTracking *tracking = &clip->tracking;
MovieTrackingObject *tracking_object = tracking->objects.first;
@@ -931,7 +931,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- for (ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
bConstraint *con;
for (con = ob->constraints.first; con; con = con->next) {
if (con->type == CONSTRAINT_TYPE_OBJECTSOLVER) {
@@ -948,7 +948,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
Object *ob;
bProperty *prop;
- for (ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
if (ob->type == OB_FONT) {
prop = BKE_bproperty_object_get(ob, "Text");
if (prop) {
@@ -962,12 +962,12 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (main->versionfile < 261 || (main->versionfile == 261 && main->subversionfile < 2)) {
+ if (bmain->versionfile < 261 || (bmain->versionfile == 261 && bmain->subversionfile < 2)) {
{
/* convert Camera Actuator values to defines */
Object *ob;
bActuator *act;
- for (ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
for (act = ob->actuators.first; act; act = act->next) {
if (act->type == ACT_CAMERA) {
bCameraActuator *ba = act->data;
@@ -985,7 +985,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
/* convert deprecated sculpt_paint_unified_* fields to
* UnifiedPaintSettings */
Scene *scene;
- for (scene = main->scene.first; scene; scene = scene->id.next) {
+ for (scene = bmain->scene.first; scene; scene = scene->id.next) {
ToolSettings *ts = scene->toolsettings;
UnifiedPaintSettings *ups = &ts->unified_paint_settings;
ups->size = ts->sculpt_paint_unified_size;
@@ -996,11 +996,11 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (main->versionfile < 261 || (main->versionfile == 261 && main->subversionfile < 3)) {
+ if (bmain->versionfile < 261 || (bmain->versionfile == 261 && bmain->subversionfile < 3)) {
{
/* convert extended ascii to utf-8 for text editor */
Text *text;
- for (text = main->text.first; text; text = text->id.next) {
+ for (text = bmain->text.first; text; text = text->id.next) {
if (!(text->flags & TXT_ISEXT)) {
TextLine *tl;
@@ -1018,7 +1018,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
{
/* set new dynamic paint values */
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) {
if (md->type == eModifierType_DynamicPaint) {
@@ -1038,9 +1038,9 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (main->versionfile < 262) {
+ if (bmain->versionfile < 262) {
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) {
@@ -1053,12 +1053,12 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (main->versionfile < 263) {
+ if (bmain->versionfile < 263) {
/* set fluidsim rate. the version patch for this in 2.62 was wrong, so
* try to correct it, if rate is 0.0 that's likely not intentional */
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) {
if (md->type == eModifierType_Fluidsim) {
@@ -1070,35 +1070,35 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (main->versionfile < 262 || (main->versionfile == 262 && main->subversionfile < 1)) {
+ if (bmain->versionfile < 262 || (bmain->versionfile == 262 && bmain->subversionfile < 1)) {
/* update use flags for node sockets (was only temporary before) */
Scene *sce;
bNodeTree *ntree;
- for (sce = main->scene.first; sce; sce = sce->id.next) {
+ for (sce = bmain->scene.first; sce; sce = sce->id.next) {
if (sce->nodetree)
do_versions_nodetree_multi_file_output_format_2_62_1(sce, sce->nodetree);
}
/* XXX can't associate with scene for group nodes, image format will stay uninitialized */
- for (ntree = main->nodetree.first; ntree; ntree = ntree->id.next)
+ for (ntree = bmain->nodetree.first; ntree; ntree = ntree->id.next)
do_versions_nodetree_multi_file_output_format_2_62_1(NULL, ntree);
}
/* only swap for pre-release bmesh merge which had MLoopCol red/blue swap */
- if (main->versionfile == 262 && main->subversionfile == 1) {
+ if (bmain->versionfile == 262 && bmain->subversionfile == 1) {
{
Mesh *me;
- for (me = main->mesh.first; me; me = me->id.next) {
+ for (me = bmain->mesh.first; me; me = me->id.next) {
do_versions_mesh_mloopcol_swap_2_62_1(me);
}
}
}
- if (main->versionfile < 262 || (main->versionfile == 262 && main->subversionfile < 2)) {
+ if (bmain->versionfile < 262 || (bmain->versionfile == 262 && bmain->subversionfile < 2)) {
/* Set new idname of keyingsets from their now "label-only" name. */
Scene *scene;
- for (scene = main->scene.first; scene; scene = scene->id.next) {
+ for (scene = bmain->scene.first; scene; scene = scene->id.next) {
KeyingSet *ks;
for (ks = scene->keyingsets.first; ks; ks = ks->next) {
if (!ks->idname[0])
@@ -1107,11 +1107,11 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (main->versionfile < 262 || (main->versionfile == 262 && main->subversionfile < 3)) {
+ if (bmain->versionfile < 262 || (bmain->versionfile == 262 && bmain->subversionfile < 3)) {
Object *ob;
ModifierData *md;
- for (ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
for (md = ob->modifiers.first; md; md = md->next) {
if (md->type == eModifierType_Lattice) {
LatticeModifierData *lmd = (LatticeModifierData *)md;
@@ -1121,11 +1121,11 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (main->versionfile < 262 || (main->versionfile == 262 && main->subversionfile < 4)) {
+ if (bmain->versionfile < 262 || (bmain->versionfile == 262 && bmain->subversionfile < 4)) {
/* Read Viscosity presets from older files */
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) {
if (md->type == eModifierType_Fluidsim) {
@@ -1145,27 +1145,27 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
- if (main->versionfile < 263) {
+ if (bmain->versionfile < 263) {
/* Default for old files is to save particle rotations to pointcache */
ParticleSettings *part;
- for (part = main->particle.first; part; part = part->id.next) {
+ for (part = bmain->particle.first; part; part = part->id.next) {
part->flag |= PART_ROTATIONS;
}
}
- if (main->versionfile < 263 || (main->versionfile == 263 && main->subversionfile < 1)) {
+ if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 1)) {
/* file output node paths are now stored in the file info struct instead socket name */
Scene *sce;
bNodeTree *ntree;
- for (sce = main->scene.first; sce; sce = sce->id.next)
+ for (sce = bmain->scene.first; sce; sce = sce->id.next)
if (sce->nodetree)
do_versions_nodetree_multi_file_output_path_2_63_1(sce->nodetree);
- for (ntree = main->nodetree.first; ntree; ntree = ntree->id.next)
+ for (ntree = bmain->nodetree.first; ntree; ntree = ntree->id.next)
do_versions_nodetree_multi_file_output_path_2_63_1(ntree);
}
- if (main->versionfile < 263 || (main->versionfile == 263 && main->subversionfile < 3)) {
+ if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 3)) {
Scene *scene;
Brush *brush;
@@ -1173,7 +1173,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
* unified paint settings also have weight. Update unified
* paint settings and brushes with a default weight value. */
- for (scene = main->scene.first; scene; scene = scene->id.next) {
+ for (scene = bmain->scene.first; scene; scene = scene->id.next) {
ToolSettings *ts = scene->toolsettings;
if (ts) {
ts->unified_paint_settings.weight = ts->vgroup_weight;
@@ -1181,15 +1181,15 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- for (brush = main->brush.first; brush; brush = brush->id.next) {
+ for (brush = bmain->brush.first; brush; brush = brush->id.next) {
brush->weight = 0.5;
}
}
- if (main->versionfile < 263 || (main->versionfile == 263 && main->subversionfile < 2)) {
+ if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 2)) {
bScreen *sc;
- 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;
@@ -1221,24 +1221,24 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (main->versionfile < 263 || (main->versionfile == 263 && main->subversionfile < 4)) {
+ if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 4)) {
Lamp *la;
Camera *cam;
Curve *cu;
- for (la = main->lamp.first; la; la = la->id.next) {
+ for (la = bmain->lamp.first; la; la = la->id.next) {
if (la->shadow_frustum_size == 0.0f)
la->shadow_frustum_size = 10.0f;
}
- for (cam = main->camera.first; cam; cam = cam->id.next) {
+ for (cam = bmain->camera.first; cam; cam = cam->id.next) {
if (cam->flag & CAM_PANORAMA) {
cam->type = CAM_PANO;
cam->flag &= ~CAM_PANORAMA;
}
}
- for (cu = main->curve.first; cu; cu = cu->id.next) {
+ for (cu = bmain->curve.first; cu; cu = cu->id.next) {
if (cu->bevfac2 == 0.0f) {
cu->bevfac1 = 0.0f;
cu->bevfac2 = 1.0f;
@@ -1246,26 +1246,26 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (main->versionfile < 263 || (main->versionfile == 263 && main->subversionfile < 5)) {
+ if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 5)) {
{
/* file output node paths are now stored in the file info struct instead socket name */
Scene *sce;
bNodeTree *ntree;
- for (sce = main->scene.first; sce; sce = sce->id.next) {
+ for (sce = bmain->scene.first; sce; sce = sce->id.next) {
if (sce->nodetree) {
do_versions_nodetree_file_output_layers_2_64_5(sce->nodetree);
do_versions_nodetree_image_layer_2_64_5(sce->nodetree);
}
}
- for (ntree = main->nodetree.first; ntree; ntree = ntree->id.next) {
+ for (ntree = bmain->nodetree.first; ntree; ntree = ntree->id.next) {
do_versions_nodetree_file_output_layers_2_64_5(ntree);
do_versions_nodetree_image_layer_2_64_5(ntree);
}
}
}
- if (main->versionfile < 263 || (main->versionfile == 263 && main->subversionfile < 6)) {
+ if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 6)) {
/* update use flags for node sockets (was only temporary before) */
Scene *sce;
Material *mat;
@@ -1274,34 +1274,34 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
World *world;
bNodeTree *ntree;
- for (sce = main->scene.first; sce; sce = sce->id.next)
+ for (sce = bmain->scene.first; sce; sce = sce->id.next)
if (sce->nodetree)
do_versions_nodetree_frame_2_64_6(sce->nodetree);
- for (mat = main->mat.first; mat; mat = mat->id.next)
+ for (mat = bmain->mat.first; mat; mat = mat->id.next)
if (mat->nodetree)
do_versions_nodetree_frame_2_64_6(mat->nodetree);
- for (tex = main->tex.first; tex; tex = tex->id.next)
+ for (tex = bmain->tex.first; tex; tex = tex->id.next)
if (tex->nodetree)
do_versions_nodetree_frame_2_64_6(tex->nodetree);
- for (lamp = main->lamp.first; lamp; lamp = lamp->id.next)
+ for (lamp = bmain->lamp.first; lamp; lamp = lamp->id.next)
if (lamp->nodetree)
do_versions_nodetree_frame_2_64_6(lamp->nodetree);
- for (world = main->world.first; world; world = world->id.next)
+ for (world = bmain->world.first; world; world = world->id.next)
if (world->nodetree)
do_versions_nodetree_frame_2_64_6(world->nodetree);
- for (ntree = main->nodetree.first; ntree; ntree = ntree->id.next)
+ for (ntree = bmain->nodetree.first; ntree; ntree = ntree->id.next)
do_versions_nodetree_frame_2_64_6(ntree);
}
- if (main->versionfile < 263 || (main->versionfile == 263 && main->subversionfile < 7)) {
+ if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 7)) {
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) {
if (md->type == eModifierType_Smoke) {
@@ -1317,11 +1317,11 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
- if (main->versionfile < 263 || (main->versionfile == 263 && main->subversionfile < 8)) {
+ if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 8)) {
/* set new deactivation values for game settings */
Scene *sce;
- for (sce = main->scene.first; sce; sce = sce->id.next) {
+ for (sce = bmain->scene.first; sce; sce = sce->id.next) {
/* Game Settings */
sce->gm.lineardeactthreshold = 0.8f;
sce->gm.angulardeactthreshold = 1.0f;
@@ -1329,8 +1329,8 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (main->versionfile < 263 || (main->versionfile == 263 && main->subversionfile < 9)) {
- FOREACH_NODETREE(main, ntree, id) {
+ if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 9)) {
+ FOREACH_NODETREE(bmain, ntree, id) {
if (ntree->type == NTREE_SHADER) {
bNode *node;
for (node = ntree->nodes.first; node; node = node->next) {
@@ -1347,11 +1347,11 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
} FOREACH_NODETREE_END
}
- if (main->versionfile < 263 || (main->versionfile == 263 && main->subversionfile < 10)) {
+ if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 10)) {
{
Scene *scene;
// composite redesign
- for (scene = main->scene.first; scene; scene = scene->id.next) {
+ for (scene = bmain->scene.first; scene; scene = scene->id.next) {
if (scene->nodetree) {
if (scene->nodetree->chunksize == 0) {
scene->nodetree->chunksize = 256;
@@ -1359,7 +1359,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- FOREACH_NODETREE(main, ntree, id) {
+ FOREACH_NODETREE(bmain, ntree, id) {
if (ntree->type == NTREE_COMPOSIT) {
bNode *node;
for (node = ntree->nodes.first; node; node = node->next) {
@@ -1377,7 +1377,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
{
bScreen *sc;
- 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) {
@@ -1399,16 +1399,16 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
{
MovieClip *clip;
- for (clip = main->movieclip.first; clip; clip = clip->id.next) {
+ for (clip = bmain->movieclip.first; clip; clip = clip->id.next) {
clip->start_frame = 1;
}
}
}
- if (main->versionfile < 263 || (main->versionfile == 263 && main->subversionfile < 11)) {
+ if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 11)) {
MovieClip *clip;
- for (clip = main->movieclip.first; clip; clip = clip->id.next) {
+ for (clip = bmain->movieclip.first; clip; clip = clip->id.next) {
MovieTrackingTrack *track;
track = clip->tracking.tracks.first;
@@ -1420,16 +1420,16 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (main->versionfile < 263 || (main->versionfile == 263 && main->subversionfile < 12)) {
+ if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 12)) {
Material *ma;
- for (ma = main->mat.first; ma; ma = ma->id.next)
+ for (ma = bmain->mat.first; ma; ma = ma->id.next)
if (ma->strand_widthfade == 2.0f)
ma->strand_widthfade = 0.0f;
}
- if (main->versionfile < 263 || (main->versionfile == 263 && main->subversionfile < 13)) {
- FOREACH_NODETREE(main, ntree, id) {
+ if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 13)) {
+ FOREACH_NODETREE(bmain, ntree, id) {
if (ntree->type == NTREE_COMPOSIT) {
bNode *node;
for (node = ntree->nodes.first; node; node = node->next) {
@@ -1445,10 +1445,10 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
} FOREACH_NODETREE_END
}
- if (main->versionfile < 263 || (main->versionfile == 263 && main->subversionfile < 14)) {
+ if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 14)) {
ParticleSettings *part;
- FOREACH_NODETREE(main, ntree, id) {
+ FOREACH_NODETREE(bmain, ntree, id) {
if (ntree->type == NTREE_COMPOSIT) {
bNode *node;
for (node = ntree->nodes.first; node; node = node->next) {
@@ -1464,14 +1464,14 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
} FOREACH_NODETREE_END
/* keep compatibility for dupliobject particle size */
- for (part = main->particle.first; part; part = part->id.next)
+ for (part = bmain->particle.first; part; part = part->id.next)
if (ELEM(part->ren_as, PART_DRAW_OB, PART_DRAW_GR))
if ((part->draw & PART_DRAW_ROTATE_OB) == 0)
part->draw |= PART_DRAW_NO_SCALE_OB;
}
- if (main->versionfile < 263 || (main->versionfile == 263 && main->subversionfile < 17)) {
- FOREACH_NODETREE(main, ntree, id) {
+ if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 17)) {
+ FOREACH_NODETREE(bmain, ntree, id) {
if (ntree->type == NTREE_COMPOSIT) {
bNode *node;
for (node = ntree->nodes.first; node; node = node->next) {
@@ -1490,10 +1490,10 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
} FOREACH_NODETREE_END
}
- if (main->versionfile < 263 || (main->versionfile == 263 && main->subversionfile < 18)) {
+ if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 18)) {
Scene *scene;
- for (scene = main->scene.first; scene; scene = scene->id.next) {
+ for (scene = bmain->scene.first; scene; scene = scene->id.next) {
if (scene->ed) {
Sequence *seq;
@@ -1527,7 +1527,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
/* color management pipeline changes compatibility code */
- if (main->versionfile < 263 || (main->versionfile == 263 && main->subversionfile < 19)) {
+ if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 19)) {
Scene *scene;
Image *ima;
bool colormanagement_disabled = false;
@@ -1535,7 +1535,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
/* make scenes which are not using color management have got None as display device,
* so they wouldn't perform linear-to-sRGB conversion on display
*/
- for (scene = main->scene.first; scene; scene = scene->id.next) {
+ for (scene = bmain->scene.first; scene; scene = scene->id.next) {
if ((scene->r.color_mgt_flag & R_COLOR_MANAGEMENT) == 0) {
ColorManagedDisplaySettings *display_settings = &scene->display_settings;
@@ -1548,7 +1548,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- for (ima = main->image.first; ima; ima = ima->id.next) {
+ for (ima = bmain->image.first; ima; ima = ima->id.next) {
if (ima->source == IMA_SRC_VIEWER) {
ima->flag |= IMA_VIEW_AS_RENDER;
}
@@ -1567,17 +1567,17 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (main->versionfile < 263 || (main->versionfile == 263 && main->subversionfile < 20)) {
+ if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 20)) {
Key *key;
- for (key = main->key.first; key; key = key->id.next) {
+ for (key = bmain->key.first; key; key = key->id.next) {
blo_do_versions_key_uidgen(key);
}
}
/* remove texco */
- if (main->versionfile < 263 || (main->versionfile == 263 && main->subversionfile < 21)) {
+ if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 21)) {
Material *ma;
- for (ma = main->mat.first; ma; ma = ma->id.next) {
+ for (ma = bmain->mat.first; ma; ma = ma->id.next) {
int a;
for (a = 0; a < MAX_MTEX; a++) {
if (ma->mtex[a]) {
@@ -1590,7 +1590,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
{
Mesh *me;
- for (me = main->mesh.first; me; me = me->id.next) {
+ for (me = bmain->mesh.first; me; me = me->id.next) {
CustomData_update_typemap(&me->vdata);
CustomData_free_layers(&me->vdata, CD_MSTICKY, me->totvert);
}
@@ -1601,10 +1601,10 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
* didn't copy animation visualization, which lead to deadlocks on motion
* path calculation for proxied armatures, see [#32742]
*/
- if (main->versionfile < 264) {
+ if (bmain->versionfile < 264) {
Object *ob;
- for (ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
if (ob->pose) {
if (ob->pose->avs.path_step == 0) {
animviz_settings_init(&ob->pose->avs);
@@ -1613,8 +1613,8 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (main->versionfile < 264 || (main->versionfile == 264 && main->subversionfile < 1)) {
- FOREACH_NODETREE(main, ntree, id) {
+ if (bmain->versionfile < 264 || (bmain->versionfile == 264 && bmain->subversionfile < 1)) {
+ FOREACH_NODETREE(bmain, ntree, id) {
if (ntree->type == NTREE_SHADER) {
bNode *node;
for (node = ntree->nodes.first; node; node = node->next)
@@ -1624,10 +1624,10 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
} FOREACH_NODETREE_END
}
- if (main->versionfile < 264 || (main->versionfile == 264 && main->subversionfile < 2)) {
+ if (bmain->versionfile < 264 || (bmain->versionfile == 264 && bmain->subversionfile < 2)) {
MovieClip *clip;
- for (clip = main->movieclip.first; clip; clip = clip->id.next) {
+ for (clip = bmain->movieclip.first; clip; clip = clip->id.next) {
MovieTracking *tracking = &clip->tracking;
MovieTrackingObject *tracking_object;
@@ -1643,12 +1643,12 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (main->versionfile < 264 || (main->versionfile == 264 && main->subversionfile < 3)) {
+ if (bmain->versionfile < 264 || (bmain->versionfile == 264 && bmain->subversionfile < 3)) {
/* smoke branch */
{
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) {
if (md->type == eModifierType_Smoke) {
@@ -1687,7 +1687,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
{
bScreen *sc;
- 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;
@@ -1707,11 +1707,11 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (main->versionfile < 264 || (main->versionfile == 264 && main->subversionfile < 5)) {
+ if (bmain->versionfile < 264 || (bmain->versionfile == 264 && bmain->subversionfile < 5)) {
/* set a unwrapping margin and ABF by default */
Scene *scene;
- for (scene = main->scene.first; scene; scene = scene->id.next) {
+ for (scene = bmain->scene.first; scene; scene = scene->id.next) {
if (scene->toolsettings->uvcalc_margin == 0.0f) {
scene->toolsettings->uvcalc_margin = 0.001f;
scene->toolsettings->unwrapper = 0;
@@ -1719,11 +1719,11 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (main->versionfile < 264 || (main->versionfile == 264 && main->subversionfile < 6)) {
+ if (bmain->versionfile < 264 || (bmain->versionfile == 264 && bmain->subversionfile < 6)) {
/* Fix for bug #32982, internal_links list could get corrupted from r51630 onward.
* Simply remove bad internal_links lists to avoid NULL pointers.
*/
- FOREACH_NODETREE(main, ntree, id) {
+ FOREACH_NODETREE(bmain, ntree, id) {
bNode *node;
bNodeLink *link, *nextlink;
@@ -1738,10 +1738,10 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
} FOREACH_NODETREE_END
}
- if (main->versionfile < 264 || (main->versionfile == 264 && main->subversionfile < 6)) {
+ if (bmain->versionfile < 264 || (bmain->versionfile == 264 && bmain->subversionfile < 6)) {
bScreen *sc;
- 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;
@@ -1756,12 +1756,12 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (main->versionfile < 264 || (main->versionfile == 264 && main->subversionfile < 7)) {
+ if (bmain->versionfile < 264 || (bmain->versionfile == 264 && bmain->subversionfile < 7)) {
/* convert tiles size from resolution and number of tiles */
{
Scene *scene;
- for (scene = main->scene.first; scene; scene = scene->id.next) {
+ for (scene = bmain->scene.first; scene; scene = scene->id.next) {
if (scene->r.tilex == 0 || scene->r.tiley == 1) {
if (scene->r.xparts && scene->r.yparts) {
/* scene could be set for panoramic rendering, so clamp with the
@@ -1781,7 +1781,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
/* collision masks */
{
Object *ob;
- for (ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
if (ob->col_group == 0) {
ob->col_group = 0x01;
ob->col_mask = 0xff;
@@ -1790,10 +1790,10 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (main->versionfile < 264 || (main->versionfile == 264 && main->subversionfile < 7)) {
+ if (bmain->versionfile < 264 || (bmain->versionfile == 264 && bmain->subversionfile < 7)) {
MovieClip *clip;
- for (clip = main->movieclip.first; clip; clip = clip->id.next) {
+ for (clip = bmain->movieclip.first; clip; clip = clip->id.next) {
MovieTrackingTrack *track;
MovieTrackingObject *object;
@@ -1809,9 +1809,9 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (main->versionfile < 265) {
+ if (bmain->versionfile < 265) {
Object *ob;
- for (ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
if (ob->step_height == 0.0f) {
ob->step_height = 0.15f;
ob->jump_speed = 10.0f;
@@ -1820,9 +1820,9 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (main->versionfile < 265 || (main->versionfile == 265 && main->subversionfile < 3)) {
+ if (bmain->versionfile < 265 || (bmain->versionfile == 265 && bmain->subversionfile < 3)) {
bScreen *sc;
- 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;
@@ -1864,11 +1864,11 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (main->versionfile < 265 || (main->versionfile == 265 && main->subversionfile < 5)) {
+ if (bmain->versionfile < 265 || (bmain->versionfile == 265 && bmain->subversionfile < 5)) {
Scene *scene;
Tex *tex;
- for (scene = main->scene.first; scene; scene = scene->id.next) {
+ for (scene = bmain->scene.first; scene; scene = scene->id.next) {
Sequence *seq;
bool set_premul = false;
@@ -1905,7 +1905,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- for (Image *image = main->image.first; image; image = image->id.next) {
+ for (Image *image = bmain->image.first; image; image = image->id.next) {
if (image->flag & IMA_DO_PREMUL) {
image->alpha_mode = IMA_ALPHA_STRAIGHT;
}
@@ -1914,7 +1914,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- for (tex = main->tex.first; tex; tex = tex->id.next) {
+ for (tex = bmain->tex.first; tex; tex = tex->id.next) {
if (tex->type == TEX_IMAGE && (tex->imaflag & TEX_USEALPHA) == 0) {
Image *image = blo_do_versions_newlibadr(fd, tex->id.lib, tex->ima);
@@ -1923,7 +1923,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- FOREACH_NODETREE(main, ntree, id) {
+ FOREACH_NODETREE(bmain, ntree, id) {
if (ntree->type == NTREE_COMPOSIT) {
bNode *node;
for (node = ntree->nodes.first; node; node = node->next) {
@@ -1939,20 +1939,20 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
} FOREACH_NODETREE_END
}
- else if (main->versionfile < 266 || (main->versionfile == 266 && main->subversionfile < 1)) {
+ else if (bmain->versionfile < 266 || (bmain->versionfile == 266 && bmain->subversionfile < 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;
- for (tex = main->tex.first; tex; tex = tex->id.next)
+ for (tex = bmain->tex.first; tex; tex = tex->id.next)
if (tex->type == TEX_IMAGE)
tex->imaflag |= TEX_USEALPHA;
}
- if (main->versionfile < 265 || (main->versionfile == 265 && main->subversionfile < 7)) {
+ if (bmain->versionfile < 265 || (bmain->versionfile == 265 && bmain->subversionfile < 7)) {
Curve *cu;
- for (cu = main->curve.first; cu; cu = cu->id.next) {
+ for (cu = bmain->curve.first; cu; cu = cu->id.next) {
if (cu->flag & (CU_FRONT | CU_BACK)) {
if ( cu->ext1 != 0.0f || cu->ext2 != 0.0f) {
Nurb *nu;
@@ -1984,16 +1984,16 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (MAIN_VERSION_OLDER(main, 265, 9)) {
+ if (MAIN_VERSION_OLDER(bmain, 265, 9)) {
Mesh *me;
- for (me = main->mesh.first; me; me = me->id.next) {
+ for (me = bmain->mesh.first; me; me = me->id.next) {
BKE_mesh_do_versions_cd_flag_init(me);
}
}
- if (MAIN_VERSION_OLDER(main, 265, 10)) {
+ if (MAIN_VERSION_OLDER(bmain, 265, 10)) {
Brush *br;
- for (br = main->brush.first; br; br = br->id.next) {
+ for (br = bmain->brush.first; br; br = br->id.next) {
if (br->ob_mode & OB_MODE_TEXTURE_PAINT) {
br->mtex.brush_map_mode = MTEX_MAP_MODE_TILED;
}
@@ -2001,8 +2001,8 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
// add storage for compositor translate nodes when not existing
- if (MAIN_VERSION_OLDER(main, 265, 11)) {
- FOREACH_NODETREE(main, ntree, id) {
+ if (MAIN_VERSION_OLDER(bmain, 265, 11)) {
+ FOREACH_NODETREE(bmain, ntree, id) {
if (ntree->type == NTREE_COMPOSIT) {
bNode *node;
for (node = ntree->nodes.first; node; node = node->next) {
@@ -2014,15 +2014,15 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
} FOREACH_NODETREE_END
}
- if (MAIN_VERSION_OLDER(main, 266, 2)) {
- FOREACH_NODETREE(main, ntree, id) {
+ if (MAIN_VERSION_OLDER(bmain, 266, 2)) {
+ FOREACH_NODETREE(bmain, ntree, id) {
do_versions_nodetree_customnodes(ntree, ((ID *)ntree == id));
} FOREACH_NODETREE_END
}
- if (MAIN_VERSION_OLDER(main, 266, 2)) {
+ if (MAIN_VERSION_OLDER(bmain, 266, 2)) {
bScreen *sc;
- 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;
@@ -2056,7 +2056,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
/* Set flag for delayed do_versions in lib_verify_nodetree. It needs valid typeinfo pointers ... */
{
- FOREACH_NODETREE(main, ntree, id) {
+ FOREACH_NODETREE(bmain, ntree, id) {
/* XXX This should be kept without version check for now!
* As long as USE_NODE_COMPAT_CUSTOMNODES is active, files will write links
* to tree interface sockets for forward compatibility. These links need to be removed again
@@ -2068,22 +2068,22 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
/* Only add interface nodes once.
* In old Blender versions they will be removed automatically due to undefined type */
- if (MAIN_VERSION_OLDER(main, 266, 2))
+ if (MAIN_VERSION_OLDER(bmain, 266, 2))
ntree->flag |= NTREE_DO_VERSIONS_CUSTOMNODES_GROUP_CREATE_INTERFACE;
}
FOREACH_NODETREE_END
}
- if (MAIN_VERSION_OLDER(main, 266, 3)) {
+ if (MAIN_VERSION_OLDER(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
- * to update existing node names only applied to main->nodetree (i.e. group nodes).
+ * to update existing node names only applied to bmain->nodetree (i.e. group nodes).
* Uniqueness is now required for proper preview mapping,
* so do this now to ensure old files don't break.
*/
bNode *node;
- FOREACH_NODETREE(main, ntree, id) {
+ FOREACH_NODETREE(bmain, ntree, id) {
if (id == &ntree->id)
continue; /* already fixed for node groups */
@@ -2094,9 +2094,9 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (!MAIN_VERSION_ATLEAST(main, 266, 4)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 266, 4)) {
Brush *brush;
- 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->mask_mtex);
if (brush->ob_mode & OB_MODE_TEXTURE_PAINT) {
@@ -2105,11 +2105,11 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (!MAIN_VERSION_ATLEAST(main, 266, 6)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 266, 6)) {
Brush *brush;
#define BRUSH_TEXTURE_OVERLAY (1 << 21)
- for (brush = main->brush.first; brush; brush = brush->id.next) {
+ for (brush = bmain->brush.first; brush; brush = brush->id.next) {
brush->overlay_flags = 0;
if (brush->flag & BRUSH_TEXTURE_OVERLAY)
brush->overlay_flags |= (BRUSH_OVERLAY_PRIMARY | BRUSH_OVERLAY_CURSOR);
@@ -2117,11 +2117,11 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
#undef BRUSH_TEXTURE_OVERLAY
}
- if (main->versionfile < 267) {
+ if (bmain->versionfile < 267) {
//if (!DNA_struct_elem_find(fd->filesdna, "Brush", "int", "stencil_pos")) {
Brush *brush;
- for (brush = main->brush.first; brush; brush = brush->id.next) {
+ for (brush = bmain->brush.first; brush; brush = brush->id.next) {
if (brush->stencil_dimension[0] == 0) {
brush->stencil_dimension[0] = 256;
brush->stencil_dimension[1] = 256;
@@ -2146,12 +2146,12 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
/* default values in Freestyle settings */
- if (main->versionfile < 267) {
+ if (bmain->versionfile < 267) {
Scene *sce;
SceneRenderLayer *srl;
FreestyleLineStyle *linestyle;
- for (sce = main->scene.first; sce; sce = sce->id.next) {
+ for (sce = bmain->scene.first; sce; sce = sce->id.next) {
if (sce->r.line_thickness_mode == 0) {
sce->r.line_thickness_mode = R_LINE_THICKNESS_ABSOLUTE;
sce->r.unit_line_thickness = 1.0f;
@@ -2187,7 +2187,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- for (linestyle = main->linestyle.first; linestyle; linestyle = linestyle->id.next) {
+ for (linestyle = bmain->linestyle.first; linestyle; linestyle = linestyle->id.next) {
#if 1
/* disable the Misc panel for now */
if (linestyle->panel == LS_PANEL_MISC) {
@@ -2205,13 +2205,13 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (main->versionfile < 267) {
+ if (bmain->versionfile < 267) {
/* Initialize the active_viewer_key for compositing */
bScreen *screen;
Scene *scene;
bNodeInstanceKey active_viewer_key = {0};
/* simply pick the first node space and use that for the active viewer key */
- for (screen = main->screen.first; screen; screen = screen->id.next) {
+ for (screen = bmain->screen.first; screen; screen = screen->id.next) {
ScrArea *sa;
for (sa = screen->areabase.first; sa; sa = sa->next) {
SpaceLink *sl;
@@ -2233,17 +2233,17 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
break;
}
- for (scene = main->scene.first; scene; scene = scene->id.next) {
+ for (scene = bmain->scene.first; scene; scene = scene->id.next) {
/* NB: scene->nodetree is a local ID block, has been direct_link'ed */
if (scene->nodetree)
scene->nodetree->active_viewer_key = active_viewer_key;
}
}
- if (MAIN_VERSION_OLDER(main, 267, 1)) {
+ if (MAIN_VERSION_OLDER(bmain, 267, 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) {
if (md->type == eModifierType_Smoke) {
@@ -2261,17 +2261,17 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (!MAIN_VERSION_ATLEAST(main, 268, 1)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 268, 1)) {
Brush *brush;
- for (brush = main->brush.first; brush; brush = brush->id.next) {
+ for (brush = bmain->brush.first; brush; brush = brush->id.next) {
brush->spacing = MAX2(1, brush->spacing);
}
}
- if (!MAIN_VERSION_ATLEAST(main, 268, 2)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 268, 2)) {
Brush *brush;
#define BRUSH_FIXED (1 << 6)
- for (brush = main->brush.first; brush; brush = brush->id.next) {
+ for (brush = bmain->brush.first; brush; brush = brush->id.next) {
brush->flag &= ~BRUSH_FIXED;
if (brush->cursor_overlay_alpha < 2)
@@ -2285,11 +2285,11 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
- if (!MAIN_VERSION_ATLEAST(main, 268, 4)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 268, 4)) {
bScreen *sc;
Object *ob;
- for (ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
bConstraint *con;
for (con = ob->constraints.first; con; con = con->next) {
if (con->type == CONSTRAINT_TYPE_SHRINKWRAP) {
@@ -2302,7 +2302,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- 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_Smoke) {
@@ -2321,7 +2321,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
*
* We moved this check to the do versions to be sure the value makes any sense.
*/
- 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;
@@ -2336,7 +2336,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- for (ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
bSensor *sens;
bTouchSensor *ts;
bCollisionSensor *cs;
@@ -2363,12 +2363,12 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (!MAIN_VERSION_ATLEAST(main, 268, 5)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 268, 5)) {
bScreen *sc;
ScrArea *sa;
/* add missing (+) expander in node editor */
- for (sc = main->screen.first; sc; sc = sc->id.next) {
+ for (sc = bmain->screen.first; sc; sc = sc->id.next) {
for (sa = sc->areabase.first; sa; sa = sa->next) {
ARegion *ar, *arnew;
@@ -2397,9 +2397,9 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (!MAIN_VERSION_ATLEAST(main, 269, 1)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 269, 1)) {
/* Removal of Cycles SSS Compatible falloff */
- FOREACH_NODETREE(main, ntree, id) {
+ FOREACH_NODETREE(bmain, ntree, id) {
if (ntree->type == NTREE_SHADER) {
bNode *node;
for (node = ntree->nodes.first; node; node = node->next) {
@@ -2413,9 +2413,9 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
} FOREACH_NODETREE_END
}
- if (!MAIN_VERSION_ATLEAST(main, 269, 2)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 269, 2)) {
/* Initialize CDL settings for Color Balance nodes */
- FOREACH_NODETREE(main, ntree, id) {
+ FOREACH_NODETREE(bmain, ntree, id) {
if (ntree->type == NTREE_COMPOSIT) {
bNode *node;
for (node = ntree->nodes.first; node; node = node->next) {
@@ -2440,14 +2440,14 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
} FOREACH_NODETREE_END
}
- if (!MAIN_VERSION_ATLEAST(main, 269, 3)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 269, 3)) {
bScreen *sc;
ScrArea *sa;
SpaceLink *sl;
Scene *scene;
/* Update files using invalid (outdated) outlinevis Outliner values. */
- for (sc = main->screen.first; sc; sc = sc->id.next) {
+ for (sc = bmain->screen.first; sc; sc = sc->id.next) {
for (sa = sc->areabase.first; sa; sa = sa->next) {
for (sl = sa->spacedata.first; sl; sl = sl->next) {
if (sl->spacetype == SPACE_OUTLINER) {
@@ -2466,7 +2466,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
if (!DNA_struct_elem_find(fd->filesdna, "MovieTrackingTrack", "float", "weight")) {
MovieClip *clip;
- for (clip = main->movieclip.first; clip; clip = clip->id.next) {
+ for (clip = bmain->movieclip.first; clip; clip = clip->id.next) {
MovieTracking *tracking = &clip->tracking;
MovieTrackingObject *tracking_object;
for (tracking_object = tracking->objects.first;
@@ -2487,7 +2487,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
if (!DNA_struct_elem_find(fd->filesdna, "TriangulateModifierData", "int", "quad_method")) {
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) {
if (md->type == eModifierType_Triangulate) {
@@ -2505,7 +2505,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- for (scene = main->scene.first; scene; scene = scene->id.next) {
+ for (scene = bmain->scene.first; scene; scene = scene->id.next) {
/* this can now be turned off */
ToolSettings *ts = scene->toolsettings;
if (ts->sculpt)
@@ -2529,17 +2529,17 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (!MAIN_VERSION_ATLEAST(main, 269, 4)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 269, 4)) {
/* Internal degrees to radians conversions... */
{
Scene *scene;
Object *ob;
Lamp *lamp;
- for (lamp = main->lamp.first; lamp; lamp = lamp->id.next)
+ for (lamp = bmain->lamp.first; lamp; lamp = lamp->id.next)
lamp->spotsize = DEG2RADF(lamp->spotsize);
- for (ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
ModifierData *md;
bSensor *bs;
bActuator *ba;
@@ -2578,7 +2578,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- for (scene = main->scene.first; scene; scene = scene->id.next) {
+ for (scene = bmain->scene.first; scene; scene = scene->id.next) {
Sequence *seq;
SEQ_BEGIN (scene->ed, seq)
{
@@ -2590,7 +2590,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
SEQ_END
}
- FOREACH_NODETREE(main, ntree, id) {
+ FOREACH_NODETREE(bmain, ntree, id) {
if (ntree->type == NTREE_COMPOSIT) {
bNode *node;
for (node = ntree->nodes.first; node; node = node->next) {
@@ -2613,7 +2613,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
if (!DNA_struct_elem_find(fd->filesdna, "MovieTrackingPlaneTrack", "float", "image_opacity")) {
MovieClip *clip;
- for (clip = main->movieclip.first; clip; clip = clip->id.next) {
+ for (clip = bmain->movieclip.first; clip; clip = clip->id.next) {
MovieTrackingPlaneTrack *plane_track;
for (plane_track = clip->tracking.plane_tracks.first;
plane_track;
@@ -2625,9 +2625,9 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (!MAIN_VERSION_ATLEAST(main, 269, 7)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 269, 7)) {
Scene *scene;
- for (scene = main->scene.first; scene; scene = scene->id.next) {
+ for (scene = bmain->scene.first; scene; scene = scene->id.next) {
Sculpt *sd = scene->toolsettings->sculpt;
if (sd) {
@@ -2645,20 +2645,20 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (!MAIN_VERSION_ATLEAST(main, 269, 8)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 269, 8)) {
Curve *cu;
- for (cu = main->curve.first; cu; cu = cu->id.next) {
+ for (cu = bmain->curve.first; cu; cu = cu->id.next) {
if (cu->str) {
cu->len_wchar = BLI_strlen_utf8(cu->str);
}
}
}
- if (!MAIN_VERSION_ATLEAST(main, 269, 9)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 269, 9)) {
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) {
if (md->type == eModifierType_Build) {
@@ -2671,10 +2671,10 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (!MAIN_VERSION_ATLEAST(main, 269, 11)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 269, 11)) {
bScreen *sc;
- 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 *space_link;
diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c
index 86e6071180e..e1b91726821 100644
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@ -347,14 +347,14 @@ static void do_version_bbone_easing_fcurve_fix(ID *UNUSED(id), FCurve *fcu, void
}
-void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
+void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain)
{
- if (!MAIN_VERSION_ATLEAST(main, 270, 0)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 270, 0)) {
if (!DNA_struct_elem_find(fd->filesdna, "BevelModifierData", "float", "profile")) {
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) {
if (md->type == eModifierType_Bevel) {
@@ -367,7 +367,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
}
/* nodes don't use fixed node->id any more, clean up */
- FOREACH_NODETREE(main, ntree, id) {
+ FOREACH_NODETREE(bmain, ntree, id) {
if (ntree->type == NTREE_COMPOSIT) {
bNode *node;
for (node = ntree->nodes.first; node; node = node->next) {
@@ -381,7 +381,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(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 *area;
for (area = screen->areabase.first; area; area = area->next) {
SpaceLink *space_link;
@@ -399,18 +399,18 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
if (!DNA_struct_elem_find(fd->filesdna, "MovieTrackingSettings", "float", "default_weight")) {
MovieClip *clip;
- for (clip = main->movieclip.first; clip; clip = clip->id.next) {
+ for (clip = bmain->movieclip.first; clip; clip = clip->id.next) {
clip->tracking.settings.default_weight = 1.0f;
}
}
}
- if (!MAIN_VERSION_ATLEAST(main, 270, 1)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 270, 1)) {
Scene *sce;
Object *ob;
/* Update Transform constraint (another deg -> rad stuff). */
- for (ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
do_version_constraints_radians_degrees_270_1(&ob->constraints);
if (ob->pose) {
@@ -422,39 +422,39 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- for (sce = main->scene.first; sce; sce = sce->id.next) {
+ for (sce = bmain->scene.first; sce; sce = sce->id.next) {
if (sce->r.raytrace_structure == R_RAYSTRUCTURE_BLIBVH) {
sce->r.raytrace_structure = R_RAYSTRUCTURE_AUTO;
}
}
}
- if (!MAIN_VERSION_ATLEAST(main, 270, 2)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 270, 2)) {
Mesh *me;
/* Mesh smoothresh deg->rad. */
- for (me = main->mesh.first; me; me = me->id.next) {
+ for (me = bmain->mesh.first; me; me = me->id.next) {
me->smoothresh = DEG2RADF(me->smoothresh);
}
}
- if (!MAIN_VERSION_ATLEAST(main, 270, 3)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 270, 3)) {
FreestyleLineStyle *linestyle;
- for (linestyle = main->linestyle.first; linestyle; linestyle = linestyle->id.next) {
+ for (linestyle = bmain->linestyle.first; linestyle; linestyle = linestyle->id.next) {
linestyle->flag |= LS_NO_SORTING;
linestyle->sort_key = LS_SORT_KEY_DISTANCE_FROM_CAMERA;
linestyle->integration_type = LS_INTEGRATION_MEAN;
}
}
- if (!MAIN_VERSION_ATLEAST(main, 270, 4)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 270, 4)) {
/* ui_previews were not handled correctly when copying areas, leading to corrupted files (see T39847).
* This will always reset situation to a valid state.
*/
bScreen *sc;
- 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;
@@ -471,11 +471,11 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (!MAIN_VERSION_ATLEAST(main, 270, 5)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 270, 5)) {
Object *ob;
/* Update Transform constraint (again :|). */
- for (ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
do_version_constraints_radians_degrees_270_5(&ob->constraints);
if (ob->pose) {
@@ -488,18 +488,18 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (!MAIN_VERSION_ATLEAST(main, 271, 0)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 271, 0)) {
if (!DNA_struct_elem_find(fd->filesdna, "Material", "int", "mode2")) {
Material *ma;
- for (ma = main->mat.first; ma; ma = ma->id.next)
+ for (ma = bmain->mat.first; ma; ma = ma->id.next)
ma->mode2 = MA_CASTSHADOW;
}
if (!DNA_struct_elem_find(fd->filesdna, "RenderData", "BakeData", "bake")) {
Scene *sce;
- for (sce = main->scene.first; sce; sce = sce->id.next) {
+ for (sce = bmain->scene.first; sce; sce = sce->id.next) {
sce->r.bake.flag = R_BAKE_CLEAR;
sce->r.bake.width = 512;
sce->r.bake.height = 512;
@@ -521,7 +521,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
if (!DNA_struct_elem_find(fd->filesdna, "FreestyleLineStyle", "float", "texstep")) {
FreestyleLineStyle *linestyle;
- for (linestyle = main->linestyle.first; linestyle; linestyle = linestyle->id.next) {
+ for (linestyle = bmain->linestyle.first; linestyle; linestyle = linestyle->id.next) {
linestyle->flag |= LS_TEXTURE;
linestyle->texstep = 1.0;
}
@@ -529,18 +529,18 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
{
Scene *scene;
- for (scene = main->scene.first; scene; scene = scene->id.next) {
+ for (scene = bmain->scene.first; scene; scene = scene->id.next) {
int num_layers = BLI_listbase_count(&scene->r.layers);
scene->r.actlay = min_ff(scene->r.actlay, num_layers - 1);
}
}
}
- if (!MAIN_VERSION_ATLEAST(main, 271, 1)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 271, 1)) {
if (!DNA_struct_elem_find(fd->filesdna, "Material", "float", "line_col[4]")) {
Material *mat;
- for (mat = main->mat.first; mat; mat = mat->id.next) {
+ for (mat = bmain->mat.first; mat; mat = mat->id.next) {
mat->line_col[0] = mat->line_col[1] = mat->line_col[2] = 0.0f;
mat->line_col[3] = mat->alpha;
}
@@ -548,17 +548,17 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
if (!DNA_struct_elem_find(fd->filesdna, "RenderData", "int", "preview_start_resolution")) {
Scene *scene;
- for (scene = main->scene.first; scene; scene = scene->id.next) {
+ for (scene = bmain->scene.first; scene; scene = scene->id.next) {
scene->r.preview_start_resolution = 64;
}
}
}
- if (!MAIN_VERSION_ATLEAST(main, 271, 2)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 271, 2)) {
/* init up & track axis property of trackto actuators */
Object *ob;
- for (ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
bActuator *act;
for (act = ob->actuators.first; act; act = act->next) {
if (act->type == ACT_EDIT_OBJECT) {
@@ -577,16 +577,16 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (!MAIN_VERSION_ATLEAST(main, 271, 3)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 271, 3)) {
Brush *br;
- for (br = main->brush.first; br; br = br->id.next) {
+ for (br = bmain->brush.first; br; br = br->id.next) {
br->fill_threshold = 0.2f;
}
if (!DNA_struct_elem_find(fd->filesdna, "BevelModifierData", "int", "mat")) {
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) {
@@ -599,9 +599,9 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (!MAIN_VERSION_ATLEAST(main, 271, 6)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 271, 6)) {
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) {
@@ -615,27 +615,27 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (!MAIN_VERSION_ATLEAST(main, 272, 0)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 272, 0)) {
if (!DNA_struct_elem_find(fd->filesdna, "RenderData", "int", "preview_start_resolution")) {
Scene *scene;
- for (scene = main->scene.first; scene; scene = scene->id.next) {
+ for (scene = bmain->scene.first; scene; scene = scene->id.next) {
scene->r.preview_start_resolution = 64;
}
}
}
- if (!MAIN_VERSION_ATLEAST(main, 272, 1)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 272, 1)) {
Brush *br;
- for (br = main->brush.first; br; br = br->id.next) {
+ for (br = bmain->brush.first; br; br = br->id.next) {
if ((br->ob_mode & OB_MODE_SCULPT) && ELEM(br->sculpt_tool, SCULPT_TOOL_GRAB, SCULPT_TOOL_SNAKE_HOOK))
br->alpha = 1.0f;
}
}
- if (!MAIN_VERSION_ATLEAST(main, 272, 2)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 272, 2)) {
if (!DNA_struct_elem_find(fd->filesdna, "Image", "float", "gen_color")) {
Image *image;
- for (image = main->image.first; image != NULL; image = image->id.next) {
+ for (image = bmain->image.first; image != NULL; image = image->id.next) {
image->gen_color[3] = 1.0f;
}
}
@@ -644,7 +644,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
Object *ob;
/* Update Transform constraint (again :|). */
- for (ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
do_version_constraints_stretch_to_limits(&ob->constraints);
if (ob->pose) {
@@ -658,13 +658,13 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (!MAIN_VERSION_ATLEAST(main, 273, 1)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 273, 1)) {
#define BRUSH_RAKE (1 << 7)
#define BRUSH_RANDOM_ROTATION (1 << 25)
Brush *br;
- for (br = main->brush.first; br; br = br->id.next) {
+ for (br = bmain->brush.first; br; br = br->id.next) {
if (br->flag & BRUSH_RAKE) {
br->mtex.brush_angle_mode |= MTEX_ANGLE_RAKE;
br->mask_mtex.brush_angle_mode |= MTEX_ANGLE_RAKE;
@@ -682,11 +682,11 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
#undef BRUSH_RANDOM_ROTATION
/* Customizable Safe Areas */
- if (!MAIN_VERSION_ATLEAST(main, 273, 2)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 273, 2)) {
if (!DNA_struct_elem_find(fd->filesdna, "Scene", "DisplaySafeAreas", "safe_areas")) {
Scene *scene;
- for (scene = main->scene.first; scene; scene = scene->id.next) {
+ for (scene = bmain->scene.first; scene; scene = scene->id.next) {
copy_v2_fl2(scene->safe_areas.title, 3.5f / 100.0f, 3.5f / 100.0f);
copy_v2_fl2(scene->safe_areas.action, 10.0f / 100.0f, 5.0f / 100.0f);
copy_v2_fl2(scene->safe_areas.title_center, 17.5f / 100.0f, 5.0f / 100.0f);
@@ -695,9 +695,9 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (!MAIN_VERSION_ATLEAST(main, 273, 3)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 273, 3)) {
ParticleSettings *part;
- for (part = main->particle.first; part; part = part->id.next) {
+ for (part = bmain->particle.first; part; part = part->id.next) {
if (part->clumpcurve)
part->child_flag |= PART_CHILD_USE_CLUMP_CURVE;
if (part->roughcurve)
@@ -705,11 +705,11 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (!MAIN_VERSION_ATLEAST(main, 273, 6)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 273, 6)) {
if (!DNA_struct_elem_find(fd->filesdna, "ClothSimSettings", "float", "bending_damping")) {
Object *ob;
ModifierData *md;
- for (ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
for (md = ob->modifiers.first; md; md = md->next) {
if (md->type == eModifierType_Cloth) {
ClothModifierData *clmd = (ClothModifierData *)md;
@@ -727,21 +727,21 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
if (!DNA_struct_elem_find(fd->filesdna, "ParticleSettings", "float", "clump_noise_size")) {
ParticleSettings *part;
- for (part = main->particle.first; part; part = part->id.next) {
+ for (part = bmain->particle.first; part; part = part->id.next) {
part->clump_noise_size = 1.0f;
}
}
if (!DNA_struct_elem_find(fd->filesdna, "ParticleSettings", "int", "kink_extra_steps")) {
ParticleSettings *part;
- for (part = main->particle.first; part; part = part->id.next) {
+ for (part = bmain->particle.first; part; part = part->id.next) {
part->kink_extra_steps = 4;
}
}
if (!DNA_struct_elem_find(fd->filesdna, "MTex", "float", "kinkampfac")) {
ParticleSettings *part;
- for (part = main->particle.first; part; part = part->id.next) {
+ for (part = bmain->particle.first; part; part = part->id.next) {
int a;
for (a = 0; a < MAX_MTEX; a++) {
MTex *mtex = part->mtex[a];
@@ -755,7 +755,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
if (!DNA_struct_elem_find(fd->filesdna, "HookModifierData", "char", "flag")) {
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) {
if (md->type == eModifierType_Hook) {
@@ -767,7 +767,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
}
if (!DNA_struct_elem_find(fd->filesdna, "NodePlaneTrackDeformData", "char", "flag")) {
- FOREACH_NODETREE(main, ntree, id) {
+ FOREACH_NODETREE(bmain, ntree, id) {
if (ntree->type == NTREE_COMPOSIT) {
bNode *node;
for (node = ntree->nodes.first; node; node = node->next) {
@@ -785,7 +785,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
if (!DNA_struct_elem_find(fd->filesdna, "Camera", "GPUDOFSettings", "gpu_dof")) {
Camera *ca;
- for (ca = main->camera.first; ca; ca = ca->id.next) {
+ for (ca = bmain->camera.first; ca; ca = ca->id.next) {
ca->gpu_dof.fstop = 128.0f;
ca->gpu_dof.focal_length = 1.0f;
ca->gpu_dof.focus_distance = 1.0f;
@@ -794,9 +794,9 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (!MAIN_VERSION_ATLEAST(main, 273, 8)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 273, 8)) {
Object *ob;
- for (ob = main->object.first; ob != NULL; ob = ob->id.next) {
+ for (ob = bmain->object.first; ob != NULL; ob = ob->id.next) {
ModifierData *md;
for (md = ob->modifiers.last; md != NULL; md = md->prev) {
if (modifier_unique_name(&ob->modifiers, md)) {
@@ -808,14 +808,14 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (!MAIN_VERSION_ATLEAST(main, 273, 9)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 273, 9)) {
bScreen *scr;
ScrArea *sa;
SpaceLink *sl;
ARegion *ar;
/* Make sure sequencer preview area limits zoom */
- for (scr = main->screen.first; scr; scr = scr->id.next) {
+ for (scr = bmain->screen.first; scr; scr = scr->id.next) {
for (sa = scr->areabase.first; sa; sa = sa->next) {
for (sl = sa->spacedata.first; sl; sl = sl->next) {
if (sl->spacetype == SPACE_SEQ) {
@@ -833,12 +833,12 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (!MAIN_VERSION_ATLEAST(main, 274, 1)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 274, 1)) {
/* particle systems need to be forced to redistribute for jitter mode fix */
{
Object *ob;
ParticleSystem *psys;
- for (ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
for (psys = ob->particlesystem.first; psys; psys = psys->next) {
if ((psys->pointcache->flag & PTCACHE_BAKED) == 0) {
psys->recalc |= PSYS_RECALC_RESET;
@@ -850,7 +850,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
/* hysteresis setted to 10% but not actived */
if (!DNA_struct_elem_find(fd->filesdna, "LodLevel", "int", "obhysteresis")) {
Object *ob;
- for (ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
LodLevel *level;
for (level = ob->lodlevels.first; level; level = level->next) {
level->obhysteresis = 10;
@@ -860,14 +860,14 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
if (!DNA_struct_elem_find(fd->filesdna, "GameData", "int", "scehysteresis")) {
Scene *scene;
- for (scene = main->scene.first; scene; scene = scene->id.next) {
+ for (scene = bmain->scene.first; scene; scene = scene->id.next) {
scene->gm.scehysteresis = 10;
}
}
}
- if (!MAIN_VERSION_ATLEAST(main, 274, 2)) {
- FOREACH_NODETREE(main, ntree, id) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 274, 2)) {
+ FOREACH_NODETREE(bmain, ntree, id) {
bNode *node;
bNodeSocket *sock;
@@ -893,7 +893,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
} FOREACH_NODETREE_END
}
- if (!MAIN_VERSION_ATLEAST(main, 274, 4)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 274, 4)) {
SceneRenderView *srv;
wmWindowManager *wm;
bScreen *screen;
@@ -902,7 +902,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
Camera *cam;
Image *ima;
- for (scene = main->scene.first; scene; scene = scene->id.next) {
+ for (scene = bmain->scene.first; scene; scene = scene->id.next) {
Sequence *seq;
BKE_scene_add_render_view(scene, STEREO_LEFT_NAME);
@@ -932,7 +932,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
SEQ_END
}
- for (screen = main->screen.first; screen; screen = screen->id.next) {
+ for (screen = bmain->screen.first; screen; screen = screen->id.next) {
ScrArea *sa;
for (sa = screen->areabase.first; sa; sa = sa->next) {
SpaceLink *sl;
@@ -959,12 +959,12 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- for (cam = main->camera.first; cam; cam = cam->id.next) {
+ for (cam = bmain->camera.first; cam; cam = cam->id.next) {
cam->stereo.interocular_distance = 0.065f;
cam->stereo.convergence_distance = 30.0f * 0.065f;
}
- for (ima = main->image.first; ima; ima = ima->id.next) {
+ for (ima = bmain->image.first; ima; ima = ima->id.next) {
ima->stereo3d_format = MEM_callocN(sizeof(Stereo3dFormat), "Image Stereo 3d Format");
if (ima->packedfile) {
@@ -977,18 +977,18 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- for (wm = main->wm.first; wm; wm = wm->id.next) {
+ for (wm = bmain->wm.first; wm; wm = wm->id.next) {
for (win = wm->windows.first; win; win = win->next) {
win->stereo3d_format = MEM_callocN(sizeof(Stereo3dFormat), "Stereo Display 3d Format");
}
}
}
- if (!MAIN_VERSION_ATLEAST(main, 274, 6)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 274, 6)) {
bScreen *screen;
if (!DNA_struct_elem_find(fd->filesdna, "FileSelectParams", "int", "thumbnail_size")) {
- for (screen = main->screen.first; screen; screen = screen->id.next) {
+ for (screen = bmain->screen.first; screen; screen = screen->id.next) {
ScrArea *sa;
for (sa = screen->areabase.first; sa; sa = sa->next) {
@@ -1009,7 +1009,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
if (!DNA_struct_elem_find(fd->filesdna, "RenderData", "short", "simplify_subsurf_render")) {
Scene *scene;
- for (scene = main->scene.first; scene != NULL; scene = scene->id.next) {
+ for (scene = bmain->scene.first; scene != NULL; scene = scene->id.next) {
scene->r.simplify_subsurf_render = scene->r.simplify_subsurf;
scene->r.simplify_particles_render = scene->r.simplify_particles;
}
@@ -1018,7 +1018,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
if (!DNA_struct_elem_find(fd->filesdna, "DecimateModifierData", "float", "defgrp_factor")) {
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) {
if (md->type == eModifierType_Decimate) {
@@ -1030,20 +1030,20 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (!MAIN_VERSION_ATLEAST(main, 275, 3)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 275, 3)) {
Brush *br;
#define BRUSH_TORUS (1 << 1)
- for (br = main->brush.first; br; br = br->id.next) {
+ for (br = bmain->brush.first; br; br = br->id.next) {
br->flag &= ~BRUSH_TORUS;
}
#undef BRUSH_TORUS
}
- if (!MAIN_VERSION_ATLEAST(main, 276, 2)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 276, 2)) {
if (!DNA_struct_elem_find(fd->filesdna, "bPoseChannel", "float", "custom_scale")) {
Object *ob;
- for (ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
if (ob->pose) {
bPoseChannel *pchan;
for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
@@ -1056,7 +1056,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
{
bScreen *screen;
#define RV3D_VIEW_PERSPORTHO 7
- for (screen = main->screen.first; screen; screen = screen->id.next) {
+ for (screen = bmain->screen.first; screen; screen = screen->id.next) {
ScrArea *sa;
for (sa = screen->areabase.first; sa; sa = sa->next) {
SpaceLink *sl;
@@ -1085,7 +1085,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
{
Lamp *lamp;
#define LA_YF_PHOTON 5
- for (lamp = main->lamp.first; lamp; lamp = lamp->id.next) {
+ for (lamp = bmain->lamp.first; lamp; lamp = lamp->id.next) {
if (lamp->type == LA_YF_PHOTON) {
lamp->type = LA_LOCAL;
}
@@ -1095,7 +1095,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
{
Object *ob;
- for (ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
if (ob->body_type == OB_BODY_TYPE_CHARACTER && (ob->gameflag & OB_BOUNDS) && ob->collision_boundtype == OB_BOUND_TRIANGLE_MESH) {
ob->boundtype = ob->collision_boundtype = OB_BOUND_BOX;
}
@@ -1104,10 +1104,10 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
}
- if (!MAIN_VERSION_ATLEAST(main, 276, 3)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 276, 3)) {
if (!DNA_struct_elem_find(fd->filesdna, "RenderData", "CurveMapping", "mblur_shutter_curve")) {
Scene *scene;
- for (scene = main->scene.first; scene != NULL; scene = scene->id.next) {
+ for (scene = bmain->scene.first; scene != NULL; scene = scene->id.next) {
CurveMapping *curve_mapping = &scene->r.mblur_shutter_curve;
curvemapping_set_defaults(curve_mapping, 1, 0.0f, 0.0f, 1.0f, 1.0f);
curvemapping_initialize(curve_mapping);
@@ -1119,8 +1119,8 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (!MAIN_VERSION_ATLEAST(main, 276, 4)) {
- for (Scene *scene = main->scene.first; scene; scene = scene->id.next) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 276, 4)) {
+ for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
ToolSettings *ts = scene->toolsettings;
if (ts->gp_sculpt.brush[0].size == 0) {
@@ -1195,7 +1195,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- for (bGPdata *gpd = main->gpencil.first; gpd; gpd = gpd->id.next) {
+ for (bGPdata *gpd = bmain->gpencil.first; gpd; gpd = gpd->id.next) {
bool enabled = false;
/* Ensure that the datablock's onionskinning toggle flag
@@ -1214,18 +1214,18 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
}
if (!DNA_struct_elem_find(fd->filesdna, "Object", "unsigned char", "max_jumps")) {
- for (Object *ob = main->object.first; ob; ob = ob->id.next) {
+ for (Object *ob = bmain->object.first; ob; ob = ob->id.next) {
ob->max_jumps = 1;
}
}
}
- if (!MAIN_VERSION_ATLEAST(main, 276, 5)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 276, 5)) {
ListBase *lbarray[MAX_LIBARRAY];
int a;
/* Important to clear all non-persistent flags from older versions here, otherwise they could collide
* with any new persistent flag we may add in the future. */
- a = set_listbasepointers(main, lbarray);
+ a = set_listbasepointers(bmain, lbarray);
while (a--) {
for (ID *id = lbarray[a]->first; id; id = id->next) {
id->flag &= LIB_FAKEUSER;
@@ -1233,15 +1233,15 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (!MAIN_VERSION_ATLEAST(main, 276, 7)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 276, 7)) {
Scene *scene;
- for (scene = main->scene.first; scene != NULL; scene = scene->id.next) {
+ for (scene = bmain->scene.first; scene != NULL; scene = scene->id.next) {
scene->r.bake.pass_filter = R_BAKE_PASS_FILTER_ALL;
}
}
- if (!MAIN_VERSION_ATLEAST(main, 277, 1)) {
- for (Scene *scene = main->scene.first; scene; scene = scene->id.next) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 277, 1)) {
+ for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
ParticleEditSettings *pset = &scene->toolsettings->particle;
for (int a = 0; a < ARRAY_SIZE(pset->brush); a++) {
if (pset->brush[a].strength > 1.0f) {
@@ -1250,7 +1250,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- for (bScreen *screen = main->screen.first; screen; screen = screen->id.next) {
+ for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) {
for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
ListBase *regionbase = (sl == sa->spacedata.first) ? &sa->regionbase : &sl->regionbase;
@@ -1283,7 +1283,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- for (Scene *scene = main->scene.first; scene; scene = scene->id.next) {
+ for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
CurvePaintSettings *cps = &scene->toolsettings->curve_paint_settings;
if (cps->error_threshold == 0) {
cps->curve_type = CU_BEZIER;
@@ -1294,7 +1294,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- for (Scene *scene = main->scene.first; scene; scene = scene->id.next) {
+ for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
Sequence *seq;
SEQ_BEGIN (scene->ed, seq)
@@ -1318,7 +1318,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
}
/* Adding "Properties" region to DopeSheet */
- for (bScreen *screen = main->screen.first; screen; screen = screen->id.next) {
+ for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) {
for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
/* handle pushed-back space data first */
for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
@@ -1336,14 +1336,14 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (!MAIN_VERSION_ATLEAST(main, 277, 2)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 277, 2)) {
if (!DNA_struct_elem_find(fd->filesdna, "Bone", "float", "scaleIn")) {
- for (bArmature *arm = main->armature.first; arm; arm = arm->id.next) {
+ for (bArmature *arm = bmain->armature.first; arm; arm = arm->id.next) {
do_version_bones_super_bbone(&arm->bonebase);
}
}
if (!DNA_struct_elem_find(fd->filesdna, "bPoseChannel", "float", "scaleIn")) {
- for (Object *ob = main->object.first; ob; ob = ob->id.next) {
+ for (Object *ob = bmain->object.first; ob; ob = ob->id.next) {
if (ob->pose) {
for (bPoseChannel *pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
/* see do_version_bones_super_bbone()... */
@@ -1363,7 +1363,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- for (Camera *camera = main->camera.first; camera != NULL; camera = camera->id.next) {
+ for (Camera *camera = bmain->camera.first; camera != NULL; camera = camera->id.next) {
if (camera->stereo.pole_merge_angle_from == 0.0f &&
camera->stereo.pole_merge_angle_to == 0.0f)
{
@@ -1375,7 +1375,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
if (!DNA_struct_elem_find(fd->filesdna, "NormalEditModifierData", "float", "mix_limit")) {
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) {
if (md->type == eModifierType_NormalEdit) {
@@ -1388,7 +1388,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
if (!DNA_struct_elem_find(fd->filesdna, "BooleanModifierData", "float", "double_threshold")) {
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) {
if (md->type == eModifierType_Boolean) {
@@ -1399,7 +1399,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- for (Brush *br = main->brush.first; br; br = br->id.next) {
+ for (Brush *br = bmain->brush.first; br; br = br->id.next) {
if (br->sculpt_tool == SCULPT_TOOL_FLATTEN) {
br->flag |= BRUSH_ACCUMULATE;
}
@@ -1408,7 +1408,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
if (!DNA_struct_elem_find(fd->filesdna, "ClothSimSettings", "float", "time_scale")) {
Object *ob;
ModifierData *md;
- for (ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
for (md = ob->modifiers.first; md; md = md->next) {
if (md->type == eModifierType_Cloth) {
ClothModifierData *clmd = (ClothModifierData *)md;
@@ -1425,10 +1425,10 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (!MAIN_VERSION_ATLEAST(main, 277, 3)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 277, 3)) {
/* ------- init of grease pencil initialization --------------- */
if (!DNA_struct_elem_find(fd->filesdna, "bGPDstroke", "bGPDpalettecolor", "*palcolor")) {
- for (Scene *scene = main->scene.first; scene; scene = scene->id.next) {
+ for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
ToolSettings *ts = scene->toolsettings;
/* initialize use position for sculpt brushes */
ts->gp_sculpt.flag |= GP_BRUSHEDIT_FLAG_APPLY_POSITION;
@@ -1447,8 +1447,8 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
/* create a default grease pencil drawing brushes set */
- if (!BLI_listbase_is_empty(&main->gpencil)) {
- for (Scene *scene = main->scene.first; scene; scene = scene->id.next) {
+ if (!BLI_listbase_is_empty(&bmain->gpencil)) {
+ for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
ToolSettings *ts = scene->toolsettings;
if (BLI_listbase_is_empty(&ts->gp_brushes)) {
BKE_gpencil_brush_init_presets(ts);
@@ -1458,7 +1458,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
/* Convert Grease Pencil to new palettes/brushes
* Loop all strokes and create the palette and all colors
*/
- for (bGPdata *gpd = main->gpencil.first; gpd; gpd = gpd->id.next) {
+ for (bGPdata *gpd = bmain->gpencil.first; gpd; gpd = gpd->id.next) {
if (BLI_listbase_is_empty(&gpd->palettes)) {
/* create palette */
bGPDpalette *palette = BKE_gpencil_palette_addnew(gpd, "GP_Palette", true);
@@ -1511,10 +1511,10 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
/* ------- end of grease pencil initialization --------------- */
}
- if (!MAIN_VERSION_ATLEAST(main, 278, 0)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 278, 0)) {
if (!DNA_struct_elem_find(fd->filesdna, "MovieTrackingTrack", "float", "weight_stab")) {
MovieClip *clip;
- for (clip = main->movieclip.first; clip; clip = clip->id.next) {
+ for (clip = bmain->movieclip.first; clip; clip = clip->id.next) {
MovieTracking *tracking = &clip->tracking;
MovieTrackingObject *tracking_object;
for (tracking_object = tracking->objects.first;
@@ -1535,7 +1535,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
if (!DNA_struct_elem_find(fd->filesdna, "MovieTrackingStabilization", "int", "tot_rot_track")) {
MovieClip *clip;
- for (clip = main->movieclip.first; clip != NULL; clip = clip->id.next) {
+ for (clip = bmain->movieclip.first; clip != NULL; clip = clip->id.next) {
if (clip->tracking.stabilization.rot_track) {
migrate_single_rot_stabilization_track_settings(&clip->tracking.stabilization);
}
@@ -1555,15 +1555,15 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
}
- if (!MAIN_VERSION_ATLEAST(main, 278, 2)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 278, 2)) {
if (!DNA_struct_elem_find(fd->filesdna, "FFMpegCodecData", "int", "ffmpeg_preset")) {
- for (Scene *scene = main->scene.first; scene; scene = scene->id.next) {
+ for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
/* "medium" is the preset FFmpeg uses when no presets are given. */
scene->r.ffcodecdata.ffmpeg_preset = FFM_PRESET_MEDIUM;
}
}
if (!DNA_struct_elem_find(fd->filesdna, "FFMpegCodecData", "int", "constant_rate_factor")) {
- for (Scene *scene = main->scene.first; scene; scene = scene->id.next) {
+ for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
/* fall back to behaviour from before we introduced CRF for old files */
scene->r.ffcodecdata.constant_rate_factor = FFM_CRF_NONE;
}
@@ -1573,7 +1573,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
Object *ob;
ModifierData *md;
- for (ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
for (md = ob->modifiers.first; md; md = md->next) {
if (md->type == eModifierType_Smoke) {
SmokeModifierData *smd = (SmokeModifierData *)md;
@@ -1588,8 +1588,8 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (!MAIN_VERSION_ATLEAST(main, 278, 3)) {
- for (Scene *scene = main->scene.first; scene != NULL; scene = scene->id.next) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 278, 3)) {
+ for (Scene *scene = bmain->scene.first; scene != NULL; scene = scene->id.next) {
if (scene->toolsettings != NULL) {
ToolSettings *ts = scene->toolsettings;
ParticleEditSettings *pset = &ts->particle;
@@ -1603,7 +1603,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
if (!DNA_struct_elem_find(fd->filesdna, "RigidBodyCon", "float", "spring_stiffness_ang_x")) {
Object *ob;
- for (ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
RigidBodyCon *rbc = ob->rigidbody_constraint;
if (rbc) {
rbc->spring_stiffness_ang_x = 10.0;
@@ -1618,7 +1618,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
/* constant detail for sculpting is now a resolution value instead of
* a percentage, we reuse old DNA struct member but convert it */
- for (Scene *scene = main->scene.first; scene != NULL; scene = scene->id.next) {
+ for (Scene *scene = bmain->scene.first; scene != NULL; scene = scene->id.next) {
if (scene->toolsettings != NULL) {
ToolSettings *ts = scene->toolsettings;
if (ts->sculpt && ts->sculpt->constant_detail != 0.0f) {
@@ -1628,16 +1628,16 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (!MAIN_VERSION_ATLEAST(main, 278, 4)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 278, 4)) {
const float sqrt_3 = (float)M_SQRT3;
- for (Brush *br = main->brush.first; br; br = br->id.next) {
+ for (Brush *br = bmain->brush.first; br; br = br->id.next) {
br->fill_threshold /= sqrt_3;
}
/* Custom motion paths */
if (!DNA_struct_elem_find(fd->filesdna, "bMotionPath", "int", "line_thickness")) {
Object *ob;
- for (ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
bMotionPath *mpath;
bPoseChannel *pchan;
mpath = ob->mpath;
@@ -1665,9 +1665,9 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- if (!MAIN_VERSION_ATLEAST(main, 278, 5)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 278, 5)) {
/* Mask primitive adding code was not initializing correctly id_type of its points' parent. */
- for (Mask *mask = main->mask.first; mask; mask = mask->id.next) {
+ for (Mask *mask = bmain->mask.first; mask; mask = mask->id.next) {
for (MaskLayer *mlayer = mask->masklayers.first; mlayer; mlayer = mlayer->next) {
for (MaskSpline *mspline = mlayer->splines.first; mspline; mspline = mspline->next) {
int i = 0;
@@ -1682,7 +1682,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
/* Fix for T50736, Glare comp node using same var for two different things. */
if (!DNA_struct_elem_find(fd->filesdna, "NodeGlare", "char", "star_45")) {
- FOREACH_NODETREE(main, ntree, id) {
+ FOREACH_NODETREE(bmain, ntree, id) {
if (ntree->type == NTREE_COMPOSIT) {
ntreeSetTypes(NULL, ntree);
for (bNode *node = ntree->nodes.first; node; node = node->next) {
@@ -1705,7 +1705,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
}
if (!DNA_struct_elem_find(fd->filesdna, "SurfaceDeformModifierData", "float", "mat[4][4]")) {
- for (Object *ob = main->object.first; ob; ob = ob->id.next) {
+ for (Object *ob = bmain->object.first; ob; ob = ob->id.next) {
for (ModifierData *md = ob->modifiers.first; md; md = md->next) {
if (md->type == eModifierType_SurfaceDeform) {
SurfaceDeformModifierData *smd = (SurfaceDeformModifierData *)md;
@@ -1715,32 +1715,32 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- FOREACH_NODETREE(main, ntree, id) {
+ FOREACH_NODETREE(bmain, ntree, id) {
if (ntree->type == NTREE_COMPOSIT) {
do_versions_compositor_render_passes(ntree);
}
} FOREACH_NODETREE_END
}
- if (!MAIN_VERSION_ATLEAST(main, 279, 0)) {
- for (Scene *scene = main->scene.first; scene; scene = scene->id.next) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 279, 0)) {
+ for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
if (scene->r.im_format.exr_codec == R_IMF_EXR_CODEC_DWAB) {
scene->r.im_format.exr_codec = R_IMF_EXR_CODEC_DWAA;
}
}
/* Fix related to VGroup modifiers creating named defgroup CD layers! See T51520. */
- for (Mesh *me = main->mesh.first; me; me = me->id.next) {
+ for (Mesh *me = bmain->mesh.first; me; me = me->id.next) {
CustomData_set_layer_name(&me->vdata, CD_MDEFORMVERT, 0, "");
}
}
- if (!MAIN_VERSION_ATLEAST(main, 279, 3)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 279, 3)) {
if (!DNA_struct_elem_find(fd->filesdna, "SmokeDomainSettings", "float", "clipping")) {
Object *ob;
ModifierData *md;
- for (ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
for (md = ob->modifiers.first; md; md = md->next) {
if (md->type == eModifierType_Smoke) {
SmokeModifierData *smd = (SmokeModifierData *)md;
@@ -1755,7 +1755,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
{
/* Fix for invalid state of screen due to bug in older versions. */
- for (bScreen *sc = main->screen.first; sc; sc = sc->id.next) {
+ for (bScreen *sc = bmain->screen.first; sc; sc = sc->id.next) {
for (ScrArea *sa = sc->areabase.first; sa; sa = sa->next) {
if (sa->full && sc->state == SCREENNORMAL) {
sa->full = NULL;
@@ -1764,7 +1764,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
}
if (!DNA_struct_elem_find(fd->filesdna, "Brush", "float", "falloff_angle")) {
- for (Brush *br = main->brush.first; br; br = br->id.next) {
+ for (Brush *br = bmain->brush.first; br; br = br->id.next) {
br->falloff_angle = DEG2RADF(80);
br->flag &= ~(
BRUSH_FLAG_DEPRECATED_1 | BRUSH_FLAG_DEPRECATED_2 |
@@ -1772,7 +1772,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
BRUSH_FRONTFACE_FALLOFF);
}
- for (Scene *scene = main->scene.first; scene; scene = scene->id.next) {
+ for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
ToolSettings *ts = scene->toolsettings;
for (int i = 0; i < 2; i++) {
VPaint *vp = i ? ts->vpaint : ts->wpaint;
@@ -1787,7 +1787,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
/* Simple deform modifier no longer assumes Z axis (X for bend type).
* Must set previous defaults. */
if (!DNA_struct_elem_find(fd->filesdna, "SimpleDeformModifierData", "char", "deform_axis")) {
- for (Object *ob = main->object.first; ob; ob = ob->id.next) {
+ for (Object *ob = bmain->object.first; ob; ob = ob->id.next) {
for (ModifierData *md = ob->modifiers.first; md; md = md->next) {
if (md->type == eModifierType_SimpleDeform) {
SimpleDeformModifierData *smd = (SimpleDeformModifierData *)md;
@@ -1797,7 +1797,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
- for (Scene *scene = main->scene.first; scene; scene = scene->id.next) {
+ for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
int preset = scene->r.ffcodecdata.ffmpeg_preset;
if (preset == FFM_PRESET_NONE || preset >= FFM_PRESET_GOOD) {
continue;
@@ -1815,7 +1815,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
}
if (!DNA_struct_elem_find(fd->filesdna, "ParticleInstanceModifierData", "float", "particle_amount")) {
- for (Object *ob = main->object.first; ob; ob = ob->id.next) {
+ for (Object *ob = bmain->object.first; ob; ob = ob->id.next) {
for (ModifierData *md = ob->modifiers.first; md; md = md->next) {
if (md->type == eModifierType_ParticleInstance) {
ParticleInstanceModifierData *pimd = (ParticleInstanceModifierData *)md;
@@ -1828,11 +1828,11 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
-void do_versions_after_linking_270(Main *main)
+void do_versions_after_linking_270(Main *bmain)
{
/* To be added to next subversion bump! */
- if (!MAIN_VERSION_ATLEAST(main, 279, 0)) {
- FOREACH_NODETREE(main, ntree, id) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 279, 0)) {
+ FOREACH_NODETREE(bmain, ntree, id) {
if (ntree->type == NTREE_COMPOSIT) {
ntreeSetTypes(NULL, ntree);
for (bNode *node = ntree->nodes.first; node; node = node->next) {
@@ -1844,9 +1844,9 @@ void do_versions_after_linking_270(Main *main)
} FOREACH_NODETREE_END
}
- if (!MAIN_VERSION_ATLEAST(main, 279, 2)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 279, 2)) {
/* B-Bones (bbone_in/out -> bbone_easein/out) + Stepped FMod Frame Start/End fix */
/* if (!DNA_struct_elem_find(fd->filesdna, "Bone", "float", "bbone_easein")) */
- BKE_fcurves_main_cb(main, do_version_bbone_easing_fcurve_fix, NULL);
+ BKE_fcurves_main_cb(bmain, do_version_bbone_easing_fcurve_fix, NULL);
}
}
diff --git a/source/blender/blenloader/intern/versioning_legacy.c b/source/blender/blenloader/intern/versioning_legacy.c
index e2bfcad3f7f..c4868af76cf 100644
--- a/source/blender/blenloader/intern/versioning_legacy.c
+++ b/source/blender/blenloader/intern/versioning_legacy.c
@@ -581,13 +581,13 @@ void blo_do_version_old_trackto_to_constraints(Object *ob)
ob->track = NULL;
}
-void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
+void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
{
/* WATCH IT!!!: pointers from libdata have not been converted */
- if (main->versionfile == 100) {
+ if (bmain->versionfile == 100) {
/* tex->extend and tex->imageflag have changed: */
- Tex *tex = main->tex.first;
+ Tex *tex = bmain->tex.first;
while (tex) {
if (tex->id.tag & LIB_TAG_NEED_LINK) {
@@ -606,9 +606,9 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile <= 101) {
+ if (bmain->versionfile <= 101) {
/* frame mapping */
- Scene *sce = main->scene.first;
+ Scene *sce = bmain->scene.first;
while (sce) {
sce->r.framapto = 100;
sce->r.images = 100;
@@ -617,18 +617,18 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile <= 102) {
+ if (bmain->versionfile <= 102) {
/* init halo's at 1.0 */
- Material *ma = main->mat.first;
+ Material *ma = bmain->mat.first;
while (ma) {
ma->add = 1.0;
ma = ma->id.next;
}
}
- if (main->versionfile <= 103) {
+ if (bmain->versionfile <= 103) {
/* new variable in object: colbits */
- Object *ob = main->object.first;
+ Object *ob = bmain->object.first;
int a;
while (ob) {
ob->colbits = 0;
@@ -642,9 +642,9 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile <= 104) {
+ if (bmain->versionfile <= 104) {
/* timeoffs moved */
- Object *ob = main->object.first;
+ Object *ob = bmain->object.first;
while (ob) {
if (ob->transflag & 1) {
ob->transflag -= 1;
@@ -653,8 +653,8 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile <= 105) {
- Object *ob = main->object.first;
+ if (bmain->versionfile <= 105) {
+ Object *ob = bmain->object.first;
while (ob) {
ob->dupon = 1;
ob->dupoff = 0;
@@ -664,9 +664,9 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile <= 106) {
+ if (bmain->versionfile <= 106) {
/* mcol changed */
- Mesh *me = main->mesh.first;
+ Mesh *me = bmain->mesh.first;
while (me) {
if (me->mcol)
vcol_to_fcol(me);
@@ -675,14 +675,14 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
- if (main->versionfile <= 107) {
+ if (bmain->versionfile <= 107) {
Object *ob;
- Scene *sce = main->scene.first;
+ Scene *sce = bmain->scene.first;
while (sce) {
sce->r.mode |= R_GAMMA;
sce = sce->id.next;
}
- ob = main->object.first;
+ ob = bmain->object.first;
while (ob) {
if (ob->dt == 0)
ob->dt = OB_SOLID;
@@ -691,9 +691,9 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
- if (main->versionfile <= 109) {
+ if (bmain->versionfile <= 109) {
/* new variable: gridlines */
- bScreen *sc = main->screen.first;
+ bScreen *sc = bmain->screen.first;
while (sc) {
ScrArea *sa = sc->areabase.first;
while (sa) {
@@ -713,8 +713,8 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile <= 113) {
- Material *ma = main->mat.first;
+ if (bmain->versionfile <= 113) {
+ Material *ma = bmain->mat.first;
while (ma) {
if (ma->flaresize == 0.0f)
ma->flaresize = 1.0f;
@@ -724,8 +724,8 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile <= 134) {
- Tex *tex = main->tex.first;
+ if (bmain->versionfile <= 134) {
+ Tex *tex = bmain->tex.first;
while (tex) {
if ((tex->rfac == 0.0f) &&
(tex->gfac == 0.0f) &&
@@ -740,9 +740,9 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile <= 140) {
+ if (bmain->versionfile <= 140) {
/* r-g-b-fac in texture */
- Tex *tex = main->tex.first;
+ Tex *tex = bmain->tex.first;
while (tex) {
if ((tex->rfac == 0.0f) &&
(tex->gfac == 0.0f) &&
@@ -757,8 +757,8 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile <= 153) {
- Scene *sce = main->scene.first;
+ if (bmain->versionfile <= 153) {
+ Scene *sce = bmain->scene.first;
while (sce) {
if (sce->r.blurfac == 0.0f)
sce->r.blurfac = 1.0f;
@@ -766,8 +766,8 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile <= 163) {
- Scene *sce = main->scene.first;
+ if (bmain->versionfile <= 163) {
+ Scene *sce = bmain->scene.first;
while (sce) {
if (sce->r.frs_sec == 0)
sce->r.frs_sec = 25;
@@ -775,16 +775,16 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile <= 164) {
- Mesh *me = main->mesh.first;
+ if (bmain->versionfile <= 164) {
+ Mesh *me = bmain->mesh.first;
while (me) {
me->smoothresh = 30;
me = me->id.next;
}
}
- if (main->versionfile <= 165) {
- Mesh *me = main->mesh.first;
+ if (bmain->versionfile <= 165) {
+ Mesh *me = bmain->mesh.first;
TFace *tface;
int nr;
char *cp;
@@ -810,8 +810,8 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile <= 169) {
- Mesh *me = main->mesh.first;
+ if (bmain->versionfile <= 169) {
+ Mesh *me = bmain->mesh.first;
while (me) {
if (me->subdiv == 0)
me->subdiv = 1;
@@ -819,8 +819,8 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile <= 169) {
- bScreen *sc = main->screen.first;
+ if (bmain->versionfile <= 169) {
+ bScreen *sc = bmain->screen.first;
while (sc) {
ScrArea *sa = sc->areabase.first;
while (sa) {
@@ -838,8 +838,8 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile <= 170) {
- Object *ob = main->object.first;
+ if (bmain->versionfile <= 170) {
+ Object *ob = bmain->object.first;
PartEff *paf;
while (ob) {
paf = blo_do_version_give_parteff_245(ob);
@@ -852,8 +852,8 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile <= 171) {
- bScreen *sc = main->screen.first;
+ if (bmain->versionfile <= 171) {
+ bScreen *sc = bmain->screen.first;
while (sc) {
ScrArea *sa = sc->areabase.first;
while (sa) {
@@ -871,9 +871,9 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile <= 173) {
+ if (bmain->versionfile <= 173) {
int a, b;
- Mesh *me = main->mesh.first;
+ Mesh *me = bmain->mesh.first;
while (me) {
if (me->tface) {
TFace *tface = me->tface;
@@ -888,9 +888,9 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile <= 191) {
- Object *ob = main->object.first;
- Material *ma = main->mat.first;
+ if (bmain->versionfile <= 191) {
+ Object *ob = bmain->object.first;
+ Material *ma = bmain->mat.first;
/* let faces have default add factor of 0.0 */
while (ma) {
@@ -907,8 +907,8 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile <= 193) {
- Object *ob = main->object.first;
+ if (bmain->versionfile <= 193) {
+ Object *ob = bmain->object.first;
while (ob) {
ob->inertia = 1.0f;
ob->rdamping = 0.1f;
@@ -916,8 +916,8 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile <= 196) {
- Mesh *me = main->mesh.first;
+ if (bmain->versionfile <= 196) {
+ Mesh *me = bmain->mesh.first;
int a, b;
while (me) {
if (me->tface) {
@@ -933,8 +933,8 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile <= 200) {
- Object *ob = main->object.first;
+ if (bmain->versionfile <= 200) {
+ Object *ob = bmain->object.first;
while (ob) {
ob->scaflag = ob->gameflag & (OB_DO_FH|OB_ROT_FH|OB_ANISOTROPIC_FRICTION|OB_GHOST|OB_RIGID_BODY|OB_BOUNDS);
/* 64 is do_fh */
@@ -943,9 +943,9 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile <= 201) {
+ if (bmain->versionfile <= 201) {
/* add-object + end-object are joined to edit-object actuator */
- Object *ob = main->object.first;
+ Object *ob = bmain->object.first;
bProperty *prop;
bActuator *act;
bIpoActuator *ia;
@@ -983,10 +983,10 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile <= 202) {
+ if (bmain->versionfile <= 202) {
/* add-object and end-object are joined to edit-object
* actuator */
- Object *ob = main->object.first;
+ Object *ob = bmain->object.first;
bActuator *act;
bObjectActuator *oa;
while (ob) {
@@ -1002,9 +1002,9 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile <= 204) {
+ if (bmain->versionfile <= 204) {
/* patches for new physics */
- Object *ob = main->object.first;
+ Object *ob = bmain->object.first;
bActuator *act;
bObjectActuator *oa;
bSound *sound;
@@ -1031,7 +1031,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
ob = ob->id.next;
}
- sound = main->sound.first;
+ sound = bmain->sound.first;
while (sound) {
if (sound->volume < 0.01f) {
sound->volume = 1.0f;
@@ -1040,9 +1040,9 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile <= 205) {
+ if (bmain->versionfile <= 205) {
/* patches for new physics */
- Object *ob = main->object.first;
+ Object *ob = bmain->object.first;
bActuator *act;
bSensor *sens;
bEditObjectActuator *oa;
@@ -1108,7 +1108,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
/* have to check the exact multiplier */
}
- if (main->versionfile <= 211) {
+ if (bmain->versionfile <= 211) {
/* Render setting: per scene, the applicable gamma value
* can be set. Default is 1.0, which means no
* correction. */
@@ -1117,14 +1117,14 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
Object *ob;
/* added alpha in obcolor */
- ob = main->object.first;
+ ob = bmain->object.first;
while (ob) {
ob->col[3] = 1.0;
ob = ob->id.next;
}
/* added alpha in obcolor */
- ob = main->object.first;
+ ob = bmain->object.first;
while (ob) {
act = ob->actuators.first;
while (act) {
@@ -1150,13 +1150,13 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile <= 212) {
+ if (bmain->versionfile <= 212) {
bSound *sound;
bProperty *prop;
Object *ob;
Mesh *me;
- sound = main->sound.first;
+ sound = bmain->sound.first;
while (sound) {
sound->max_gain = 1.0;
sound->min_gain = 0.0;
@@ -1170,7 +1170,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
sound = sound->id.next;
}
- ob = main->object.first;
+ ob = bmain->object.first;
while (ob) {
prop = ob->prop.first;
@@ -1190,7 +1190,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
* it a subsurf, and reset the subdiv level because subsurf
* takes a lot more work to calculate.
*/
- for (me = main->mesh.first; me; me = me->id.next) {
+ for (me = bmain->mesh.first; me; me = me->id.next) {
if (me->flag & ME_SMESH) {
me->flag &= ~ME_SMESH;
me->flag |= ME_SUBSURF;
@@ -1206,11 +1206,11 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile <= 220) {
+ if (bmain->versionfile <= 220) {
Object *ob;
Mesh *me;
- ob = main->object.first;
+ ob = bmain->object.first;
/* adapt form factor in order to get the 'old' physics
* behavior back...
@@ -1234,7 +1234,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
* old file vertex colors are undefined, reset them
* to be fully opaque. -zr
*/
- for (me = main->mesh.first; me; me = me->id.next) {
+ for (me = bmain->mesh.first; me; me = me->id.next) {
if (me->mcol) {
int i;
@@ -1259,8 +1259,8 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile <= 221) {
- Scene *sce = main->scene.first;
+ if (bmain->versionfile <= 221) {
+ Scene *sce = bmain->scene.first;
/* new variables for std-alone player and runtime */
while (sce) {
@@ -1273,8 +1273,8 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
- if (main->versionfile <= 222) {
- Scene *sce = main->scene.first;
+ if (bmain->versionfile <= 222) {
+ Scene *sce = bmain->scene.first;
/* new variables for std-alone player and runtime */
while (sce) {
@@ -1284,24 +1284,24 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile <= 223) {
+ if (bmain->versionfile <= 223) {
VFont *vf;
Image *ima;
Object *ob;
- for (vf = main->vfont.first; vf; vf = vf->id.next) {
+ for (vf = bmain->vfont.first; vf; vf = vf->id.next) {
if (STREQ(vf->name + strlen(vf->name) - 6, ".Bfont")) {
strcpy(vf->name, FO_BUILTIN_NAME);
}
}
/* Old textures animate at 25 FPS */
- for (ima = main->image.first; ima; ima = ima->id.next) {
+ for (ima = bmain->image.first; ima; ima = ima->id.next) {
ima->animspeed = 25;
}
/* Zr remapped some keyboard codes to be linear (stupid zr) */
- for (ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
bSensor *sens;
for (sens = ob->sensors.first; sens; sens = sens->next) {
@@ -1316,13 +1316,13 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile <= 224) {
+ if (bmain->versionfile <= 224) {
bSound *sound;
Scene *sce;
Mesh *me;
bScreen *sc;
- for (sound = main->sound.first; sound; sound = sound->id.next) {
+ for (sound = bmain->sound.first; sound; sound = sound->id.next) {
if (sound->packedfile) {
if (sound->newpackedfile == NULL) {
sound->newpackedfile = sound->packedfile;
@@ -1331,17 +1331,17 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
/* Make sure that old subsurf meshes don't have zero subdivision level for rendering */
- for (me = main->mesh.first; me; me = me->id.next) {
+ for (me = bmain->mesh.first; me; me = me->id.next) {
if ((me->flag & ME_SUBSURF) && (me->subdivr == 0))
me->subdivr = me->subdiv;
}
- for (sce = main->scene.first; sce; sce = sce->id.next) {
+ for (sce = bmain->scene.first; sce; sce = sce->id.next) {
sce->r.stereomode = 1; // no stereo
}
/* some oldfile patch, moved from set_func_space */
- 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) {
@@ -1357,15 +1357,15 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile <= 225) {
+ if (bmain->versionfile <= 225) {
World *wo;
/* Use Sumo for old games */
- for (wo = main->world.first; wo; wo = wo->id.next) {
+ for (wo = bmain->world.first; wo; wo = wo->id.next) {
wo->physicsEngine = 2;
}
}
- if (main->versionfile <= 227) {
+ if (bmain->versionfile <= 227) {
Scene *sce;
Material *ma;
bScreen *sc;
@@ -1374,7 +1374,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
/* As of now, this insures that the transition from the old Track system
* to the new full constraint Track is painless for everyone. - theeth
*/
- ob = main->object.first;
+ ob = bmain->object.first;
while (ob) {
ListBase *list;
@@ -1417,14 +1417,14 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
ob = ob->id.next;
}
- for (sce = main->scene.first; sce; sce = sce->id.next) {
+ for (sce = bmain->scene.first; sce; sce = sce->id.next) {
sce->audio.mixrate = 48000;
sce->audio.flag |= AUDIO_SCRUB;
sce->r.mode |= R_ENVMAP;
}
/* init new shader vars */
- for (ma = main->mat.first; ma; ma = ma->id.next) {
+ for (ma = bmain->mat.first; ma; ma = ma->id.next) {
ma->refrac = 4.0f;
ma->roughness = 0.5f;
ma->param[0] = 0.5f;
@@ -1434,7 +1434,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
/* patch for old wrong max view2d settings, allows zooming out more */
- 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) {
@@ -1454,7 +1454,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile <= 228) {
+ if (bmain->versionfile <= 228) {
Scene *sce;
bScreen *sc;
Object *ob;
@@ -1462,7 +1462,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
/* As of now, this insures that the transition from the old Track system
* to the new full constraint Track is painless for everyone.
*/
- ob = main->object.first;
+ ob = bmain->object.first;
while (ob) {
ListBase *list;
@@ -1501,12 +1501,12 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
ob = ob->id.next;
}
- for (sce = main->scene.first; sce; sce = sce->id.next) {
+ for (sce = bmain->scene.first; sce; sce = sce->id.next) {
sce->r.mode |= R_ENVMAP;
}
/* convert old mainb values for new button panels */
- 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) {
@@ -1576,11 +1576,11 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
* check apart from the do_versions()
*/
- if (main->versionfile <= 230) {
+ if (bmain->versionfile <= 230) {
bScreen *sc;
/* new variable blockscale, for panels in any area */
- 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) {
@@ -1597,9 +1597,9 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile <= 231) {
+ if (bmain->versionfile <= 231) {
/* new bit flags for showing/hiding grid floor and axes */
- bScreen *sc = main->screen.first;
+ bScreen *sc = bmain->screen.first;
while (sc) {
ScrArea *sa = sc->areabase.first;
@@ -1624,9 +1624,9 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile <= 231) {
- Material *ma = main->mat.first;
- bScreen *sc = main->screen.first;
+ if (bmain->versionfile <= 231) {
+ Material *ma = bmain->mat.first;
+ bScreen *sc = bmain->screen.first;
Scene *sce;
Lamp *la;
World *wrld;
@@ -1646,13 +1646,13 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
ma = ma->id.next;
}
- sce = main->scene.first;
+ sce = bmain->scene.first;
while (sce) {
if (sce->r.gauss == 0.0f)
sce->r.gauss = 1.0f;
sce = sce->id.next;
}
- la = main->lamp.first;
+ la = bmain->lamp.first;
while (la) {
if (la->k == 0.0f) la->k = 1.0;
if (la->ray_samp == 0)
@@ -1669,7 +1669,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
la->area_sizez = 1.0f;
la = la->id.next;
}
- wrld = main->world.first;
+ wrld = bmain->world.first;
while (wrld) {
if (wrld->range == 0.0f) {
wrld->range = 1.0f / wrld->exposure;
@@ -1702,9 +1702,9 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile <= 232) {
- Tex *tex = main->tex.first;
- World *wrld = main->world.first;
+ if (bmain->versionfile <= 232) {
+ Tex *tex = bmain->tex.first;
+ World *wrld = bmain->world.first;
bScreen *sc;
Scene *sce;
@@ -1745,7 +1745,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
/* new variable blockscale, for panels in any area, do again because new
* areas didnt initialize it to 0.7 yet
*/
- 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;
@@ -1758,7 +1758,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
}
- sce = main->scene.first;
+ sce = bmain->scene.first;
while (sce) {
if (sce->r.ocres == 0)
sce->r.ocres = 64;
@@ -1767,10 +1767,10 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
- if (main->versionfile <= 233) {
+ if (bmain->versionfile <= 233) {
bScreen *sc;
- Material *ma = main->mat.first;
- /* Object *ob = main->object.first; */
+ Material *ma = bmain->mat.first;
+ /* Object *ob = bmain->object.first; */
while (ma) {
if (ma->rampfac_col == 0.0f)
@@ -1782,7 +1782,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
ma = ma->id.next;
}
- 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;
@@ -1796,17 +1796,17 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile <= 234) {
+ if (bmain->versionfile <= 234) {
World *wo;
bScreen *sc;
/* force sumo engine to be active */
- for (wo = main->world.first; wo; wo = wo->id.next) {
+ for (wo = bmain->world.first; wo; wo = wo->id.next) {
if (wo->physicsEngine == 0)
wo->physicsEngine = 2;
}
- 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;
@@ -1825,9 +1825,9 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile <= 235) {
- Tex *tex = main->tex.first;
- Scene *sce = main->scene.first;
+ if (bmain->versionfile <= 235) {
+ Tex *tex = bmain->tex.first;
+ Scene *sce = bmain->scene.first;
Sequence *seq;
Editing *ed;
@@ -1851,9 +1851,9 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile <= 236) {
+ if (bmain->versionfile <= 236) {
Object *ob;
- Camera *cam = main->camera.first;
+ Camera *cam = bmain->camera.first;
Material *ma;
bScreen *sc;
@@ -1868,7 +1868,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
/* set manipulator type */
/* force oops draw if depgraph was set*/
/* set time line var */
- 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;
@@ -1882,7 +1882,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
/* init new shader vars */
- for (ma = main->mat.first; ma; ma = ma->id.next) {
+ for (ma = bmain->mat.first; ma; ma = ma->id.next) {
if (ma->darkness == 0.0f) {
ma->rms = 0.1f;
ma->darkness = 1.0f;
@@ -1890,7 +1890,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
/* softbody init new vars */
- for (ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
if (ob->soft) {
if (ob->soft->defgoal == 0.0f)
ob->soft->defgoal = 0.7f;
@@ -1913,20 +1913,20 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile <= 237) {
+ if (bmain->versionfile <= 237) {
bArmature *arm;
bConstraint *con;
Object *ob;
Bone *bone;
/* armature recode checks */
- for (arm = main->armature.first; arm; arm = arm->id.next) {
+ for (arm = bmain->armature.first; arm; arm = arm->id.next) {
BKE_armature_where_is(arm);
for (bone = arm->bonebase.first; bone; bone = bone->next)
do_version_bone_head_tail_237(bone);
}
- 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 = blo_do_versions_newlibadr(fd, lib, ob->parent);
if (parent && parent->type == OB_LATTICE)
@@ -1936,7 +1936,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
/* btw. armature_rebuild_pose is further only called on leave editmode */
if (ob->type == OB_ARMATURE) {
if (ob->pose)
- BKE_pose_tag_recalc(main, ob->pose);
+ BKE_pose_tag_recalc(bmain, ob->pose);
/* cannot call stuff now (pointers!), done in setup_app_data */
ob->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME;
@@ -1987,13 +1987,13 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile <= 238) {
+ if (bmain->versionfile <= 238) {
Lattice *lt;
Object *ob;
bArmature *arm;
Mesh *me;
Key *key;
- Scene *sce = main->scene.first;
+ Scene *sce = bmain->scene.first;
while (sce) {
if (sce->toolsettings == NULL) {
@@ -2003,7 +2003,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
sce = sce->id.next;
}
- for (lt = main->latt.first; lt; lt = lt->id.next) {
+ for (lt = bmain->latt.first; lt; lt = lt->id.next) {
if (lt->fu == 0.0f && lt->fv == 0.0f && lt->fw == 0.0f) {
calc_lat_fudu(lt->flag, lt->pntsu, &lt->fu, &lt->du);
calc_lat_fudu(lt->flag, lt->pntsv, &lt->fv, &lt->dv);
@@ -2011,7 +2011,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- for (ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
ModifierData *md;
PartEff *paf;
@@ -2060,7 +2060,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
data->rootbone = -1;
/* update_pose_etc handles rootbone == -1 */
- BKE_pose_tag_recalc(main, ob->pose);
+ BKE_pose_tag_recalc(bmain, ob->pose);
}
}
}
@@ -2078,12 +2078,12 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- for (arm = main->armature.first; arm; arm = arm->id.next) {
+ for (arm = bmain->armature.first; arm; arm = arm->id.next) {
bone_version_238(&arm->bonebase);
arm->deformflag |= ARM_DEF_VGROUP;
}
- for (me = main->mesh.first; me; me = me->id.next) {
+ for (me = bmain->mesh.first; me; me = me->id.next) {
if (!me->medge) {
BKE_mesh_calc_edges_legacy(me, true); /* true = use mface->edcode */
}
@@ -2092,7 +2092,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- for (key = main->key.first; key; key = key->id.next) {
+ for (key = bmain->key.first; key; key = key->id.next) {
KeyBlock *kb;
int index = 1;
@@ -2111,16 +2111,16 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile <= 239) {
+ if (bmain->versionfile <= 239) {
bArmature *arm;
Object *ob;
- Scene *sce = main->scene.first;
- Camera *cam = main->camera.first;
- Material *ma = main->mat.first;
+ Scene *sce = bmain->scene.first;
+ Camera *cam = bmain->camera.first;
+ Material *ma = bmain->mat.first;
int set_passepartout = 0;
/* deformflag is local in modifier now */
- 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) {
@@ -2136,7 +2136,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
/* updating stepsize for ghost drawing */
- for (arm = main->armature.first; arm; arm = arm->id.next) {
+ for (arm = bmain->armature.first; arm; arm = arm->id.next) {
if (arm->ghostsize == 0)
arm->ghostsize = 1;
bone_version_239(&arm->bonebase);
@@ -2179,7 +2179,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile <= 241) {
+ if (bmain->versionfile <= 241) {
Object *ob;
Tex *tex;
Scene *sce;
@@ -2189,22 +2189,22 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
bArmature *arm;
bNodeTree *ntree;
- for (wo = main->world.first; wo; wo = wo->id.next) {
+ for (wo = bmain->world.first; wo; wo = wo->id.next) {
/* Migrate to Bullet for games, except for the NaN versions */
/* People can still explicitly choose for Sumo (after 2.42 is out) */
- if (main->versionfile > 225)
+ if (bmain->versionfile > 225)
wo->physicsEngine = WOPHY_BULLET;
if (WO_AODIST == wo->aomode)
wo->aocolor = WO_AOPLAIN;
}
/* updating layers still */
- for (arm = main->armature.first; arm; arm = arm->id.next) {
+ for (arm = bmain->armature.first; arm; arm = arm->id.next) {
bone_version_239(&arm->bonebase);
if (arm->layer == 0)
arm->layer = 1;
}
- for (sce = main->scene.first; sce; sce = sce->id.next) {
+ for (sce = bmain->scene.first; sce; sce = sce->id.next) {
if (sce->audio.mixrate == 0)
sce->audio.mixrate = 48000;
@@ -2252,28 +2252,28 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- for (ntree = main->nodetree.first; ntree; ntree = ntree->id.next)
+ for (ntree = bmain->nodetree.first; ntree; ntree = ntree->id.next)
ntree_version_241(ntree);
- for (la = main->lamp.first; la; la = la->id.next)
+ for (la = bmain->lamp.first; la; la = la->id.next)
if (la->buffers == 0)
la->buffers = 1;
- for (tex = main->tex.first; tex; tex = tex->id.next) {
+ for (tex = bmain->tex.first; tex; tex = tex->id.next) {
if (tex->env && tex->env->viewscale == 0.0f)
tex->env->viewscale = 1.0f;
//tex->imaflag |= TEX_GAUSS_MIP;
}
/* for empty drawsize and drawtype */
- for (ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
if (ob->empty_drawsize == 0.0f) {
ob->empty_drawtype = OB_ARROWS;
ob->empty_drawsize = 1.0;
}
}
- for (ma = main->mat.first; ma; ma = ma->id.next) {
+ for (ma = bmain->mat.first; ma; ma = ma->id.next) {
/* stucci returns intensity from now on */
int a;
for (a = 0; a < MAX_MTEX; a++) {
@@ -2289,9 +2289,9 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
/* during 2.41 images with this name were used for viewer node output, lets fix that */
- if (main->versionfile == 241) {
+ if (bmain->versionfile == 241) {
Image *ima;
- for (ima = main->image.first; ima; ima = ima->id.next) {
+ for (ima = bmain->image.first; ima; ima = ima->id.next) {
if (STREQ(ima->name, "Compositor")) {
strcpy(ima->id.name + 2, "Viewer Node");
strcpy(ima->name, "Viewer Node");
@@ -2300,7 +2300,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile <= 242) {
+ if (bmain->versionfile <= 242) {
Scene *sce;
bScreen *sc;
Object *ob;
@@ -2314,7 +2314,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
bNodeTree *ntree;
int a;
- for (sc = main->screen.first; sc; sc = sc->id.next) {
+ for (sc = bmain->screen.first; sc; sc = sc->id.next) {
ScrArea *sa;
sa = sc->areabase.first;
while (sa) {
@@ -2331,7 +2331,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- for (sce = main->scene.first; sce; sce = sce->id.next) {
+ for (sce = bmain->scene.first; sce; sce = sce->id.next) {
if (sce->toolsettings->select_thresh == 0.0f)
sce->toolsettings->select_thresh = 0.01f;
@@ -2345,11 +2345,11 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
ntree_version_242(sce->nodetree);
}
- for (ntree = main->nodetree.first; ntree; ntree = ntree->id.next)
+ for (ntree = bmain->nodetree.first; ntree; ntree = ntree->id.next)
ntree_version_242(ntree);
/* add default radius values to old curve points */
- for (cu = main->curve.first; cu; cu = cu->id.next) {
+ for (cu = bmain->curve.first; cu; cu = cu->id.next) {
for (nu = cu->nurb.first; nu; nu = nu->next) {
if (nu) {
if (nu->bezt) {
@@ -2368,7 +2368,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- for (ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
ModifierData *md;
ListBase *list;
list = &ob->constraints;
@@ -2456,27 +2456,27 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
- for (ma = main->mat.first; ma; ma = ma->id.next) {
+ for (ma = bmain->mat.first; ma; ma = ma->id.next) {
if (ma->shad_alpha == 0.0f)
ma->shad_alpha = 1.0f;
if (ma->nodetree)
ntree_version_242(ma->nodetree);
}
- for (me = main->mesh.first; me; me = me->id.next)
+ for (me = bmain->mesh.first; me; me = me->id.next)
customdata_version_242(me);
- for (group = main->group.first; group; group = group->id.next)
+ for (group = bmain->group.first; group; group = group->id.next)
if (group->layer == 0)
group->layer = (1 << 20) - 1;
/* now, subversion control! */
- if (main->subversionfile < 3) {
+ if (bmain->subversionfile < 3) {
Image *ima;
Tex *tex;
/* Image refactor initialize */
- for (ima = main->image.first; ima; ima = ima->id.next) {
+ for (ima = bmain->image.first; ima; ima = ima->id.next) {
ima->source = IMA_SRC_FILE;
ima->type = IMA_TYPE_IMAGE;
@@ -2493,7 +2493,7 @@ void blo_do_versions_pre250(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 (tex->type == TEX_IMAGE && tex->ima) {
ima = blo_do_versions_newlibadr(fd, lib, tex->ima);
if (tex->imaflag & TEX_ANIM5_)
@@ -2509,17 +2509,17 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
tex->iuser.sfra = tex->sfra;
tex->iuser.cycl = (tex->imaflag & TEX_ANIMCYCLIC_)!=0;
}
- for (sce = main->scene.first; sce; sce = sce->id.next) {
+ for (sce = bmain->scene.first; sce; sce = sce->id.next) {
if (sce->nodetree)
do_version_ntree_242_2(sce->nodetree);
}
- for (ntree = main->nodetree.first; ntree; ntree = ntree->id.next)
+ for (ntree = bmain->nodetree.first; ntree; ntree = ntree->id.next)
do_version_ntree_242_2(ntree);
- for (ma = main->mat.first; ma; ma = ma->id.next)
+ for (ma = bmain->mat.first; ma; ma = ma->id.next)
if (ma->nodetree)
do_version_ntree_242_2(ma->nodetree);
- 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;
@@ -2537,8 +2537,8 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->subversionfile < 4) {
- for (sce = main->scene.first; sce; sce = sce->id.next) {
+ if (bmain->subversionfile < 4) {
+ for (sce = bmain->scene.first; sce; sce = sce->id.next) {
sce->r.bake_mode = 1; /* prevent to include render stuff here */
sce->r.bake_filter = 16;
sce->r.bake_osa = 5;
@@ -2547,11 +2547,11 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile <= 243) {
- Object *ob = main->object.first;
+ if (bmain->versionfile <= 243) {
+ Object *ob = bmain->object.first;
Material *ma;
- for (ma = main->mat.first; ma; ma = ma->id.next) {
+ for (ma = bmain->mat.first; ma; ma = ma->id.next) {
if (ma->sss_scale == 0.0f) {
ma->sss_radius[0] = 1.0f;
ma->sss_radius[1] = 1.0f;
@@ -2586,7 +2586,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile < 243 || main->subversionfile < 1) {
+ if (bmain->versionfile < 243 || bmain->subversionfile < 1) {
ModifierData *md;
/* translate old mirror modifier axis values to new flags */
@@ -2613,26 +2613,26 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
/* render layer added, this is not the active layer */
- if (main->versionfile <= 243 || main->subversionfile < 2) {
+ if (bmain->versionfile <= 243 || bmain->subversionfile < 2) {
Mesh *me;
- for (me = main->mesh.first; me; me = me->id.next)
+ for (me = bmain->mesh.first; me; me = me->id.next)
customdata_version_243(me);
}
}
- if (main->versionfile <= 244) {
+ if (bmain->versionfile <= 244) {
Scene *sce;
bScreen *sc;
Lamp *la;
World *wrld;
- if (main->versionfile != 244 || main->subversionfile < 2) {
- for (sce = main->scene.first; sce; sce = sce->id.next)
+ if (bmain->versionfile != 244 || bmain->subversionfile < 2) {
+ for (sce = bmain->scene.first; sce; sce = sce->id.next)
sce->r.mode |= R_SSS;
/* correct older action editors - incorrect scrolling */
- for (sc = main->screen.first; sc; sc = sc->id.next) {
+ for (sc = bmain->screen.first; sc; sc = sc->id.next) {
ScrArea *sa;
sa = sc->areabase.first;
while (sa) {
@@ -2654,10 +2654,10 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile != 244 || main->subversionfile < 3) {
+ if (bmain->versionfile != 244 || bmain->subversionfile < 3) {
/* constraints recode version patch used to be here. Moved to 245 now... */
- for (wrld = main->world.first; wrld; wrld = wrld->id.next) {
+ for (wrld = bmain->world.first; wrld; wrld = wrld->id.next) {
if (wrld->mode & WO_AMB_OCC)
wrld->ao_samp_method = WO_AOSAMP_CONSTANT;
else
@@ -2666,7 +2666,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
wrld->ao_adapt_thresh = 0.005f;
}
- for (la = main->lamp.first; la; la = la->id.next) {
+ for (la = bmain->lamp.first; la; la = la->id.next) {
if (la->type == LA_AREA)
la->ray_samp_method = LA_SAMP_CONSTANT;
else
@@ -2677,7 +2677,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile <= 245) {
+ if (bmain->versionfile <= 245) {
Scene *sce;
Object *ob;
Image *ima;
@@ -2692,10 +2692,10 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
ParticleSystem *psys;
/* unless the file was created 2.44.3 but not 2.45, update the constraints */
- if (!(main->versionfile == 244 && main->subversionfile == 3) &&
- ((main->versionfile < 245) || (main->versionfile == 245 && main->subversionfile == 0)) )
+ if (!(bmain->versionfile == 244 && bmain->subversionfile == 3) &&
+ ((bmain->versionfile < 245) || (bmain->versionfile == 245 && bmain->subversionfile == 0)) )
{
- for (ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
ListBase *list;
list = &ob->constraints;
@@ -2762,16 +2762,16 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
/* fix all versions before 2.45 */
- if (main->versionfile != 245) {
+ if (bmain->versionfile != 245) {
/* repair preview from 242 - 244*/
- for (ima = main->image.first; ima; ima = ima->id.next) {
+ for (ima = bmain->image.first; ima; ima = ima->id.next) {
ima->preview = NULL;
}
}
/* add point caches */
- for (ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
if (ob->soft && !ob->soft->pointcache)
ob->soft->pointcache = BKE_ptcache_add(&ob->soft->ptcaches);
@@ -2799,7 +2799,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
/* Copy over old per-level multires vertex data
* into a single vertex array in struct Multires */
- for (me = main->mesh.first; me; me = me->id.next) {
+ for (me = bmain->mesh.first; me; me = me->id.next) {
if (me->mr && !me->mr->verts) {
MultiresLevel *lvl = me->mr->levels.last;
if (lvl) {
@@ -2814,8 +2814,8 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile != 245 || main->subversionfile < 1) {
- for (la = main->lamp.first; la; la = la->id.next) {
+ if (bmain->versionfile != 245 || bmain->subversionfile < 1) {
+ for (la = bmain->lamp.first; la; la = la->id.next) {
if (la->mode & LA_QUAD)
la->falloff_type = LA_FALLOFF_SLIDERS;
else
@@ -2828,7 +2828,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- for (ma = main->mat.first; ma; ma = ma->id.next) {
+ for (ma = bmain->mat.first; ma; ma = ma->id.next) {
if (ma->samp_gloss_mir == 0) {
ma->gloss_mir = ma->gloss_tra = 1.0f;
ma->aniso_gloss_mir = 1.0f;
@@ -2842,7 +2842,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
ma->strand_min = 1.0f;
}
- for (part = main->particle.first; part; part = part->id.next) {
+ for (part = bmain->particle.first; part; part = part->id.next) {
if (part->ren_child_nbr == 0)
part->ren_child_nbr = part->child_nbr;
@@ -2854,12 +2854,12 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- for (wrld = main->world.first; wrld; wrld = wrld->id.next) {
+ for (wrld = bmain->world.first; wrld; wrld = wrld->id.next) {
if (wrld->ao_approx_error == 0.0f)
wrld->ao_approx_error = 0.25f;
}
- for (sce = main->scene.first; sce; sce = sce->id.next) {
+ for (sce = bmain->scene.first; sce; sce = sce->id.next) {
if (sce->nodetree)
ntree_version_245(fd, lib, sce->nodetree);
@@ -2877,18 +2877,18 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- for (ntree = main->nodetree.first; ntree; ntree = ntree->id.next)
+ for (ntree = bmain->nodetree.first; ntree; ntree = ntree->id.next)
ntree_version_245(fd, lib, ntree);
/* fix for temporary flag changes during 245 cycle */
- for (ima = main->image.first; ima; ima = ima->id.next) {
+ for (ima = bmain->image.first; ima; ima = ima->id.next) {
if (ima->flag & IMA_OLD_PREMUL) {
ima->flag &= ~IMA_OLD_PREMUL;
ima->alpha_mode = IMA_ALPHA_STRAIGHT;
}
}
- for (tex = main->tex.first; tex; tex = tex->id.next) {
+ for (tex = bmain->tex.first; tex; tex = tex->id.next) {
if (tex->iuser.flag & IMA_OLD_PREMUL) {
tex->iuser.flag &= ~IMA_OLD_PREMUL;
}
@@ -2904,7 +2904,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
/* sanity check for skgen */
{
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->skgen_subdivisions[0] == sce->toolsettings->skgen_subdivisions[1] ||
sce->toolsettings->skgen_subdivisions[0] == sce->toolsettings->skgen_subdivisions[2] ||
sce->toolsettings->skgen_subdivisions[1] == sce->toolsettings->skgen_subdivisions[2])
@@ -2917,24 +2917,24 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
- if ((main->versionfile < 245) || (main->versionfile == 245 && main->subversionfile < 2)) {
+ if ((bmain->versionfile < 245) || (bmain->versionfile == 245 && bmain->subversionfile < 2)) {
Image *ima;
/* initialize 1:1 Aspect */
- for (ima = main->image.first; ima; ima = ima->id.next) {
+ for (ima = bmain->image.first; ima; ima = ima->id.next) {
ima->aspx = ima->aspy = 1.0f;
}
}
- if ((main->versionfile < 245) || (main->versionfile == 245 && main->subversionfile < 4)) {
+ if ((bmain->versionfile < 245) || (bmain->versionfile == 245 && bmain->subversionfile < 4)) {
bArmature *arm;
ModifierData *md;
Object *ob;
- for (arm = main->armature.first; arm; arm = arm->id.next)
+ for (arm = bmain->armature.first; arm; arm = arm->id.next)
arm->deformflag |= ARM_DEF_B_BONE_REST;
- for (ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
for (md = ob->modifiers.first; md; md = md->next) {
if (md->type == eModifierType_Armature)
((ArmatureModifierData*) md)->deformflag |= ARM_DEF_B_BONE_REST;
@@ -2942,10 +2942,10 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if ((main->versionfile < 245) || (main->versionfile == 245 && main->subversionfile < 5)) {
+ if ((bmain->versionfile < 245) || (bmain->versionfile == 245 && bmain->subversionfile < 5)) {
/* foreground color needs to be something other then black */
Scene *sce;
- for (sce = main->scene.first; sce; sce = sce->id.next) {
+ for (sce = bmain->scene.first; sce; sce = sce->id.next) {
sce->r.fg_stamp[0] = sce->r.fg_stamp[1] = sce->r.fg_stamp[2] = 0.8f;
sce->r.fg_stamp[3] = 1.0f; /* don't use text alpha yet */
sce->r.bg_stamp[3] = 0.25f; /* make sure the background has full alpha */
@@ -2953,21 +2953,21 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
- if ((main->versionfile < 245) || (main->versionfile == 245 && main->subversionfile < 6)) {
+ if ((bmain->versionfile < 245) || (bmain->versionfile == 245 && bmain->subversionfile < 6)) {
Scene *sce;
/* fix frs_sec_base */
- for (sce = main->scene.first; sce; sce = sce->id.next) {
+ for (sce = bmain->scene.first; sce; sce = sce->id.next) {
if (sce->r.frs_sec_base == 0) {
sce->r.frs_sec_base = 1;
}
}
}
- if ((main->versionfile < 245) || (main->versionfile == 245 && main->subversionfile < 7)) {
+ if ((bmain->versionfile < 245) || (bmain->versionfile == 245 && bmain->subversionfile < 7)) {
Object *ob;
bPoseChannel *pchan;
- for (ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
if (ob->pose) {
for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
do_version_constraints_245(&pchan->constraints);
@@ -2992,12 +2992,12 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if ((main->versionfile < 245) || (main->versionfile == 245 && main->subversionfile < 8)) {
+ if ((bmain->versionfile < 245) || (bmain->versionfile == 245 && bmain->subversionfile < 8)) {
Scene *sce;
Object *ob;
PartEff *paf = NULL;
- for (ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
if (ob->soft && ob->soft->keys) {
SoftBody *sb = ob->soft;
int k;
@@ -3024,7 +3024,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
psys = MEM_callocN(sizeof(ParticleSystem), "particle_system");
psys->pointcache = BKE_ptcache_add(&psys->ptcaches);
- part = psys->part = BKE_particlesettings_add(main, "ParticleSettings");
+ part = psys->part = BKE_particlesettings_add(bmain, "ParticleSettings");
/* needed for proper libdata lookup */
blo_do_versions_oldnewmap_insert(fd->libmap, psys->part, psys->part, 0);
@@ -3104,7 +3104,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
/* dupliobjects */
if (ob->transflag & OB_DUPLIVERTS) {
- Object *dup = main->object.first;
+ Object *dup = bmain->object.first;
for (; dup; dup = dup->id.next) {
if (ob == blo_do_versions_newlibadr(fd, lib, dup->parent)) {
@@ -3132,7 +3132,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- 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;
@@ -3153,31 +3153,31 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
}
- if ((main->versionfile < 245) || (main->versionfile == 245 && main->subversionfile < 9)) {
+ if ((bmain->versionfile < 245) || (bmain->versionfile == 245 && bmain->subversionfile < 9)) {
Material *ma;
int a;
- for (ma = main->mat.first; ma; ma = ma->id.next)
+ for (ma = bmain->mat.first; ma; ma = ma->id.next)
if (ma->mode & MA_NORMAP_TANG)
for (a = 0; a < MAX_MTEX; a++)
if (ma->mtex[a] && ma->mtex[a]->tex)
ma->mtex[a]->normapspace = MTEX_NSPACE_TANGENT;
}
- if ((main->versionfile < 245) || (main->versionfile == 245 && main->subversionfile < 10)) {
+ if ((bmain->versionfile < 245) || (bmain->versionfile == 245 && bmain->subversionfile < 10)) {
Object *ob;
/* dupliface scale */
- for (ob = main->object.first; ob; ob = ob->id.next)
+ for (ob = bmain->object.first; ob; ob = ob->id.next)
ob->dupfacesca = 1.0f;
}
- if ((main->versionfile < 245) || (main->versionfile == 245 && main->subversionfile < 11)) {
+ if ((bmain->versionfile < 245) || (bmain->versionfile == 245 && bmain->subversionfile < 11)) {
Object *ob;
bActionStrip *strip;
/* nla-strips - scale */
- for (ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
for (strip = ob->nlastrips.first; strip; strip = strip->next) {
float length, actlength, repeat;
@@ -3202,11 +3202,11 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if ((main->versionfile < 245) || (main->versionfile == 245 && main->subversionfile < 14)) {
+ if ((bmain->versionfile < 245) || (bmain->versionfile == 245 && bmain->subversionfile < 14)) {
Scene *sce;
Sequence *seq;
- for (sce = main->scene.first; sce; sce = sce->id.next) {
+ for (sce = bmain->scene.first; sce; sce = sce->id.next) {
SEQ_BEGIN (sce->ed, seq)
{
if (seq->blend_mode == 0)
@@ -3217,41 +3217,41 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
/* fix broken group lengths in id properties */
- if ((main->versionfile < 245) || (main->versionfile == 245 && main->subversionfile < 15)) {
- idproperties_fix_group_lengths(main->scene);
- idproperties_fix_group_lengths(main->library);
- idproperties_fix_group_lengths(main->object);
- idproperties_fix_group_lengths(main->mesh);
- idproperties_fix_group_lengths(main->curve);
- idproperties_fix_group_lengths(main->mball);
- idproperties_fix_group_lengths(main->mat);
- idproperties_fix_group_lengths(main->tex);
- idproperties_fix_group_lengths(main->image);
- idproperties_fix_group_lengths(main->latt);
- idproperties_fix_group_lengths(main->lamp);
- idproperties_fix_group_lengths(main->camera);
- idproperties_fix_group_lengths(main->ipo);
- idproperties_fix_group_lengths(main->key);
- idproperties_fix_group_lengths(main->world);
- idproperties_fix_group_lengths(main->screen);
- idproperties_fix_group_lengths(main->vfont);
- idproperties_fix_group_lengths(main->text);
- idproperties_fix_group_lengths(main->sound);
- idproperties_fix_group_lengths(main->group);
- idproperties_fix_group_lengths(main->armature);
- idproperties_fix_group_lengths(main->action);
- idproperties_fix_group_lengths(main->nodetree);
- idproperties_fix_group_lengths(main->brush);
- idproperties_fix_group_lengths(main->particle);
+ if ((bmain->versionfile < 245) || (bmain->versionfile == 245 && bmain->subversionfile < 15)) {
+ idproperties_fix_group_lengths(bmain->scene);
+ idproperties_fix_group_lengths(bmain->library);
+ idproperties_fix_group_lengths(bmain->object);
+ idproperties_fix_group_lengths(bmain->mesh);
+ idproperties_fix_group_lengths(bmain->curve);
+ idproperties_fix_group_lengths(bmain->mball);
+ idproperties_fix_group_lengths(bmain->mat);
+ idproperties_fix_group_lengths(bmain->tex);
+ idproperties_fix_group_lengths(bmain->image);
+ idproperties_fix_group_lengths(bmain->latt);
+ idproperties_fix_group_lengths(bmain->lamp);
+ idproperties_fix_group_lengths(bmain->camera);
+ idproperties_fix_group_lengths(bmain->ipo);
+ idproperties_fix_group_lengths(bmain->key);
+ idproperties_fix_group_lengths(bmain->world);
+ idproperties_fix_group_lengths(bmain->screen);
+ idproperties_fix_group_lengths(bmain->vfont);
+ idproperties_fix_group_lengths(bmain->text);
+ idproperties_fix_group_lengths(bmain->sound);
+ idproperties_fix_group_lengths(bmain->group);
+ idproperties_fix_group_lengths(bmain->armature);
+ idproperties_fix_group_lengths(bmain->action);
+ idproperties_fix_group_lengths(bmain->nodetree);
+ idproperties_fix_group_lengths(bmain->brush);
+ idproperties_fix_group_lengths(bmain->particle);
}
/* sun/sky */
- if (main->versionfile < 246) {
+ if (bmain->versionfile < 246) {
Object *ob;
bActuator *act;
/* dRot actuator change direction in 2.46 */
- for (ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
for (act = ob->actuators.first; act; act = act->next) {
if (act->type == ACT_OBJECT) {
bObjectActuator *ba = act->data;
@@ -3265,10 +3265,10 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
/* convert fluids to modifier */
- if (main->versionfile < 246 || (main->versionfile == 246 && main->subversionfile < 1)) {
+ if (bmain->versionfile < 246 || (bmain->versionfile == 246 && 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) {
if (ob->fluidsimSettings) {
FluidsimModifierData *fluidmd = (FluidsimModifierData *)modifier_new(eModifierType_Fluidsim);
BLI_addhead(&ob->modifiers, (ModifierData *)fluidmd);
@@ -3286,32 +3286,32 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
- if (main->versionfile < 246 || (main->versionfile == 246 && main->subversionfile < 1)) {
+ if (bmain->versionfile < 246 || (bmain->versionfile == 246 && bmain->subversionfile < 1)) {
Mesh *me;
- for (me = main->mesh.first; me; me = me->id.next)
+ for (me = bmain->mesh.first; me; me = me->id.next)
alphasort_version_246(fd, lib, me);
}
- if (main->versionfile < 246 || (main->versionfile == 246 && main->subversionfile < 1)) {
+ if (bmain->versionfile < 246 || (bmain->versionfile == 246 && 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) {
if (ob->pd && (ob->pd->forcefield == PFIELD_WIND))
ob->pd->f_noise = 0.0f;
}
}
- if (main->versionfile < 247 || (main->versionfile == 247 && main->subversionfile < 2)) {
+ if (bmain->versionfile < 247 || (bmain->versionfile == 247 && 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) {
ob->gameflag |= OB_COLLISION;
ob->margin = 0.06f;
}
}
- if (main->versionfile < 247 || (main->versionfile == 247 && main->subversionfile < 3)) {
+ if (bmain->versionfile < 247 || (bmain->versionfile == 247 && bmain->subversionfile < 3)) {
Object *ob;
- for (ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
/* Starting from subversion 3, ACTOR is a separate feature.
* Before it was conditioning all the other dynamic flags */
if (!(ob->gameflag & OB_ACTOR))
@@ -3320,8 +3320,8 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile < 247 || (main->versionfile == 247 && main->subversionfile < 5)) {
- Lamp *la = main->lamp.first;
+ if (bmain->versionfile < 247 || (bmain->versionfile == 247 && bmain->subversionfile < 5)) {
+ Lamp *la = bmain->lamp.first;
for (; la; la = la->id.next) {
la->skyblendtype = MA_RAMP_ADD;
la->skyblendfac = 1.0f;
@@ -3329,11 +3329,11 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
/* set the curve radius interpolation to 2.47 default - easy */
- if (main->versionfile < 247 || (main->versionfile == 247 && main->subversionfile < 6)) {
+ if (bmain->versionfile < 247 || (bmain->versionfile == 247 && bmain->subversionfile < 6)) {
Curve *cu;
Nurb *nu;
- for (cu = main->curve.first; cu; cu = cu->id.next) {
+ for (cu = bmain->curve.first; cu; cu = cu->id.next) {
for (nu = cu->nurb.first; nu; nu = nu->next) {
if (nu) {
nu->radius_interp = 3;
@@ -3352,11 +3352,11 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
/* direction constraint actuators were always local in previous version */
- if (main->versionfile < 247 || (main->versionfile == 247 && main->subversionfile < 7)) {
+ if (bmain->versionfile < 247 || (bmain->versionfile == 247 && bmain->subversionfile < 7)) {
bActuator *act;
Object *ob;
- for (ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
for (act = ob->actuators.first; act; act = act->next) {
if (act->type == ACT_CONSTRAINT) {
bConstraintActuator *coa = act->data;
@@ -3368,19 +3368,19 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile < 247 || (main->versionfile == 247 && main->subversionfile < 9)) {
- Lamp *la = main->lamp.first;
+ if (bmain->versionfile < 247 || (bmain->versionfile == 247 && bmain->subversionfile < 9)) {
+ Lamp *la = bmain->lamp.first;
for (; la; la = la->id.next) {
la->sky_exposure = 1.0f;
}
}
/* BGE message actuators needed OB prefix, very confusing */
- if (main->versionfile < 247 || (main->versionfile == 247 && main->subversionfile < 10)) {
+ if (bmain->versionfile < 247 || (bmain->versionfile == 247 && bmain->subversionfile < 10)) {
bActuator *act;
Object *ob;
- for (ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
for (act = ob->actuators.first; act; act = act->next) {
if (act->type == ACT_MESSAGE) {
bMessageActuator *msgAct = (bMessageActuator *) act->data;
@@ -3397,10 +3397,10 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile < 248) {
+ if (bmain->versionfile < 248) {
Lamp *la;
- for (la = main->lamp.first; la; la = la->id.next) {
+ for (la = bmain->lamp.first; la; la = la->id.next) {
if (la->atm_turbidity == 0.0f) {
la->sun_effect_type = 0;
la->horizon_brightness = 1.0f;
@@ -3417,11 +3417,11 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile < 248 || (main->versionfile == 248 && main->subversionfile < 2)) {
+ if (bmain->versionfile < 248 || (bmain->versionfile == 248 && bmain->subversionfile < 2)) {
Scene *sce;
/* Note, these will need to be added for painting */
- for (sce = main->scene.first; sce; sce = sce->id.next) {
+ for (sce = bmain->scene.first; sce; sce = sce->id.next) {
sce->toolsettings->imapaint.seam_bleed = 2;
sce->toolsettings->imapaint.normal_angle = 80;
@@ -3452,11 +3452,11 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile < 248 || (main->versionfile == 248 && main->subversionfile < 3)) {
+ if (bmain->versionfile < 248 || (bmain->versionfile == 248 && bmain->subversionfile < 3)) {
bScreen *sc;
/* adjust default settings for Animation Editors */
- 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) {
@@ -3490,22 +3490,22 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
- if (main->versionfile < 248 || (main->versionfile == 248 && main->subversionfile < 3)) {
+ if (bmain->versionfile < 248 || (bmain->versionfile == 248 && bmain->subversionfile < 3)) {
Object *ob;
/* Adjustments needed after Bullets update */
- for (ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
ob->damping *= 0.635f;
ob->rdamping = 0.1f + (0.8f * ob->rdamping);
}
}
- if (main->versionfile < 248 || (main->versionfile == 248 && main->subversionfile < 4)) {
+ if (bmain->versionfile < 248 || (bmain->versionfile == 248 && bmain->subversionfile < 4)) {
Scene *sce;
World *wrld;
/* Dome (Fisheye) default parameters */
- for (sce = main->scene.first; sce; sce = sce->id.next) {
+ for (sce = bmain->scene.first; sce; sce = sce->id.next) {
sce->r.domeangle = 180;
sce->r.domemode = 1;
sce->r.domeres = 4;
@@ -3513,16 +3513,16 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
sce->r.dometilt = 0;
}
/* DBVT culling by default */
- for (wrld = main->world.first; wrld; wrld = wrld->id.next) {
+ for (wrld = bmain->world.first; wrld; wrld = wrld->id.next) {
wrld->mode |= WO_DBVT_CULLING;
wrld->occlusionRes = 128;
}
}
- if (main->versionfile < 248 || (main->versionfile == 248 && main->subversionfile < 5)) {
+ if (bmain->versionfile < 248 || (bmain->versionfile == 248 && bmain->subversionfile < 5)) {
Object *ob;
World *wrld;
- for (ob = main->object.first; ob; ob = ob->id.next) {
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
if (ob->parent) {
/* check if top parent has compound shape set and if yes, set this object
* to compound shaper as well (was the behavior before, now it's optional) */
@@ -3536,7 +3536,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
}
}
- for (wrld = main->world.first; wrld; wrld = wrld->id.next) {
+ for (wrld = bmain->world.first; wrld; wrld = wrld->id.next) {
wrld->ticrate = 60;
wrld->maxlogicstep = 5;
wrld->physubstep = 1;
@@ -3545,17 +3545,17 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
/* correct introduce of seed for wind force */
- if (main->versionfile < 249 && main->subversionfile < 1) {
+ if (bmain->versionfile < 249 && 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) {
if (ob->pd)
ob->pd->seed = ((unsigned int)(ceil(PIL_check_seconds_timer())) + 1) % 128;
}
}
- if (main->versionfile < 249 && main->subversionfile < 2) {
- Scene *sce = main->scene.first;
+ if (bmain->versionfile < 249 && bmain->subversionfile < 2) {
+ Scene *sce = bmain->scene.first;
Sequence *seq;
Editing *ed;
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 549800ae02b..288d42f6398 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -4142,7 +4142,7 @@ bool BLO_write_file(
* we should not have any relative paths, but if there
* is somehow, an invalid or empty G.main->name it will
* print an error, don't try make the absolute in this case. */
- BKE_bpath_absolute_convert(mainvar, G.main->name, NULL);
+ BKE_bpath_absolute_convert(mainvar, BKE_main_blendfile_path_from_global(), NULL);
}
}
}