From 9424311c650a397d604d2de4e90aeeac5c008043 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Thu, 10 Jul 2014 19:13:09 -0400 Subject: [PATCH] Improve UV extraction --- korman/exporter/mesh.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/korman/exporter/mesh.py b/korman/exporter/mesh.py index 4fa7552..76edb23 100644 --- a/korman/exporter/mesh.py +++ b/korman/exporter/mesh.py @@ -152,11 +152,8 @@ class MeshConverter: # Convert to per-material indices for j in tessface.vertices: # Unpack the UV coordinates from each UV Texture layer - uvws = [] - for uvtex in mesh.tessface_uv_textures: - uv = getattr(uvtex.data[i], "uv{}".format(j+1)) - # In Blender, UVs have no Z coordinate - uvws.append((uv.x, uv.y)) + # NOTE: Blender has no third (W) coordinate + uvws = [(uvtex.data[j].uv.x, uvtex.data[j].uv.y) for uvtex in mesh.uv_layers] # Grab VCols (TODO--defaulting to white for now) # This will be finalized once the vertex color light code baking is in