Now saving RGBA TGAs instead of Grayscale+Alpha because the Windows version of SL doesn't like those.
This commit is contained in:
parent
8525b1dee8
commit
3327051521
2 changed files with 5 additions and 6 deletions
|
@ -15,7 +15,7 @@ def writeTGA(width, height, bitsPerColor, bitsPerPixel, data, path):
|
|||
header = struct.pack(FORMAT,
|
||||
0, # Offset
|
||||
0, # ColorType
|
||||
3, # ImageType
|
||||
2, # ImageType
|
||||
0, # PaletteStart
|
||||
0, # PaletteLen
|
||||
bitsPerColor, # PalBits
|
||||
|
|
|
@ -191,15 +191,14 @@ class TexturePainter:
|
|||
|
||||
arr = bytearray(buf)
|
||||
|
||||
del arr[0::4]
|
||||
del arr[0::3]
|
||||
|
||||
if not self.debugGrid:
|
||||
arr[0::2] = itertools.repeat(255, self.gridConfig.imageSize[0] * self.gridConfig.imageSize[1])
|
||||
arr[0::4] = itertools.repeat(255, self.gridConfig.imageSize[0] * self.gridConfig.imageSize[1])
|
||||
arr[1::4] = itertools.repeat(255, self.gridConfig.imageSize[0] * self.gridConfig.imageSize[1])
|
||||
arr[2::4] = itertools.repeat(255, self.gridConfig.imageSize[0] * self.gridConfig.imageSize[1])
|
||||
|
||||
targetPath = os.path.join(OUTPUT_DIR, self.outputName + ".tga")
|
||||
|
||||
TGAWriter.writeTGA(self.gridConfig.imageSize[0], self.gridConfig.imageSize[1], 8, 16, arr, targetPath)
|
||||
TGAWriter.writeTGA(self.gridConfig.imageSize[0], self.gridConfig.imageSize[1], 8, 32, arr, targetPath)
|
||||
|
||||
def init(self, args):
|
||||
imageSizeX = int(math.floor(args[2] * args[0]))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue