Browse Source

Fix CubeMap Bug

* Adds a sanity check that raises an error if a CubeMap doesn't have an image.
pull/374/head
Patrick Dulebohn 2 years ago
parent
commit
695674f8e5
  1. 5
      korman/exporter/material.py

5
korman/exporter/material.py

@ -701,6 +701,9 @@ class MaterialConverter:
layer.texture = pl_env.key
def export_cubic_env(self, bo, layer, texture):
if texture.image == None:
raise ExportError("CubeMap '{}' has no cube image!".format(texture.name))
else:
width, height = texture.image.size
# Sanity check: the image here should be 3x2 faces, so we should not have any
@ -719,7 +722,7 @@ class MaterialConverter:
# to a big "finalize" save step to prevent races. The texture cache would
# prevent that as well, so we could theoretically slice-and-dice the single
# image here... but... meh. Offloading taim.
self.export_prepared_image(texture=texture, owner=layer,
self.export_prepared_image(texture=texture, owner=layer, indent=3,
alpha_type=TextureAlpha.opaque, mipmap=True,
allowed_formats={"DDS"}, is_cube_map=True, tag="cubemap")

Loading…
Cancel
Save