Browse Source

Fix potential UnboundLocalError in texture export

pull/121/head
Adam Johnson 6 years ago
parent
commit
1e3f3faa0d
Signed by: Hoikas
GPG Key ID: 0B6515D6FF6F271E
  1. 3
      korman/exporter/material.py

3
korman/exporter/material.py

@ -692,18 +692,17 @@ class MaterialConverter:
allowed_formats = key.allowed_formats allowed_formats = key.allowed_formats
if key.mipmap: if key.mipmap:
compression = plBitmap.kDirectXCompression compression = plBitmap.kDirectXCompression
dxt = plBitmap.kDXT5 if key.use_alpha or key.calc_alpha else plBitmap.kDXT1
elif "PNG" in allowed_formats and self._mgr.getVer() == pvMoul: elif "PNG" in allowed_formats and self._mgr.getVer() == pvMoul:
compression = plBitmap.kPNGCompression compression = plBitmap.kPNGCompression
elif "DDS" in allowed_formats: elif "DDS" in allowed_formats:
compression = plBitmap.kDirectXCompression compression = plBitmap.kDirectXCompression
dxt = plBitmap.kDXT5 if key.use_alpha or key.calc_alpha else plBitmap.kDXT1
elif "JPG" in allowed_formats: elif "JPG" in allowed_formats:
compression = plBitmap.kJPEGCompression compression = plBitmap.kJPEGCompression
elif "BMP" in allowed_formats: elif "BMP" in allowed_formats:
compression = plBitmap.kUncompressed compression = plBitmap.kUncompressed
else: else:
raise RuntimeError(allowed_formats) raise RuntimeError(allowed_formats)
dxt = plBitmap.kDXT5 if key.use_alpha or key.calc_alpha else plBitmap.kDXT1
# Grab the image data from OpenGL and stuff it into the plBitmap # Grab the image data from OpenGL and stuff it into the plBitmap
helper = GLTexture(key) helper = GLTexture(key)

Loading…
Cancel
Save