diff options
Diffstat (limited to 'source/blender/blenloader/intern/versioning_270.c')
-rw-r--r-- | source/blender/blenloader/intern/versioning_270.c | 201 |
1 files changed, 188 insertions, 13 deletions
diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c index ee015fa5652..6ab655e9b45 100644 --- a/source/blender/blenloader/intern/versioning_270.c +++ b/source/blender/blenloader/intern/versioning_270.c @@ -39,6 +39,7 @@ #include "DNA_cloth_types.h" #include "DNA_constraint_types.h" #include "DNA_sdna_types.h" +#include "DNA_sequence_types.h" #include "DNA_space_types.h" #include "DNA_screen_types.h" #include "DNA_object_types.h" @@ -47,12 +48,15 @@ #include "DNA_particle_types.h" #include "DNA_linestyle_types.h" #include "DNA_actuator_types.h" +#include "DNA_view3d_types.h" #include "DNA_genfile.h" #include "BKE_main.h" #include "BKE_modifier.h" #include "BKE_node.h" +#include "BKE_scene.h" +#include "BKE_sequencer.h" #include "BKE_screen.h" #include "BLI_math.h" @@ -458,10 +462,10 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main) br->mtex.random_angle = 2.0 * M_PI; br->mask_mtex.random_angle = 2.0 * M_PI; } + } #undef BRUSH_RAKE #undef BRUSH_RANDOM_ROTATION - } /* Customizable Safe Areas */ if (!MAIN_VERSION_ATLEAST(main, 273, 2)) { @@ -616,18 +620,6 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main) } } } - - if (!DNA_struct_elem_find(fd->filesdna, "bSteeringActuator", "float", "acceleration")) { - for (ob = main->object.first; ob; ob = ob->id.next) { - bActuator *act; - for (act = ob->actuators.first; act; act = act->next) { - if (act->type == ACT_STEERING) { - bSteeringActuator *sact = act->data; - sact->acceleration = 1000.f; - } - } - } - } } if (!MAIN_VERSION_ATLEAST(main, 273, 9)) { @@ -666,5 +658,188 @@ 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) { + LodLevel *level; + for (level = ob->lodlevels.first; level; level = level->next) { + level->obhysteresis = 10; + } + } + } + + if (!DNA_struct_elem_find(fd->filesdna, "GameData", "int", "scehysteresis")) { + Scene *scene; + for (scene = main->scene.first; scene; scene = scene->id.next) { + scene->gm.scehysteresis = 10; + } + } + } + + if (!MAIN_VERSION_ATLEAST(main, 274, 2)) { + FOREACH_NODETREE(main, ntree, id) { + bNode *node; + bNodeSocket *sock; + + for (node = ntree->nodes.first; node; node = node->next) { + if (node->type == SH_NODE_MATERIAL) { + for (sock = node->inputs.first; sock; sock = sock->next) { + if (STREQ(sock->name, "Refl")) { + BLI_strncpy(sock->name, "DiffuseIntensity", sizeof(sock->name)); + } + } + } + else if (node->type == SH_NODE_MATERIAL_EXT) { + for (sock = node->outputs.first; sock; sock = sock->next) { + if (STREQ(sock->name, "Refl")) { + BLI_strncpy(sock->name, "DiffuseIntensity", sizeof(sock->name)); + } + else if (STREQ(sock->name, "Ray Mirror")) { + BLI_strncpy(sock->name, "Reflectivity", sizeof(sock->name)); + } + } + } + } + } FOREACH_NODETREE_END + } + + if (!MAIN_VERSION_ATLEAST(main, 274, 4)) { + SceneRenderView *srv; + wmWindowManager *wm; + bScreen *screen; + wmWindow *win; + Scene *scene; + Camera *cam; + Image *ima; + + for (scene = main->scene.first; scene; scene = scene->id.next) { + Sequence *seq; + + BKE_scene_add_render_view(scene, STEREO_LEFT_NAME); + srv = scene->r.views.first; + BLI_strncpy(srv->suffix, STEREO_LEFT_SUFFIX, sizeof(srv->suffix)); + + BKE_scene_add_render_view(scene, STEREO_RIGHT_NAME); + srv = scene->r.views.last; + BLI_strncpy(srv->suffix, STEREO_RIGHT_SUFFIX, sizeof(srv->suffix)); + + SEQ_BEGIN (scene->ed, seq) + { + seq->stereo3d_format = MEM_callocN(sizeof(Stereo3dFormat), "Stereo Display 3d Format"); + +#define SEQ_USE_PROXY_CUSTOM_DIR (1 << 19) +#define SEQ_USE_PROXY_CUSTOM_FILE (1 << 21) + if (seq->strip && seq->strip->proxy && !seq->strip->proxy->storage) { + if (seq->flag & SEQ_USE_PROXY_CUSTOM_DIR) + seq->strip->proxy->storage = SEQ_STORAGE_PROXY_CUSTOM_DIR; + if (seq->flag & SEQ_USE_PROXY_CUSTOM_FILE) + seq->strip->proxy->storage = SEQ_STORAGE_PROXY_CUSTOM_FILE; + } +#undef SEQ_USE_PROXY_CUSTOM_DIR +#undef SEQ_USE_PROXY_CUSTOM_FILE + + } + SEQ_END + } + + for (screen = main->screen.first; screen; screen = screen->id.next) { + ScrArea *sa; + for (sa = screen->areabase.first; sa; sa = sa->next) { + SpaceLink *sl; + + for (sl = sa->spacedata.first; sl; sl = sl->next) { + switch (sl->spacetype) { + case SPACE_VIEW3D: + { + View3D *v3d = (View3D *)sl; + v3d->stereo3d_camera = STEREO_3D_ID; + v3d->stereo3d_flag |= V3D_S3D_DISPPLANE; + v3d->stereo3d_convergence_alpha = 0.15f; + v3d->stereo3d_volume_alpha = 0.05f; + break; + } + case SPACE_IMAGE: + { + SpaceImage *sima = (SpaceImage *) sl; + sima->iuser.flag |= IMA_SHOW_STEREO; + sima->iuser.passtype = SCE_PASS_COMBINED; + break; + } + } + } + } + } + + for (cam = main->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) { + ima->stereo3d_format = MEM_callocN(sizeof(Stereo3dFormat), "Image Stereo 3d Format"); + + if (ima->packedfile) { + ImagePackedFile *imapf = MEM_mallocN(sizeof(ImagePackedFile), "Image Packed File"); + BLI_addtail(&ima->packedfiles, imapf); + + imapf->packedfile = ima->packedfile; + BLI_strncpy(imapf->filepath, ima->name, FILE_MAX); + ima->packedfile = NULL; + } + } + + for (wm = main->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)) { + bScreen *screen; + + if (!DNA_struct_elem_find(fd->filesdna, "FileSelectParams", "int", "thumbnail_size")) { + for (screen = main->screen.first; screen; screen = screen->id.next) { + ScrArea *sa; + + for (sa = screen->areabase.first; sa; sa = sa->next) { + SpaceLink *sl; + + for (sl = sa->spacedata.first; sl; sl = sl->next) { + if (sl->spacetype == SPACE_FILE) { + SpaceFile *sfile = (SpaceFile *)sl; + + if (sfile->params) { + sfile->params->thumbnail_size = 128; + } + } + } + } + } + } + + 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) { + scene->r.simplify_subsurf_render = scene->r.simplify_subsurf; + scene->r.simplify_particles_render = scene->r.simplify_particles; + } + } + + if (!DNA_struct_elem_find(fd->filesdna, "DecimateModifierData", "float", "defgrp_factor")) { + Object *ob; + + for (ob = main->object.first; ob; ob = ob->id.next) { + ModifierData *md; + for (md = ob->modifiers.first; md; md = md->next) { + if (md->type == eModifierType_Decimate) { + DecimateModifierData *dmd = (DecimateModifierData *)md; + dmd->defgrp_factor = 1.0f; + } + } + } + } } } |