From 4001b5aa3403d8529f60c14368feddc201004ca6 Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Fri, 2 Apr 2021 10:16:02 +0200 Subject: [PATCH] small refactor --- wrap/io_trimesh/io_ply.h | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/wrap/io_trimesh/io_ply.h b/wrap/io_trimesh/io_ply.h index d939d610..39144305 100644 --- a/wrap/io_trimesh/io_ply.h +++ b/wrap/io_trimesh/io_ply.h @@ -73,21 +73,20 @@ public: if(propName=="") propName=attrName; + PropDescriptor p; + p.propname=propName; + p.stotype1 = propertyType; + p.memtype1 = propertyType; + if (elemType == 0){ //vertex - VertDescriptorVec.push_back(PropDescriptor()); VertAttrNameVec.push_back(attrName); - VertDescriptorVec.back().elemname="vertex"; - VertDescriptorVec.back().propname=propName; - VertDescriptorVec.back().stotype1 = propertyType; - VertDescriptorVec.back().memtype1 = propertyType; + p.elemname="vertex"; + VertDescriptorVec.push_back(p); } else if (elemType == 1){ //face - FaceDescriptorVec.push_back(PropDescriptor()); FaceAttrNameVec.push_back(attrName); - FaceDescriptorVec.back().elemname="face"; - FaceDescriptorVec.back().propname=propName; - FaceDescriptorVec.back().stotype1 = propertyType; - FaceDescriptorVec.back().memtype1 = propertyType; + p.elemname="face"; + FaceDescriptorVec.push_back(p); } } @@ -117,7 +116,6 @@ public: AddPerElemFloatAttribute(1,attrName,propName); } - /* Note that saving a per vertex point3 attribute is a mess. * Actually require to allocate 3 float attribute and save them. And they are never deallocated... */ template