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:
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/readfile.c19
-rw-r--r--source/blender/blenloader/intern/writefile.c5
2 files changed, 20 insertions, 4 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 0723b8175fc..361ac3666a0 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -1920,7 +1920,11 @@ static void direct_link_material(FileData *fd, Material *ma)
for(a=0; a<8; a++) {
ma->mtex[a]= newdataadr(fd, ma->mtex[a]);
}
- ma->ren= 0; /* should not be needed, nevertheless... */
+
+ ma->ramp_col= newdataadr(fd, ma->ramp_col);
+ ma->ramp_spec= newdataadr(fd, ma->ramp_spec);
+
+ ma->ren= NULL; /* should not be needed, nevertheless... */
}
/* ************ READ MESH ***************** */
@@ -4229,8 +4233,17 @@ static void do_versions(Main *main)
}
}
-
-
+ if(main->versionfile <= 233) {
+ Material *ma= main->mat.first;
+
+ while(ma) {
+ if(ma->rampfac_col==0.0) ma->rampfac_col= 1.0;
+ if(ma->rampfac_spec==0.0) ma->rampfac_spec= 1.0;
+ if(ma->pr_lamp==0) ma->pr_lamp= 3;
+ ma= ma->id.next;
+ }
+ }
+
/* don't forget to set version number in blender.c! */
}
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 32249c1c46b..d1d66ae2e63 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -912,7 +912,10 @@ static void write_materials(WriteData *wd, ListBase *idbase)
for(a=0; a<8; 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);
+
write_scriptlink(wd, &ma->scriptlink);
}
ma= ma->id.next;