From 59548afa487165d730a17eb5f75426e0bb83952a Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Thu, 19 Nov 2020 17:40:32 +0100 Subject: [PATCH] import ply supports uint type for edge properties vertex1 and vertex2 --- wrap/io_trimesh/import_ply.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/wrap/io_trimesh/import_ply.h b/wrap/io_trimesh/import_ply.h index f8d955c4..d94dc5fa 100644 --- a/wrap/io_trimesh/import_ply.h +++ b/wrap/io_trimesh/import_ply.h @@ -254,10 +254,12 @@ public: static const PropDescriptor &EdgeDesc(int i) { - static const PropDescriptor qf[2]= + static const PropDescriptor qf[4]= { - {"edge","vertex1", ply::T_INT, ply::T_INT, offsetof(LoadPly_EdgeAux,v1), 0,0,0,0,0 ,0}, - {"edge","vertex2", ply::T_INT, ply::T_INT, offsetof(LoadPly_EdgeAux,v2), 0,0,0,0,0 ,0}, + {"edge","vertex1", ply::T_INT, ply::T_INT, offsetof(LoadPly_EdgeAux,v1), 0,0,0,0,0 ,0}, + {"edge","vertex2", ply::T_INT, ply::T_INT, offsetof(LoadPly_EdgeAux,v2), 0,0,0,0,0 ,0}, + {"edge","vertex1", ply::T_UINT, ply::T_INT, offsetof(LoadPly_EdgeAux,v1), 0,0,0,0,0 ,0}, + {"edge","vertex2", ply::T_UINT, ply::T_INT, offsetof(LoadPly_EdgeAux,v2), 0,0,0,0,0 ,0}, }; return qf[i]; } @@ -452,7 +454,8 @@ public: } // Optional flag descriptors - if(pf.AddToRead(EdgeDesc(0) )!= -1 && pf.AddToRead(EdgeDesc(1)) != -1 ) + if((pf.AddToRead(EdgeDesc(0) )!= -1 || pf.AddToRead(EdgeDesc(2) )!= -1) && + (pf.AddToRead(EdgeDesc(1)) != -1 || pf.AddToRead(EdgeDesc(3)) != -1)) pi.mask |= Mask::IOM_EDGEINDEX; if(vcg::tri::HasPerVertexFlags(m) && pf.AddToRead(VertDesc(3))!=-1 )