]> git.tdb.fi Git - libs/gl.git/blobdiff - blender/io_mspgl/util.py
Always export texture data inline if there's no image file
[libs/gl.git] / blender / io_mspgl / util.py
index 7e932df382791007e3151beff6d4cc41bf5301ad..6e8ec7746bde7c41b5c4791dfca602d7dd65503b 100644 (file)
@@ -1,5 +1,3 @@
-import os
-
 class Progress:
        def __init__(self, context):
                self.task = ""
@@ -52,9 +50,14 @@ class Progress:
                        self.last = value
 
 
-def image_name(img):
-       fp = img.filepath
-       if fp:
-               return os.path.split(fp)[1]
+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 img.name
+               return lambda x: x