From 1dfaace9b1bb1ac976b0d3801501b7a20a3ac71c Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Mon, 15 Feb 2016 18:44:05 -0500 Subject: [PATCH] Don't arseplode if lightmaps are not baked --- korman/properties/modifiers/render.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/korman/properties/modifiers/render.py b/korman/properties/modifiers/render.py index 9d952c9..8ea7c5f 100644 --- a/korman/properties/modifiers/render.py +++ b/korman/properties/modifiers/render.py @@ -166,9 +166,14 @@ class PlasmaLightMapGen(PlasmaModifierProperties): description="UV Texture used as the basis for the lightmap") def export(self, exporter, bo, so): + lightmap_im = bpy.data.images.get("{}_LIGHTMAPGEN.png".format(bo.name)) + + # If no lightmap image is found, then either lightmap generation failed (error raised by oven) + # or baking is turned off. Either way, bail out. + if lightmap_im is None: + return mat_mgr = exporter.mesh.material materials = mat_mgr.get_materials(bo) - lightmap_im = bpy.data.images.get("{}_LIGHTMAPGEN.png".format(bo.name)) # Find the stupid UVTex uvw_src = 0