From cb9308761e05f766c2c66807d82870e348675e75 Mon Sep 17 00:00:00 2001 From: cignoni Date: Fri, 20 Jul 2007 14:49:46 +0000 Subject: [PATCH] Added in load mask the face color bit when there is a generic material used --- wrap/io_trimesh/import_obj.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wrap/io_trimesh/import_obj.h b/wrap/io_trimesh/import_obj.h index 2e7311f0..268c3ade 100644 --- a/wrap/io_trimesh/import_obj.h +++ b/wrap/io_trimesh/import_obj.h @@ -25,6 +25,9 @@ History $Log: not supported by cvs2svn $ +Revision 1.15 2007/07/05 14:47:04 cignoni +Added face coloring when there is a texture (and therefore a material) + Revision 1.14 2007/04/18 13:33:11 cignoni resolved issue related to the parsing of CR LF under *nixes @@ -773,6 +776,8 @@ static bool LoadMask(const char * filename, Info &oi) } else if(line[0]=='f') oi.numFaces++; + else + if(line[0]=='u' && line[1]=='s') bHasPerFaceColor = true; // there is a usematerial so add per face color } } oi.mask = 0; @@ -782,6 +787,7 @@ static bool LoadMask(const char * filename, Info &oi) // Usually if you have tex coords you also have materials oi.mask |= vcg::tri::io::Mask::IOM_FACECOLOR; } + if(bHasPerFaceColor) oi.mask |= vcg::tri::io::Mask::IOM_FACECOLOR; return true;