[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [12096] trunk/blender/source/blender: * Fix for old files loading up with gloss = 0.0 and gloss samples = 0.
Matt Ebb
matt at mke3.net
Thu Sep 20 07:56:58 CEST 2007
Revision: 12096
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=12096
Author: broken
Date: 2007-09-20 07:56:57 +0200 (Thu, 20 Sep 2007)
Log Message:
-----------
* Fix for old files loading up with gloss = 0.0 and gloss samples = 0.
I blame the 2.45 version-raising!
Modified Paths:
--------------
trunk/blender/source/blender/blenloader/intern/readfile.c
trunk/blender/source/blender/src/buttons_shading.c
Modified: trunk/blender/source/blender/blenloader/intern/readfile.c
===================================================================
--- trunk/blender/source/blender/blenloader/intern/readfile.c 2007-09-19 23:50:46 UTC (rev 12095)
+++ trunk/blender/source/blender/blenloader/intern/readfile.c 2007-09-20 05:56:57 UTC (rev 12096)
@@ -6648,15 +6648,6 @@
}
}
- for(ma=main->mat.first; ma; ma= ma->id.next) {
- ma->gloss_mir = ma->gloss_tra= 1.0;
- ma->aniso_gloss_mir = 1.0;
- ma->samp_gloss_mir = ma->samp_gloss_tra= 18;
- ma->adapt_thresh_mir = ma->adapt_thresh_tra = 0.005;
- ma->dist_mir = 0.0;
- ma->fadeto_mir = MA_RAYMIR_FADETOSKY;
- }
-
for(wrld=main->world.first; wrld; wrld= wrld->id.next) {
if (wrld->mode & WO_AMB_OCC)
wrld->ao_samp_method = WO_AOSAMP_CONSTANT;
@@ -6677,22 +6668,11 @@
}
}
if(main->versionfile <= 245) {
- Lamp *la;
- 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->curfalloff = curvemapping_add(1, 0.0f, 1.0f, 1.0f, 0.0f);
- curvemapping_initialize(la->curfalloff);
- }
- }
- }
-
- if (main->versionfile <= 245) {
bScreen *sc;
Image* ima;
-
+ Lamp *la;
+ Material *ma;
+
/* fix all versions before 2.45 */
if (main->versionfile != 245) {
@@ -6745,7 +6725,30 @@
}
}
}
-
+
+ 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;
+
+ if (la->curfalloff == NULL) {
+ la->curfalloff = curvemapping_add(1, 0.0f, 1.0f, 1.0f, 0.0f);
+ curvemapping_initialize(la->curfalloff);
+ }
+ }
+ }
+
+ for(ma=main->mat.first; ma; ma= ma->id.next) {
+ if (ma->samp_gloss_mir == 0) {
+ ma->gloss_mir = ma->gloss_tra= 1.0;
+ ma->aniso_gloss_mir = 1.0;
+ ma->samp_gloss_mir = ma->samp_gloss_tra= 18;
+ ma->adapt_thresh_mir = ma->adapt_thresh_tra = 0.005;
+ ma->dist_mir = 0.0;
+ ma->fadeto_mir = MA_RAYMIR_FADETOSKY;
+ }
+ }
+
}
/* WATCH IT!!!: pointers from libdata have not been converted yet here! */
Modified: trunk/blender/source/blender/src/buttons_shading.c
===================================================================
--- trunk/blender/source/blender/src/buttons_shading.c 2007-09-19 23:50:46 UTC (rev 12095)
+++ trunk/blender/source/blender/src/buttons_shading.c 2007-09-20 05:56:57 UTC (rev 12096)
@@ -1361,7 +1361,7 @@
uiDefButF(block, NUM, B_TEXPRV, "Filter :", 10,65,150,20, &tex->filtersize, 0.1, 25.0, 0, 3, "Adjusts sharpness or blurriness of the reflection"),
uiDefButS(block, NUM, B_ENV_FREE, "Depth:", 160,65,150,20, &env->depth, 0, 5.0, 0, 0, "Sets the number of times a map will be rendered recursively mirror effects"),
uiDefButF(block, NUM, REDRAWVIEW3D, "ClipSta", 10,40,150,20, &env->clipsta, 0.01, 50.0, 100, 0, "Sets start value for clipping: objects nearer than this are not visible to map");
- uiDefButF(block, NUM, B_NOP, "ClipEnd", 160,40,150,20, &env->clipend, 0.1, 10000.0, 1000, 0, "Sets end value for clipping beyond which objects are not visible to map");
+ uiDefButF(block, NUM, B_NOP, "ClipEnd", 160,40,150,20, &env->clipend, 0.1, 20000.0, 1000, 0, "Sets end value for clipping beyond which objects are not visible to map");
uiBlockEndAlign(block);
uiDefBut(block, LABEL, 0, "Don't render layer:", 10,10,140,22, 0, 0.0, 0.0, 0, 0, "");
@@ -3324,7 +3324,7 @@
uiDefButF(block, NUMSLI, B_MATPRV, "Aniso: ",
X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->aniso_gloss_mir), 0.0, 1.0, 100, 0, "The shape of the reflection, from 0. (circular) to 1.0 (fully stretched along the tangent)");
uiDefButS(block, NUM, B_MATPRV, "Samples:",
- X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->samp_gloss_mir), 0.0, 1024.0, 100, 0, "Number of cone samples averaged for blurry reflections");
+ X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->samp_gloss_mir), 1.0, 1024.0, 100, 0, "Number of cone samples averaged for blurry reflections");
uiDefButF(block, NUM, B_MATPRV, "Thresh: ",
X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->adapt_thresh_mir), 0.0, 1.0, 100, 0, "Threshold for adaptive sampling. If a sample contributes less than this amount (as a percentage), sampling is stopped");
uiBlockEndAlign(block);
@@ -3925,7 +3925,7 @@
uiBlockBeginAlign(block);
uiDefButBitI(block, TOG, MA_HALO, B_MATHALO, "Halo", 10,50,100,19, &(ma->mode), 0, 0, 0, 0, "Renders material as a halo");
uiDefButBitI(block, TOG, MA_ZTRA, B_MATZTRANSP,"ZTransp", 110,50,100,19, &(ma->mode), 0, 0, 0, 0, "Enables Z-Buffering of transparent faces");
- uiDefButF(block, NUM, B_DIFF, "Zoffs:", 210,50,100,19, &(ma->zoffs), 0.0, 10.0, 100, 0, "Gives faces an artificial offset in the Z buffer for Ztransp option");
+ uiDefButF(block, NUM, B_DIFF, "Zoffs:", 210,50,100,19, &(ma->zoffs), 0.0, 100.0, 100, 0, "Gives faces an artificial offset in the Z buffer for Ztransp option");
uiDefButBitI(block, TOG, MA_FULL_OSA, 0, "Full Osa", 10,30,75,19, &(ma->mode), 0.0, 10.0, 0, 0, "Forces to render all OSA samples, for shading and texture antialiasing");
uiDefButBitI(block, TOG, MA_WIRE, B_MATPRV, "Wire", 85,30,75,19, &(ma->mode), 0, 0, 0, 0, "Renders only the edges of faces as a wireframe");
More information about the Bf-blender-cvs
mailing list