]> git.tdb.fi Git - libs/gl.git/blobdiff - blender/io_mspgl/export_texture.py
Load textures in a type-generic way
[libs/gl.git] / blender / io_mspgl / export_texture.py
index 7661b90b2fa5e1d91c5ba0410689904d29681bdb..3d21cd1a796a77d540cda19ff72ba39179509ea6 100644 (file)
@@ -29,14 +29,16 @@ class TextureExporter:
        def export_texture(self, tex_node, usage='RGB', *, invert_green=False):
                image = tex_node.image
                from .datafile import Resource, Statement, Token
-               tex_res = Resource(image.name+".tex2d", "texture2d")
+               tex_res = Resource(image.name+".tex", "texture")
+
+               tex_res.statements.append(Statement("type", Token("\\2d")))
 
                if tex_node.use_mipmap:
                        tex_res.statements.append(Statement("generate_mipmap", True))
 
                colorspace = image.colorspace_settings.name
                if usage=='GRAY' and colorspace=='sRGB':
-                               raise Exception("Grayscale textures with sRGB colorspace are not supported")
+                       raise Exception("Unsupported configuration on texture {}: Grayscale with sRGB".format(image.name))
 
                from .util import basename
                fn = basename(image.filepath)