From 0bda2863601b1a04e5dc7a2f1625b0f3b02c37ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9verin=20Lemaignan?= Date: Wed, 17 Oct 2012 12:06:12 +0200 Subject: [PATCH] [pyassimp] sample.py: only iterate on existing texture coords --- port/PyAssimp/scripts/sample.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/port/PyAssimp/scripts/sample.py b/port/PyAssimp/scripts/sample.py index 3788bd065..5e439e39a 100755 --- a/port/PyAssimp/scripts/sample.py +++ b/port/PyAssimp/scripts/sample.py @@ -50,12 +50,11 @@ def main(filename=None): else: print " no normals" print " colors:", len(mesh.colors) - tc = mesh.texturecoords - if tc: - print " texture-coords 1:", len(tc[0]), "first3:", tc[0][:3] - print " texture-coords 2:", len(tc[1]), "first3:", tc[1][:3] - print " texture-coords 3:", len(tc[2]), "first3:", tc[2][:3] - print " texture-coords 4:", len(tc[3]), "first3:", tc[3][:3] + tcs = mesh.texturecoords + if tcs: + for index, tc in enumerate(tcs): + print " texture-coords "+ str(index) + ":", len(tcs[index]), "first3:", tcs[index][:3] + else: print " no texture coordinates" print " uv-component-count:", len(mesh.numuvcomponents)