From 9c4dea823562f05512045dee14467134557218e7 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Thu, 25 Jun 2015 19:12:17 -0400 Subject: [PATCH] Fix calculate alpha boogs --- korman/exporter/material.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/korman/exporter/material.py b/korman/exporter/material.py index 98ce223..7d36516 100644 --- a/korman/exporter/material.py +++ b/korman/exporter/material.py @@ -87,10 +87,9 @@ class _GLTexture: # NOTE: the variable names are correct for GL_RGBA. We'll still get the right values for # BGRA, obviously, but red will suddenly be... blue. Yeah. if calc_alpha: - for i in range(size, 4): - base = i*4 - r, g, b = buf[base:base+2] - buf[base+3] = int((r + g + b) / 3) + for i in range(0, size, 4): + r, g, b = buf[i:i+3] + buf[i+3] = int((r + g + b) / 3) return bytes(buf) def _get_integer(self, arg):