]> git.tdb.fi Git - libs/gl.git/blob - blender/io_mspgl/export_texture.py
Move material and texture export to their own classes
[libs/gl.git] / blender / io_mspgl / export_texture.py
1 class TextureExporter:
2         def export_texture(self, texture):
3                 from .datafile import Resource, Statement, Token
4                 tex_res = Resource(texture.name+".tex2d")
5
6                 tex_res.statements.append(Statement("min_filter", Token("LINEAR")))
7                 tex_res.statements.append(Statement("storage", Token("RGBA"), texture.image.size[0], texture.image.size[1]))
8                 texdata = ""
9                 for p in texture.image.pixels:
10                         texdata += "\\x%02X"%int(p*255)
11                 tex_res.statements.append(Statement("raw_data", texdata))
12
13                 return tex_res