From 07e73f7792fe3a0c4c6cd7c6bedcb6e80ce9a364 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Sat, 25 Aug 2018 12:44:21 -0400 Subject: [PATCH] Fix export crash introduced by #110 If there were no lightmapping passes, the `max()` call would raise a ValueError. --- korman/exporter/etlight.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/korman/exporter/etlight.py b/korman/exporter/etlight.py index f9da6d6..c95daaa 100644 --- a/korman/exporter/etlight.py +++ b/korman/exporter/etlight.py @@ -106,7 +106,10 @@ class LightBaker(_MeshManager): # Lightmap passes are expensive, so we will warn about any passes that seem # particularly wasteful. - largest_pass = max((len(value) for key, value in bake.items() if key[0] != "vcol")) + try: + largest_pass = max((len(value) for key, value in bake.items() if key[0] != "vcol")) + except ValueError: + largest_pass = 0 # Step 0.9: Make all layers visible. # This prevents context operators from phailing.