diff options
author | Ton Roosendaal <ton@blender.org> | 2018-04-19 18:34:44 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-04-19 18:35:25 +0300 |
commit | 51b796ff1528c52cc8b4079fab1003671652a4d9 (patch) | |
tree | 0dfc2d2dabe5e77959264f5b6667897569290a41 /source/blender/blenloader/intern | |
parent | 785e8a636a293941a4295e669cb5aeecfafae039 (diff) |
Remove Blender Internal and legacy viewport from Blender 2.8.
Brecht authored this commit, but he gave me the honours to actually
do it. Here it goes; Blender Internal. Bye bye, you did great!
* Point density, voxel data, ocean, environment map textures were removed,
as these only worked within BI rendering. Note that the ocean modifier
and the Cycles point density shader node continue to work.
* Dynamic paint using material shading was removed, as this only worked
with BI. If we ever wanted to support this again probably it should go
through the baking API.
* GPU shader export through the Python API was removed. This only worked
for the old BI GLSL shaders, which no longer exists. Doing something
similar for Eevee would be significantly more complicated because it
uses a lot of multiplass rendering and logic outside the shader, it's
probably impractical.
* Collada material import / export code is mostly gone, as it only worked
for BI materials. We need to add Cycles / Eevee material support at some
point.
* The mesh noise operator was removed since it only worked with BI
material texture slots. A displacement modifier can be used instead.
* The delete texture paint slot operator was removed since it only worked
for BI material texture slots. Could be added back with node support.
* Not all legacy viewport features are supported in the new viewport, but
their code was removed. If we need to bring anything back we can look at
older git revisions.
* There is some legacy viewport code that I could not remove yet, and some
that I probably missed.
* Shader node execution code was left mostly intact, even though it is not
used anywhere now. We may eventually use this to replace the texture
nodes with Cycles / Eevee shader nodes.
* The Cycles Bake panel now includes settings for baking multires normal
and displacement maps. The underlying code needs to be merged properly,
and we plan to add back support for multires AO baking and add support
to Cycles baking for features like vertex color, displacement, and other
missing baking features.
* This commit removes DNA and the Python API for BI material, lamp, world
and scene settings. This breaks a lot of addons.
* There is more DNA that can be removed or renamed, where Cycles or Eevee
are reusing some old BI properties but the names are not really correct
anymore.
* Texture slots for materials, lamps and world were removed. They remain
for brushes, particles and freestyle linestyles.
* 'BLENDER_RENDER' remains in the COMPAT_ENGINES of UI panels. Cycles and
other renderers use this to find all panels to show, minus a few panels
that they have their own replacement for.
Diffstat (limited to 'source/blender/blenloader/intern')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 117 | ||||
-rw-r--r-- | source/blender/blenloader/intern/versioning_250.c | 273 | ||||
-rw-r--r-- | source/blender/blenloader/intern/versioning_260.c | 58 | ||||
-rw-r--r-- | source/blender/blenloader/intern/versioning_270.c | 41 | ||||
-rw-r--r-- | source/blender/blenloader/intern/versioning_280.c | 29 | ||||
-rw-r--r-- | source/blender/blenloader/intern/versioning_legacy.c | 355 | ||||
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 44 |
7 files changed, 25 insertions, 892 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 4ec4f43fb1e..82994eb0bc4 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -3614,14 +3614,6 @@ static void lib_link_lamp(FileData *fd, Main *main) IDP_LibLinkProperty(la->id.properties, fd); lib_link_animdata(fd, &la->id, la->adt); - for (int a = 0; a < MAX_MTEX; a++) { - MTex *mtex = la->mtex[a]; - if (mtex) { - mtex->tex = newlibadr_us(fd, la->id.lib, mtex->tex); - mtex->object = newlibadr(fd, la->id.lib, mtex->object); - } - } - la->ipo = newlibadr_us(fd, la->id.lib, la->ipo); // XXX deprecated - old animation system if (la->nodetree) { @@ -3636,15 +3628,9 @@ static void lib_link_lamp(FileData *fd, Main *main) static void direct_link_lamp(FileData *fd, Lamp *la) { - int a; - la->adt = newdataadr(fd, la->adt); direct_link_animdata(fd, la->adt); - for (a=0; a<MAX_MTEX; a++) { - la->mtex[a] = newdataadr(fd, la->mtex[a]); - } - la->curfalloff = newdataadr(fd, la->curfalloff); if (la->curfalloff) direct_link_curvemapping(fd, la->curfalloff); @@ -3783,14 +3769,6 @@ static void lib_link_world(FileData *fd, Main *main) wrld->ipo = newlibadr_us(fd, wrld->id.lib, wrld->ipo); // XXX deprecated - old animation system - for (int a = 0; a < MAX_MTEX; a++) { - MTex *mtex = wrld->mtex[a]; - if (mtex) { - mtex->tex = newlibadr_us(fd, wrld->id.lib, mtex->tex); - mtex->object = newlibadr(fd, wrld->id.lib, mtex->object); - } - } - if (wrld->nodetree) { lib_link_ntree(fd, &wrld->id, wrld->nodetree); wrld->nodetree->id.lib = wrld->id.lib; @@ -3803,15 +3781,9 @@ static void lib_link_world(FileData *fd, Main *main) static void direct_link_world(FileData *fd, World *wrld) { - int a; - wrld->adt = newdataadr(fd, wrld->adt); direct_link_animdata(fd, wrld->adt); - for (a = 0; a < MAX_MTEX; a++) { - wrld->mtex[a] = newdataadr(fd, wrld->mtex[a]); - } - wrld->nodetree = newdataadr(fd, wrld->nodetree); if (wrld->nodetree) { direct_link_id(fd, &wrld->nodetree->id); @@ -4063,14 +4035,6 @@ static void lib_link_texture(FileData *fd, Main *main) tex->ima = newlibadr_us(fd, tex->id.lib, tex->ima); tex->ipo = newlibadr_us(fd, tex->id.lib, tex->ipo); // XXX deprecated - old animation system - if (tex->env) - tex->env->object = newlibadr(fd, tex->id.lib, tex->env->object); - if (tex->pd) - tex->pd->object = newlibadr(fd, tex->id.lib, tex->pd->object); - if (tex->vd) - tex->vd->object = newlibadr(fd, tex->id.lib, tex->vd->object); - if (tex->ot) - tex->ot->object = newlibadr(fd, tex->id.lib, tex->ot->object); if (tex->nodetree) { lib_link_ntree(fd, &tex->id, tex->nodetree); @@ -4088,35 +4052,7 @@ static void direct_link_texture(FileData *fd, Tex *tex) direct_link_animdata(fd, tex->adt); tex->coba = newdataadr(fd, tex->coba); - tex->env = newdataadr(fd, tex->env); - if (tex->env) { - tex->env->ima = NULL; - memset(tex->env->cube, 0, 6 * sizeof(void *)); - tex->env->ok= 0; - } - tex->pd = newdataadr(fd, tex->pd); - if (tex->pd) { - tex->pd->point_tree = NULL; - tex->pd->coba = newdataadr(fd, tex->pd->coba); - tex->pd->falloff_curve = newdataadr(fd, tex->pd->falloff_curve); - if (tex->pd->falloff_curve) { - direct_link_curvemapping(fd, tex->pd->falloff_curve); - } - tex->pd->point_data = NULL; /* runtime data */ - } - - tex->vd = newdataadr(fd, tex->vd); - if (tex->vd) { - tex->vd->dataset = NULL; - tex->vd->ok = 0; - } - else { - if (tex->type == TEX_VOXELDATA) - tex->vd = MEM_callocN(sizeof(VoxelData), "direct_link_texture VoxelData"); - } - - tex->ot = newdataadr(fd, tex->ot); - + tex->nodetree = newdataadr(fd, tex->nodetree); if (tex->nodetree) { direct_link_id(fd, &tex->nodetree->id); @@ -4140,15 +4076,6 @@ static void lib_link_material(FileData *fd, Main *main) lib_link_animdata(fd, &ma->id, ma->adt); ma->ipo = newlibadr_us(fd, ma->id.lib, ma->ipo); // XXX deprecated - old animation system - ma->group = newlibadr_us(fd, ma->id.lib, ma->group); - - for (int a = 0; a < MAX_MTEX; a++) { - MTex *mtex = ma->mtex[a]; - if (mtex) { - mtex->tex = newlibadr_us(fd, ma->id.lib, mtex->tex); - mtex->object = newlibadr(fd, ma->id.lib, mtex->object); - } - } if (ma->nodetree) { lib_link_ntree(fd, &ma->id, ma->nodetree); @@ -4162,18 +4089,10 @@ static void lib_link_material(FileData *fd, Main *main) static void direct_link_material(FileData *fd, Material *ma) { - int a; - ma->adt = newdataadr(fd, ma->adt); direct_link_animdata(fd, ma->adt); - for (a = 0; a < MAX_MTEX; a++) { - ma->mtex[a] = newdataadr(fd, ma->mtex[a]); - } ma->texpaintslot = NULL; - - ma->ramp_col = newdataadr(fd, ma->ramp_col); - ma->ramp_spec = newdataadr(fd, ma->ramp_spec); ma->nodetree = newdataadr(fd, ma->nodetree); if (ma->nodetree) { @@ -9383,15 +9302,6 @@ static void expand_brush(FileData *fd, Main *mainvar, Brush *brush) static void expand_material(FileData *fd, Main *mainvar, Material *ma) { - int a; - - for (a = 0; a < MAX_MTEX; a++) { - if (ma->mtex[a]) { - expand_doit(fd, mainvar, ma->mtex[a]->tex); - expand_doit(fd, mainvar, ma->mtex[a]->object); - } - } - expand_doit(fd, mainvar, ma->ipo); // XXX deprecated - old animation system if (ma->adt) @@ -9399,26 +9309,10 @@ static void expand_material(FileData *fd, Main *mainvar, Material *ma) if (ma->nodetree) expand_nodetree(fd, mainvar, ma->nodetree); - - if (ma->group) - expand_doit(fd, mainvar, ma->group); - - if (ma->edit_image) { - expand_doit(fd, mainvar, ma->edit_image); - } } static void expand_lamp(FileData *fd, Main *mainvar, Lamp *la) { - int a; - - for (a = 0; a < MAX_MTEX; a++) { - if (la->mtex[a]) { - expand_doit(fd, mainvar, la->mtex[a]->tex); - expand_doit(fd, mainvar, la->mtex[a]->object); - } - } - expand_doit(fd, mainvar, la->ipo); // XXX deprecated - old animation system if (la->adt) @@ -9440,15 +9334,6 @@ static void expand_lattice(FileData *fd, Main *mainvar, Lattice *lt) static void expand_world(FileData *fd, Main *mainvar, World *wrld) { - int a; - - for (a = 0; a < MAX_MTEX; a++) { - if (wrld->mtex[a]) { - expand_doit(fd, mainvar, wrld->mtex[a]->tex); - expand_doit(fd, mainvar, wrld->mtex[a]->object); - } - } - expand_doit(fd, mainvar, wrld->ipo); // XXX deprecated - old animation system if (wrld->adt) diff --git a/source/blender/blenloader/intern/versioning_250.c b/source/blender/blenloader/intern/versioning_250.c index e7f448f6a86..cc8073c67a7 100644 --- a/source/blender/blenloader/intern/versioning_250.c +++ b/source/blender/blenloader/intern/versioning_250.c @@ -515,70 +515,6 @@ static void do_versions_gpencil_2_50(Main *main, bScreen *screen) } } -static void do_version_mtex_factor_2_50(MTex **mtex_array, short idtype) -{ - MTex *mtex; - float varfac, colfac; - int a, neg; - - if (!mtex_array) - return; - - for (a = 0; a < MAX_MTEX; a++) { - if (mtex_array[a]) { - mtex = mtex_array[a]; - - neg = mtex->maptoneg; - varfac = mtex->varfac; - colfac = mtex->colfac; - - if (neg & MAP_DISP) mtex->dispfac = -mtex->dispfac; - if (neg & MAP_NORM) mtex->norfac = -mtex->norfac; - if (neg & MAP_WARP) mtex->warpfac = -mtex->warpfac; - - mtex->colspecfac = (neg & MAP_COLSPEC)? -colfac: colfac; - mtex->mirrfac = (neg & MAP_COLMIR)? -colfac: colfac; - mtex->alphafac = (neg & MAP_ALPHA)? -varfac: varfac; - mtex->difffac = (neg & MAP_REF)? -varfac: varfac; - mtex->specfac = (neg & MAP_SPEC)? -varfac: varfac; - mtex->emitfac = (neg & MAP_EMIT)? -varfac: varfac; - mtex->hardfac = (neg & MAP_HAR)? -varfac: varfac; - mtex->raymirrfac = (neg & MAP_RAYMIRR)? -varfac: varfac; - mtex->translfac = (neg & MAP_TRANSLU)? -varfac: varfac; - mtex->ambfac = (neg & MAP_AMB)? -varfac: varfac; - mtex->colemitfac = (neg & MAP_EMISSION_COL)? -colfac: colfac; - mtex->colreflfac = (neg & MAP_REFLECTION_COL)? -colfac: colfac; - mtex->coltransfac = (neg & MAP_TRANSMISSION_COL)? -colfac: colfac; - mtex->densfac = (neg & MAP_DENSITY)? -varfac: varfac; - mtex->scatterfac = (neg & MAP_SCATTERING)? -varfac: varfac; - mtex->reflfac = (neg & MAP_REFLECTION)? -varfac: varfac; - - mtex->timefac = (neg & MAP_PA_TIME)? -varfac: varfac; - mtex->lengthfac = (neg & MAP_PA_LENGTH)? -varfac: varfac; - mtex->clumpfac = (neg & MAP_PA_CLUMP)? -varfac: varfac; - mtex->kinkfac = (neg & MAP_PA_KINK)? -varfac: varfac; - mtex->roughfac = (neg & MAP_PA_ROUGH)? -varfac: varfac; - mtex->padensfac = (neg & MAP_PA_DENS)? -varfac: varfac; - mtex->lifefac = (neg & MAP_PA_LIFE)? -varfac: varfac; - mtex->sizefac = (neg & MAP_PA_SIZE)? -varfac: varfac; - mtex->ivelfac = (neg & MAP_PA_IVEL)? -varfac: varfac; - - mtex->shadowfac = (neg & LAMAP_SHAD)? -colfac: colfac; - - mtex->zenupfac = (neg & WOMAP_ZENUP)? -colfac: colfac; - mtex->zendownfac = (neg & WOMAP_ZENDOWN)? -colfac: colfac; - mtex->blendfac = (neg & WOMAP_BLEND)? -varfac: varfac; - - if (idtype == ID_MA) - mtex->colfac = (neg & MAP_COL)? -colfac: colfac; - else if (idtype == ID_LA) - mtex->colfac = (neg & LAMAP_COL)? -colfac: colfac; - else if (idtype == ID_WO) - mtex->colfac = (neg & WOMAP_HORIZ)? -colfac: colfac; - } - } -} - static void do_version_mdef_250(Main *main) { Object *ob; @@ -742,7 +678,6 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) bSound *sound; Sequence *seq; - int a; for (sound = main->sound.first; sound; sound = sound->id.next) { if (sound->newpackedfile) { @@ -787,15 +722,6 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) for (ma = main->mat.first; ma; ma = ma->id.next) { if (ma->nodetree && ma->nodetree->id.name[0] == '\0') strcpy(ma->nodetree->id.name, "NTShader Nodetree"); - - /* which_output 0 is now "not specified" */ - for (a = 0; a < MAX_MTEX; a++) { - if (ma->mtex[a]) { - tx = blo_do_versions_newlibadr(fd, lib, ma->mtex[a]->tex); - if (tx && tx->use_nodes) - ma->mtex[a]->which_output++; - } - } } /* and composite trees */ @@ -881,7 +807,6 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) if (main->versionfile < 250 || (main->versionfile == 250 && main->subversionfile < 1)) { Object *ob; - Material *ma; Tex *tex; Scene *sce; ToolSettings *ts; @@ -927,61 +852,6 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) tex->afmax = 8; } - for (ma = main->mat.first; ma; ma = ma->id.next) { - int a; - - if (ma->mode & MA_WIRE) { - ma->material_type = MA_TYPE_WIRE; - ma->mode &= ~MA_WIRE; - } - - if (ma->mode & MA_HALO) { - ma->material_type = MA_TYPE_HALO; - ma->mode &= ~MA_HALO; - } - - if (ma->mode & (MA_ZTRANSP|MA_RAYTRANSP)) { - ma->mode |= MA_TRANSP; - } - else { - /* ma->mode |= MA_ZTRANSP; */ /* leave ztransp as is even if its not used [#28113] */ - ma->mode &= ~MA_TRANSP; - } - - /* set new bump for unused slots */ - for (a = 0; a < MAX_MTEX; a++) { - if (ma->mtex[a]) { - tex = ma->mtex[a]->tex; - if (!tex) { - ma->mtex[a]->texflag |= MTEX_3TAP_BUMP; - ma->mtex[a]->texflag |= MTEX_BUMP_OBJECTSPACE; - } - else { - tex = (Tex*) blo_do_versions_newlibadr(fd, ma->id.lib, tex); - if (tex && tex->type == 0) { /* invalid type */ - ma->mtex[a]->texflag |= MTEX_3TAP_BUMP; - ma->mtex[a]->texflag |= MTEX_BUMP_OBJECTSPACE; - } - } - } - } - - /* volume rendering settings */ - if (ma->vol.stepsize < 0.0001f) { - ma->vol.density = 1.0f; - ma->vol.emission = 0.0f; - ma->vol.scattering = 1.0f; - ma->vol.emission_col[0] = ma->vol.emission_col[1] = ma->vol.emission_col[2] = 1.0f; - ma->vol.density_scale = 1.0f; - ma->vol.depth_cutoff = 0.01f; - ma->vol.stepsize_type = MA_VOL_STEP_RANDOMIZED; - ma->vol.stepsize = 0.2f; - ma->vol.shade_type = MA_VOL_SHADE_SHADED; - ma->vol.shadeflag |= MA_VOL_PRECACHESHADING; - ma->vol.precache_resolution = 50; - } - } - for (sce = main->scene.first; sce; sce = sce->id.next) { ts = sce->toolsettings; if (ts->normalsize == 0.0f || !ts->uv_selectmode || ts->vgroup_weight == 0.0f) { @@ -1013,10 +883,6 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) if (main->versionfile < 250 || (main->versionfile == 250 && main->subversionfile < 4)) { Scene *sce; Object *ob; - Material *ma; - Lamp *la; - World *wo; - Tex *tex; ParticleSettings *part; bool do_gravity = false; @@ -1034,27 +900,6 @@ 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) { - 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; - ma->vol.reflection_col[0] = ma->vol.reflection_col[1] = ma->vol.reflection_col[2] = 1.0f; - } - - do_version_mtex_factor_2_50(ma->mtex, ID_MA); - } - - for (la = main->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) - do_version_mtex_factor_2_50(wo->mtex, ID_WO); - - for (tex = main->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) { if (sce->audio.main == 0.0f) sce->audio.main = 1.0f; @@ -1115,7 +960,6 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) if (main->versionfile < 250 || (main->versionfile == 250 && main->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) { @@ -1133,9 +977,6 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) } } } - - for (la = main->lamp.first; la; la = la->id.next) - la->compressthresh = 0.05f; } if (main->versionfile < 250 || (main->versionfile == 250 && main->subversionfile < 7)) { @@ -1204,8 +1045,6 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) while (sce) { if (sce->r.frame_step == 0) sce->r.frame_step = 1; - if (sce->r.mblur_samples == 0) - sce->r.mblur_samples = sce->r.osa; if (sce->ed && sce->ed->seqbase.first) { do_versions_seq_unique_name_all_strips(sce, &sce->ed->seqbase); @@ -1262,7 +1101,6 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) if (main->versionfile == 250) { Scene *sce = main->scene.first; Material *ma = main->mat.first; - World *wo = main->world.first; Tex *tex = main->tex.first; int i, convert = 0; @@ -1280,26 +1118,8 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) if (convert) { while (ma) { - if (ma->ramp_col) { - ColorBand *band = (ColorBand *)ma->ramp_col; - for (i = 0; i < band->tot; i++) { - CBData *data = band->data + i; - srgb_to_linearrgb_v3_v3(&data->r, &data->r); - } - } - - if (ma->ramp_spec) { - ColorBand *band = (ColorBand *)ma->ramp_spec; - for (i = 0; i < band->tot; i++) { - CBData *data = band->data + i; - srgb_to_linearrgb_v3_v3(&data->r, &data->r); - } - } - srgb_to_linearrgb_v3_v3(&ma->r, &ma->r); srgb_to_linearrgb_v3_v3(&ma->specr, &ma->specr); - srgb_to_linearrgb_v3_v3(&ma->mirr, &ma->mirr); - srgb_to_linearrgb_v3_v3(ma->sss_col, ma->sss_col); ma = ma->id.next; } @@ -1313,13 +1133,6 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) } tex = tex->id.next; } - - while (wo) { - srgb_to_linearrgb_v3_v3(&wo->ambr, &wo->ambr); - srgb_to_linearrgb_v3_v3(&wo->horr, &wo->horr); - srgb_to_linearrgb_v3_v3(&wo->zenr, &wo->zenr); - wo = wo->id.next; - } } } } @@ -1450,7 +1263,6 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) if (main->versionfile < 250 || (main->versionfile == 250 && main->subversionfile < 12)) { Object *ob; Brush *brush; - Material *ma; /* anim viz changes */ for (ob = main->object.first; ob; ob = ob->id.next) { @@ -1532,14 +1344,6 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) BKE_texture_mtex_default(&brush->mtex); BKE_texture_mtex_default(&brush->mask_mtex); } - - for (ma = main->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; - ma->vol.ms_intensity = 1.f; - } - } } if (main->versionfile < 250 || (main->versionfile == 250 && main->subversionfile < 13)) { @@ -1598,41 +1402,9 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) } } - if (main->versionfile < 250 || (main->versionfile == 250 && main->subversionfile < 15)) { - World *wo; - Material *ma; - - /* ambient default from 0.5f to 1.0f */ - for (ma = main->mat.first; ma; ma = ma->id.next) - ma->amb *= 2.0f; - - for (wo = main->world.first; wo; wo = wo->id.next) { - /* ao splitting into ao/env/indirect */ - wo->ao_env_energy = wo->aoenergy; - wo->aoenergy = 1.0f; - - if (wo->ao_indirect_bounces == 0) - wo->ao_indirect_bounces = 1; - else - wo->mode |= WO_INDIRECT_LIGHT; - - if (wo->aomix == WO_AOSUB) - wo->ao_env_energy = -wo->ao_env_energy; - else if (wo->aomix == WO_AOADDSUB) - wo->mode |= WO_AMB_OCC; - - wo->aomix = WO_AOMUL; - - /* ambient default from 0.5f to 1.0f */ - mul_v3_fl(&wo->ambr, 0.5f); - wo->ao_env_energy *= 0.5f; - } - } - if (main->versionfile < 250 || (main->versionfile == 250 && main->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) { @@ -1664,10 +1436,6 @@ 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) - if (ma->mode & MA_TRACEBLE) - ma->shade_flag |= MA_APPROX_OCCLUSION; - /* sequencer changes */ { bScreen *screen; @@ -2269,27 +2037,6 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) Brush *brush; Object *ob; ParticleSettings *part; - Material *mat; - int tex_nr, transp_tex; - - for (mat = main->mat.first; mat; mat = mat->id.next) { - if (!(mat->mode & MA_TRANSP) && !(mat->material_type & MA_TYPE_VOLUME)) { - transp_tex = 0; - - for (tex_nr = 0; tex_nr < MAX_MTEX; tex_nr++) { - if (!mat->mtex[tex_nr]) - continue; - if (mat->mtex[tex_nr]->mapto & MAP_ALPHA) - transp_tex = 1; - } - - /* weak! material alpha could be animated */ - if (mat->alpha < 1.0f || mat->fresnel_tra > 0.0f || transp_tex) { - mat->mode |= MA_TRANSP; - mat->mode &= ~(MA_ZTRANSP|MA_RAYTRANSP); - } - } - } /* redraws flag in SpaceTime has been moved to Screen level */ for (sc = main->screen.first; sc; sc = sc->id.next) { @@ -2383,26 +2130,6 @@ 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) { - if (tex->pd) { - if (tex->pd->falloff_speed_scale == 0.0f) - tex->pd->falloff_speed_scale = 100.0f; - - if (!tex->pd->falloff_curve) { - tex->pd->falloff_curve = curvemapping_add(1, 0, 0, 1, 1); - - tex->pd->falloff_curve->preset = CURVE_PRESET_LINE; - tex->pd->falloff_curve->cm->flag &= ~CUMA_EXTEND_EXTRAPOLATE; - curvemap_reset(tex->pd->falloff_curve->cm, &tex->pd->falloff_curve->clipr, tex->pd->falloff_curve->preset, CURVEMAP_SLOPE_POSITIVE); - curvemapping_changed(tex->pd->falloff_curve, false); - } - } - } - } - - { ParticleSettings *part; for (part = main->particle.first; part; part = part->id.next) { /* Initialize particle billboard scale */ diff --git a/source/blender/blenloader/intern/versioning_260.c b/source/blender/blenloader/intern/versioning_260.c index 89577c7b7d1..4049912b586 100644 --- a/source/blender/blenloader/intern/versioning_260.c +++ b/source/blender/blenloader/intern/versioning_260.c @@ -1156,15 +1156,9 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main) } if (main->versionfile < 263 || (main->versionfile == 263 && main->subversionfile < 4)) { - Lamp *la; Camera *cam; Curve *cu; - for (la = main->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) { if (cam->flag & CAM_PANORAMA) { cam->type = CAM_PANO; @@ -1341,14 +1335,6 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main) } } - if (main->versionfile < 263 || (main->versionfile == 263 && main->subversionfile < 12)) { - Material *ma; - - for (ma = main->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 (ntree->type == NTREE_COMPOSIT) { @@ -1495,20 +1481,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main) } } - /* remove texco */ if (main->versionfile < 263 || (main->versionfile == 263 && main->subversionfile < 21)) { - Material *ma; - for (ma = main->mat.first; ma; ma = ma->id.next) { - int a; - for (a = 0; a < MAX_MTEX; a++) { - if (ma->mtex[a]) { - if (ma->mtex[a]->texco == TEXCO_STICKY_) { - ma->mtex[a]->texco = TEXCO_UV; - } - } - } - } - { Mesh *me; for (me = main->mesh.first; me; me = me->id.next) { @@ -1666,17 +1639,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main) for (scene = main->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 - * lowest possible tile size value - */ - scene->r.tilex = max_ii(scene->r.xsch * scene->r.size / scene->r.xparts / 100, 8); - scene->r.tiley = max_ii(scene->r.ysch * scene->r.size / scene->r.yparts / 100, 8); - } - else { - /* happens when mixing using current trunk and previous release */ - scene->r.tilex = scene->r.tiley = 64; - } + scene->r.tilex = scene->r.tiley = 64; } } } @@ -1762,7 +1725,6 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main) for (scene = main->scene.first; scene; scene = scene->id.next) { Sequence *seq; - bool set_premul = false; SEQ_BEGIN (scene->ed, seq) { @@ -1777,24 +1739,6 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main) if (scene->r.bake_samples == 0) scene->r.bake_samples = 256; - - if (scene->world) { - World *world = blo_do_versions_newlibadr(fd, scene->id.lib, scene->world); - - if (world && is_zero_v3(&world->horr)) { - if ((world->skytype & WO_SKYBLEND) == 0 || is_zero_v3(&world->zenr)) { - set_premul = true; - } - } - } - else - set_premul = true; - - if (set_premul) { - printf("2.66 versioning fix: replacing black sky with premultiplied alpha for scene %s\n", - scene->id.name + 2); - scene->r.alphamode = R_ALPHAPREMUL; - } } for (Image *image = main->image.first; image; image = image->id.next) { diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c index 7097fe656b6..cd34f10d8a9 100644 --- a/source/blender/blenloader/intern/versioning_270.c +++ b/source/blender/blenloader/intern/versioning_270.c @@ -405,7 +405,6 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main) } if (!MAIN_VERSION_ATLEAST(main, 270, 1)) { - Scene *sce; Object *ob; /* Update Transform constraint (another deg -> rad stuff). */ @@ -420,12 +419,6 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main) } } } - - for (sce = main->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)) { @@ -488,13 +481,6 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main) } if (!MAIN_VERSION_ATLEAST(main, 271, 0)) { - if (!DNA_struct_elem_find(fd->filesdna, "Material", "int", "mode2")) { - Material *ma; - - for (ma = main->mat.first; ma; ma = ma->id.next) - ma->mode2 = MA_CASTSHADOW; - } - if (!DNA_struct_elem_find(fd->filesdna, "RenderData", "BakeData", "bake")) { Scene *sce; @@ -835,33 +821,6 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main) } } - 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; diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index d6cf411c31c..0d781322d4f 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -667,16 +667,6 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *main) { if (!MAIN_VERSION_ATLEAST(main, 280, 0)) { - for (Scene *scene = main->scene.first; scene; scene = scene->id.next) { - if (STREQ(scene->r.engine, RE_engine_id_BLENDER_RENDER)) { -#ifdef WITH_CLAY_ENGINE - BLI_strncpy(scene->r.engine, RE_engine_id_BLENDER_CLAY, sizeof(scene->r.engine)); -#else - BLI_strncpy(scene->r.engine, RE_engine_id_BLENDER_EEVEE, sizeof(scene->r.engine)); -#endif - } - } - if (!DNA_struct_elem_find(fd->filesdna, "Scene", "ListBase", "view_layers")) { for (Scene *scene = main->scene.first; scene; scene = scene->id.next) { /* Master Collection */ @@ -937,4 +927,23 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *main) } } } + + if (!MAIN_VERSION_ATLEAST(main, 280, 8)) { + /* Blender Internal removal */ + for (Scene *scene = main->scene.first; scene; scene = scene->id.next) { + if (STREQ(scene->r.engine, "BLENDER_RENDER") || + STREQ(scene->r.engine, "BLENDER_GAME")) { + BLI_strncpy(scene->r.engine, RE_engine_id_BLENDER_EEVEE, sizeof(scene->r.engine)); + } + + scene->r.bake_mode = 0; + } + + for (Tex *tex = main->tex.first; tex; tex = tex->id.next) { + /* Removed envmap, pointdensity, voxeldata, ocean textures. */ + if (ELEM(tex->type, 10, 14, 15, 16)) { + tex->type = 0; + } + } + } } diff --git a/source/blender/blenloader/intern/versioning_legacy.c b/source/blender/blenloader/intern/versioning_legacy.c index e16cc122414..9ac2f926da6 100644 --- a/source/blender/blenloader/intern/versioning_legacy.c +++ b/source/blender/blenloader/intern/versioning_legacy.c @@ -212,12 +212,6 @@ static void ntree_version_242(bNodeTree *ntree) } } } - else if (ntree->type == NTREE_SHADER) { - for (node = ntree->nodes.first; node; node = node->next) - if (node->type == SH_NODE_GEOMETRY && node->storage == NULL) - node->storage = MEM_callocN(sizeof(NodeGeometry), "NodeGeometry"); - } - } static void ntree_version_245(FileData *fd, Library *lib, bNodeTree *ntree) @@ -525,15 +519,6 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main) } } - if (main->versionfile <= 102) { - /* init halo's at 1.0 */ - Material *ma = main->mat.first; - while (ma) { - ma->add = 1.0; - ma = ma->id.next; - } - } - if (main->versionfile <= 103) { /* new variable in object: colbits */ Object *ob = main->object.first; @@ -585,11 +570,6 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main) if (main->versionfile <= 107) { Object *ob; - Scene *sce = main->scene.first; - while (sce) { - sce->r.mode |= R_GAMMA; - sce = sce->id.next; - } ob = main->object.first; while (ob) { if (ob->dt == 0) @@ -621,17 +601,6 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main) } } - if (main->versionfile <= 113) { - Material *ma = main->mat.first; - while (ma) { - if (ma->flaresize == 0.0f) - ma->flaresize = 1.0f; - ma->subsize = 1.0f; - ma->flareboost = 1.0f; - ma = ma->id.next; - } - } - if (main->versionfile <= 134) { Tex *tex = main->tex.first; while (tex) { @@ -796,17 +765,6 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main) } } - if (main->versionfile <= 191) { - Material *ma = main->mat.first; - - /* let faces have default add factor of 0.0 */ - while (ma) { - if (!(ma->mode & MA_HALO)) - ma->add = 0.0; - ma = ma->id.next; - } - } - if (main->versionfile <= 204) { bSound *sound; @@ -890,31 +848,6 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main) } } - if (main->versionfile <= 221) { - Scene *sce = main->scene.first; - - /* new variables for std-alone player and runtime */ - while (sce) { - sce->r.xplay = 640; - sce->r.yplay = 480; - sce->r.freqplay = 60; - - sce = sce->id.next; - } - - } - - if (main->versionfile <= 222) { - Scene *sce = main->scene.first; - - /* new variables for std-alone player and runtime */ - while (sce) { - sce->r.depth = 32; - - sce = sce->id.next; - } - } - if (main->versionfile <= 223) { VFont *vf; for (vf = main->vfont.first; vf; vf = vf->id.next) { @@ -967,7 +900,6 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main) if (main->versionfile <= 227) { Scene *sce; - Material *ma; bScreen *sc; Object *ob; @@ -1020,17 +952,6 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main) for (sce = main->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) { - ma->refrac = 4.0f; - ma->roughness = 0.5f; - ma->param[0] = 0.5f; - ma->param[1] = 0.1f; - ma->param[2] = 0.1f; - ma->param[3] = 0.05f; } /* patch for old wrong max view2d settings, allows zooming out more */ @@ -1055,7 +976,6 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main) } if (main->versionfile <= 228) { - Scene *sce; bScreen *sc; Object *ob; @@ -1101,10 +1021,6 @@ 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) { - sce->r.mode |= R_ENVMAP; - } - /* convert old mainb values for new button panels */ for (sc = main->screen.first; sc; sc = sc->id.next) { ScrArea *sa; @@ -1224,57 +1140,7 @@ 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; - Scene *sce; - Lamp *la; - World *wrld; - - /* introduction of raytrace */ - while (ma) { - if (ma->fresnel_tra_i == 0.0f) - ma->fresnel_tra_i = 1.25f; - if (ma->fresnel_mir_i == 0.0f) - ma->fresnel_mir_i = 1.25f; - - ma->ang = 1.0; - ma->ray_depth = 2; - ma->ray_depth_tra = 2; - ma->fresnel_tra = 0.0; - ma->fresnel_mir = 0.0; - - ma = ma->id.next; - } - sce = main->scene.first; - while (sce) { - if (sce->r.gauss == 0.0f) - sce->r.gauss = 1.0f; - sce = sce->id.next; - } - la = main->lamp.first; - while (la) { - if (la->k == 0.0f) la->k = 1.0; - if (la->ray_samp == 0) - la->ray_samp = 1; - if (la->ray_sampy == 0) - la->ray_sampy = 1; - if (la->ray_sampz == 0) - la->ray_sampz = 1; - if (la->area_size == 0.0f) - la->area_size = 1.0f; - if (la->area_sizey == 0.0f) - la->area_sizey = 1.0f; - if (la->area_sizez == 0.0f) - la->area_sizez = 1.0f; - la = la->id.next; - } - wrld = main->world.first; - while (wrld) { - if (wrld->range == 0.0f) { - wrld->range = 1.0f / wrld->exposure; - } - wrld = wrld->id.next; - } /* new bit flags for showing/hiding grid floor and axes */ @@ -1305,7 +1171,6 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main) Tex *tex = main->tex.first; World *wrld = main->world.first; bScreen *sc; - Scene *sce; while (tex) { if ((tex->flag & (TEX_CHECKER_ODD+TEX_CHECKER_EVEN))==0) { @@ -1332,10 +1197,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main) while (wrld) { if (wrld->aodist == 0.0f) { wrld->aodist = 10.0f; - wrld->aobias = 0.05f; } - if (wrld->aosamp == 0) - wrld->aosamp = 5; if (wrld->aoenergy == 0.0f) wrld->aoenergy = 1.0f; wrld = wrld->id.next; @@ -1360,13 +1222,6 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main) } } } - sce = main->scene.first; - while (sce) { - if (sce->r.ocres == 0) - sce->r.ocres = 64; - sce = sce->id.next; - } - } if (main->versionfile <= 233) { @@ -1375,10 +1230,6 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main) /* Object *ob = main->object.first; */ while (ma) { - if (ma->rampfac_col == 0.0f) - ma->rampfac_col = 1.0; - if (ma->rampfac_spec == 0.0f) - ma->rampfac_spec = 1.0; if (ma->pr_lamp == 0) ma->pr_lamp = 3; ma = ma->id.next; @@ -1449,7 +1300,6 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main) if (main->versionfile <= 236) { Object *ob; Camera *cam = main->camera.first; - Material *ma; bScreen *sc; while (cam) { @@ -1476,13 +1326,6 @@ 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) { - if (ma->darkness == 0.0f) { - ma->rms = 0.1f; - ma->darkness = 1.0f; - } - } /* softbody init new vars */ for (ob = main->object.first; ob; ob = ob->id.next) { @@ -1711,7 +1554,6 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main) Object *ob; Scene *sce = main->scene.first; Camera *cam = main->camera.first; - Material *ma = main->mat.first; int set_passepartout = 0; /* deformflag is local in modifier now */ @@ -1744,11 +1586,6 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main) set_passepartout = 1; sce->r.scemode &= ~R_PASSEPARTOUT; } - /* gauss is filter variable now */ - if (sce->r.mode & R_GAUSS) { - sce->r.filtertype = R_FILTER_GAUSS; - sce->r.mode &= ~R_GAUSS; - } } for (; cam; cam = cam->id.next) { @@ -1763,32 +1600,15 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main) if (!(cam->passepartalpha)) cam->passepartalpha = 0.2f; } - - for (; ma; ma = ma->id.next) { - if (ma->strand_sta == 0.0f) { - ma->strand_sta = ma->strand_end = 1.0f; - ma->mode |= MA_TANGENT_STR; - } - if (ma->mode & MA_TRACEBLE) - ma->mode |= MA_SHADBUF; - } } if (main->versionfile <= 241) { Object *ob; - Tex *tex; Scene *sce; - World *wo; Lamp *la; - Material *ma; bArmature *arm; bNodeTree *ntree; - for (wo = main->world.first; wo; wo = wo->id.next) { - if (WO_AODIST == wo->aomode) - wo->aocolor = WO_AOPLAIN; - } - /* updating layers still */ for (arm = main->armature.first; arm; arm = arm->id.next) { bone_version_239(&arm->bonebase); @@ -1799,11 +1619,6 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main) if (sce->audio.mixrate == 0) sce->audio.mixrate = 48000; - if (sce->r.xparts <2 ) - sce->r.xparts = 4; - if (sce->r.yparts < 2) - sce->r.yparts = 4; - /* We don't add default layer since blender2.8 because the layers * are now in Scene->view_layers and a default layer is created in * the doversion later on. @@ -1825,20 +1640,6 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main) sce->toolsettings->uvcalc_flag = UVCALC_FILLHOLES; sce->toolsettings->unwrapper = 1; } - - if (sce->r.mode & R_PANORAMA) { - /* all these checks to ensure saved files between released versions keep working... */ - if (sce->r.xsch < sce->r.ysch) { - Object *obc = blo_do_versions_newlibadr(fd, lib, sce->camera); - if (obc && obc->type == OB_CAMERA) { - Camera *cam = blo_do_versions_newlibadr(fd, lib, obc->data); - if (cam->lens >= 10.0f) { - sce->r.xsch *= sce->r.xparts; - cam->lens *= (float)sce->r.ysch / (float)sce->r.xsch; - } - } - } - } } for (ntree = main->nodetree.first; ntree; ntree = ntree->id.next) @@ -1848,12 +1649,6 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main) if (la->buffers == 0) la->buffers = 1; - for (tex = main->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) { if (ob->empty_drawsize == 0.0f) { @@ -1862,21 +1657,6 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main) } } - for (ma = main->mat.first; ma; ma = ma->id.next) { - /* stucci returns intensity from now on */ - int a; - for (a = 0; a < MAX_MTEX; a++) { - if (ma->mtex[a] && ma->mtex[a]->tex) { - tex = blo_do_versions_newlibadr(fd, lib, ma->mtex[a]->tex); - if (tex && tex->type == TEX_STUCCI) - ma->mtex[a]->mapto &= ~(MAP_COL|MAP_SPEC|MAP_REF); - } - } - /* transmissivity defaults */ - if (ma->tx_falloff == 0.0f) - ma->tx_falloff = 1.0f; - } - /* during 2.41 images with this name were used for viewer node output, lets fix that */ if (main->versionfile == 241) { Image *ima; @@ -2046,8 +1826,6 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main) } for (ma = main->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); } @@ -2125,7 +1903,6 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main) for (sce = main->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; sce->r.bake_flag = R_BAKE_CLEAR; } } @@ -2133,32 +1910,6 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main) if (main->versionfile <= 243) { Object *ob = main->object.first; - Material *ma; - - for (ma = main->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; - ma->sss_radius[2] = 1.0f; - ma->sss_col[0] = 0.8f; - ma->sss_col[1] = 0.8f; - ma->sss_col[2] = 0.8f; - ma->sss_error = 0.05f; - ma->sss_scale = 0.1f; - ma->sss_ior = 1.3f; - ma->sss_colfac = 1.0f; - ma->sss_texfac = 0.0f; - } - if (ma->sss_front == 0 && ma->sss_back == 0) { - ma->sss_front = 1.0f; - ma->sss_back = 1.0f; - } - if (ma->sss_col[0] == 0 && ma->sss_col[1] == 0 && ma->sss_col[2] == 0) { - ma->sss_col[0] = ma->r; - ma->sss_col[1] = ma->g; - ma->sss_col[2] = ma->b; - } - } for (; ob; ob = ob->id.next) { bDeformGroup *curdef; @@ -2206,15 +1957,9 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main) } if (main->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) - sce->r.mode |= R_SSS; - /* correct older action editors - incorrect scrolling */ for (sc = main->screen.first; sc; sc = sc->id.next) { ScrArea *sa; @@ -2237,28 +1982,6 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main) } } } - - if (main->versionfile != 244 || main->subversionfile < 3) { - /* constraints recode version patch used to be here. Moved to 245 now... */ - - for (wrld = main->world.first; wrld; wrld = wrld->id.next) { - if (wrld->mode & WO_AMB_OCC) - wrld->ao_samp_method = WO_AOSAMP_CONSTANT; - else - wrld->ao_samp_method = WO_AOSAMP_HAMMERSLEY; - - wrld->ao_adapt_thresh = 0.005f; - } - - for (la = main->lamp.first; la; la = la->id.next) { - if (la->type == LA_AREA) - la->ray_samp_method = LA_SAMP_CONSTANT; - else - la->ray_samp_method = LA_SAMP_HALTON; - - la->adapt_thresh = 0.001f; - } - } } if (main->versionfile <= 245) { @@ -2268,7 +1991,6 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main) Lamp *la; Material *ma; ParticleSettings *part; - World *wrld; Mesh *me; bNodeTree *ntree; Tex *tex; @@ -2400,10 +2122,7 @@ 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 (la->mode & LA_QUAD) - la->falloff_type = LA_FALLOFF_SLIDERS; - else - la->falloff_type = LA_FALLOFF_INVLINEAR; + la->falloff_type = LA_FALLOFF_INVLINEAR; if (la->curfalloff == NULL) { la->curfalloff = curvemapping_add(1, 0.0f, 1.0f, 1.0f, 0.0f); @@ -2413,17 +2132,9 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main) } for (ma = main->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; - ma->samp_gloss_mir = ma->samp_gloss_tra = 18; - ma->adapt_thresh_mir = ma->adapt_thresh_tra = 0.005f; - ma->dist_mir = 0.0f; - ma->fadeto_mir = MA_RAYMIR_FADETOSKY; + if (ma->gloss_mir == 0.0f) { + ma->gloss_mir = 1.0f; } - - if (ma->strand_min == 0.0f) - ma->strand_min = 1.0f; } for (part = main->particle.first; part; part = part->id.next) { @@ -2431,26 +2142,13 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main) part->ren_child_nbr = part->child_nbr; } - for (wrld = main->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) { if (sce->nodetree) ntree_version_245(fd, lib, sce->nodetree); - if (sce->r.simplify_shadowsamples == 0) { + if (sce->r.simplify_subsurf == 0) { sce->r.simplify_subsurf = 6; sce->r.simplify_particles = 1.0f; - sce->r.simplify_shadowsamples = 16; - sce->r.simplify_aosss = 1.0f; - } - - if (sce->r.cineongamma == 0) { - sce->r.cineonblack = 95; - sce->r.cineonwhite = 685; - sce->r.cineongamma = 1.7f; } } @@ -2730,16 +2428,6 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main) } } } - if ((main->versionfile < 245) || (main->versionfile == 245 && main->subversionfile < 9)) { - Material *ma; - int a; - - for (ma = main->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)) { Object *ob; @@ -2851,14 +2539,6 @@ 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; - for (; la; la = la->id.next) { - la->skyblendtype = MA_RAMP_ADD; - la->skyblendfac = 1.0f; - } - } - /* set the curve radius interpolation to 2.47 default - easy */ if (main->versionfile < 247 || (main->versionfile == 247 && main->subversionfile < 6)) { Curve *cu; @@ -2882,33 +2562,6 @@ 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; - for (; la; la = la->id.next) { - la->sky_exposure = 1.0f; - } - } - - if (main->versionfile < 248) { - Lamp *la; - - for (la = main->lamp.first; la; la = la->id.next) { - if (la->atm_turbidity == 0.0f) { - la->sun_effect_type = 0; - la->horizon_brightness = 1.0f; - la->spread = 1.0f; - la->sun_brightness = 1.0f; - la->sun_size = 1.0f; - la->backscattered_light = 1.0f; - la->atm_turbidity = 2.0f; - la->atm_inscattering_factor = 1.0f; - la->atm_extinction_factor = 1.0f; - la->atm_distance_factor = 1.0f; - la->sun_intensity = 1.0f; - } - } - } - if (main->versionfile < 248 || (main->versionfile == 248 && main->subversionfile < 2)) { Scene *sce; diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index ab71676b3df..7722013fbbf 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -2277,24 +2277,6 @@ static void write_texture(WriteData *wd, Tex *tex) if (tex->coba) { writestruct(wd, DATA, ColorBand, 1, tex->coba); } - if (tex->type == TEX_ENVMAP && tex->env) { - writestruct(wd, DATA, EnvMap, 1, tex->env); - } - if (tex->type == TEX_POINTDENSITY && tex->pd) { - writestruct(wd, DATA, PointDensity, 1, tex->pd); - if (tex->pd->coba) { - writestruct(wd, DATA, ColorBand, 1, tex->pd->coba); - } - if (tex->pd->falloff_curve) { - write_curvemapping(wd, tex->pd->falloff_curve); - } - } - if (tex->type == TEX_VOXELDATA) { - writestruct(wd, DATA, VoxelData, 1, tex->vd); - } - if (tex->type == TEX_OCEAN && tex->ot) { - writestruct(wd, DATA, OceanTex, 1, tex->ot); - } /* nodetree is integral part of texture, no libdata */ if (tex->nodetree) { @@ -2317,19 +2299,6 @@ static void write_material(WriteData *wd, Material *ma) write_animdata(wd, ma->adt); } - for (int a = 0; a < MAX_MTEX; a++) { - if (ma->mtex[a]) { - writestruct(wd, DATA, MTex, 1, ma->mtex[a]); - } - } - - if (ma->ramp_col) { - writestruct(wd, DATA, ColorBand, 1, ma->ramp_col); - } - if (ma->ramp_spec) { - writestruct(wd, DATA, ColorBand, 1, ma->ramp_spec); - } - /* nodetree is integral part of material, no libdata */ if (ma->nodetree) { writestruct(wd, DATA, bNodeTree, 1, ma->nodetree); @@ -2351,12 +2320,6 @@ static void write_world(WriteData *wd, World *wrld) write_animdata(wd, wrld->adt); } - for (int a = 0; a < MAX_MTEX; a++) { - if (wrld->mtex[a]) { - writestruct(wd, DATA, MTex, 1, wrld->mtex[a]); - } - } - /* nodetree is integral part of world, no libdata */ if (wrld->nodetree) { writestruct(wd, DATA, bNodeTree, 1, wrld->nodetree); @@ -2378,13 +2341,6 @@ static void write_lamp(WriteData *wd, Lamp *la) write_animdata(wd, la->adt); } - /* direct data */ - for (int a = 0; a < MAX_MTEX; a++) { - if (la->mtex[a]) { - writestruct(wd, DATA, MTex, 1, la->mtex[a]); - } - } - if (la->curfalloff) { write_curvemapping(wd, la->curfalloff); } |