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
path: root/source
diff options
context:
space:
mode:
authorMatt Ebb <matt@mke3.net>2010-01-19 05:47:44 +0300
committerMatt Ebb <matt@mke3.net>2010-01-19 05:47:44 +0300
commitb34a0fd18ad1476ba655c1c2aa84abb3d5384166 (patch)
treea23ee363898413152f90ff10316cc152e923deca /source
parent2fa3baf30b3ea1b6c681517efb4b122c2a512175 (diff)
Partial fix for issues in [#20564] Color Management/Linear Workflow not taken into
account in Preview Render anymore?
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenloader/intern/readfile.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 3bb94ecf169..8975dcd4c67 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -10136,7 +10136,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
Scene *sce=main->scene.first;
Material *ma=main->mat.first;
World *wo=main->world.first;
- int convert=0;
+ Tex *tex=main->tex.first;
+ int i, convert=0;
/* convert to new color management system:
while previously colors were stored as srgb,
@@ -10152,6 +10153,21 @@ static void do_versions(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);
@@ -10159,6 +10175,17 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
ma=ma->id.next;
}
+ while(tex) {
+ if (tex->coba) {
+ ColorBand *band = (ColorBand *)tex->coba;
+ for (i=0; i<band->tot; i++) {
+ CBData *data = band->data + i;
+ srgb_to_linearrgb_v3_v3(&data->r, &data->r);
+ }
+ }
+ tex=tex->id.next;
+ }
+
while(wo) {
srgb_to_linearrgb_v3_v3(&wo->ambr, &wo->ambr);
srgb_to_linearrgb_v3_v3(&wo->horr, &wo->horr);