]> git.tdb.fi Git - libs/gl.git/blobdiff - blender/io_mspgl/util.py
Implement material maps for exporting objects with multiple materials
[libs/gl.git] / blender / io_mspgl / util.py
index 7e932df382791007e3151beff6d4cc41bf5301ad..70b005f6df60e84db38ea8c35c03fc0bbcc79123 100644 (file)
@@ -52,6 +52,18 @@ class Progress:
                        self.last = value
 
 
+def linear_to_srgb(l):
+       if l<0.0031308:
+               return 12.92*l
+       else:
+               return 1.055*(l**(1/2.4))-0.055
+
+def get_colormap(srgb):
+       if srgb:
+               return linear_to_srgb
+       else:
+               return lambda x: x
+
 def image_name(img):
        fp = img.filepath
        if fp: