From 40a149964f086010c5720f7b60552622031d5e70 Mon Sep 17 00:00:00 2001 From: cignoni Date: Thu, 2 Oct 2008 21:46:29 +0000 Subject: [PATCH] made the absence of faces in a ply file a "non critical" error. --- wrap/io_trimesh/import_ply.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/wrap/io_trimesh/import_ply.h b/wrap/io_trimesh/import_ply.h index 0176099c..920107b2 100644 --- a/wrap/io_trimesh/import_ply.h +++ b/wrap/io_trimesh/import_ply.h @@ -383,6 +383,13 @@ static const char *ErrorMsg(int error) else return ply_error_msg[error].c_str(); }; +// to check if a given error is critical or not. +static bool ErrorCritical(int err) +{ + if(err == PlyInfo::E_NO_FACE) return false; + return true; +} + /// Standard call for reading a mesh static int Open( OpenMeshType &m, const char * filename, CallBackPos *cb=0) @@ -467,7 +474,10 @@ static int Open( OpenMeshType &m, const char * filename, PlyInfo &pi ) for(ii=0;ii< FaceVariantNum;++ii) if( pf.AddToRead(FaceDesc(9+ii))!=-1 ) break; if(ii==FaceVariantNum) if(pf.AddToRead(TristripDesc(0))==-1) // Se fallisce tutto si prova a vedere se ci sono tristrip alla levoy. - { pi.status = PlyInfo::E_NO_FACE; return pi.status; } + { + pi.status = PlyInfo::E_NO_FACE; + //return pi.status; no face is not a critical error. let's continue. + } } // Descrittori facoltativi dei flags