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
if key.mipmap:
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:
compression = plBitmap.kPNGCompression
elif "DDS" in allowed_formats:
compression = plBitmap.kDirectXCompression
dxt = plBitmap.kDXT5 if key.use_alpha or key.calc_alpha else plBitmap.kDXT1
elif "JPG" in allowed_formats:
compression = plBitmap.kJPEGCompression
elif "BMP" in allowed_formats:
compression = plBitmap.kUncompressed
else:
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
helper = GLTexture(key)

Loading…
Cancel
Save