From be51ebfc80665943252eb7730098c1f4bbcf9e7d Mon Sep 17 00:00:00 2001 From: cignoni Date: Mon, 28 Jan 2008 14:45:07 +0000 Subject: [PATCH] missing check for the presence of optional stuff --- wrap/io_trimesh/import_dae.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/wrap/io_trimesh/import_dae.h b/wrap/io_trimesh/import_dae.h index ca7a6e81..df0bb44e 100644 --- a/wrap/io_trimesh/import_dae.h +++ b/wrap/io_trimesh/import_dae.h @@ -183,13 +183,14 @@ namespace io { assert(indvt + offset < m.vert.size()); m.face[ff].V(tt) = &(m.vert[indvt + offset]); - - WedgeNormalAttribute(m,face,wa.wn,wa.wnsrc,ff,jj + wa.offnm,tt); - if (ind_txt != -1) + if(tri::HasPerWedgeNormal(m)) + WedgeNormalAttribute(m,face,wa.wn,wa.wnsrc,ff,jj + wa.offnm,tt); + if(tri::HasPerWedgeTexCoord(m) && ind_txt != -1) { WedgeTextureAttribute(m,face,ind_txt,wa.wt,wa.wtsrc,ff,jj + wa.offtx,tt,wa.stride); } - WedgeColorAttribute(m,face,wa.wc,wa.wcsrc,ff,jj + wa.offcl,tt); + if(tri::HasPerWedgeColor(m)) + WedgeColorAttribute(m,face,wa.wc,wa.wcsrc,ff,jj + wa.offcl,tt); jj += nfcatt; }