fixed bug on empty mesh
This commit is contained in:
parent
d91bb25e52
commit
0f827e0e78
|
@ -167,7 +167,8 @@ namespace io {
|
|||
valueStringList(face,tripatch.at(tript),"p");
|
||||
int face_size = face.size();
|
||||
int offsetface = (int)m.face.size();
|
||||
if (face_size == 0) return E_NOMESH;
|
||||
if (face_size != 0)
|
||||
{
|
||||
vcg::tri::Allocator<OpenMeshType>::AddFaces(m,face_size / (nfcatt * 3));
|
||||
WedgeAttribute wa;
|
||||
FindStandardWedgeAttributes(wa,tripatch.at(tript),*(info->dae->doc));
|
||||
|
@ -196,6 +197,7 @@ namespace io {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return E_NOERROR;
|
||||
}
|
||||
|
||||
|
@ -304,7 +306,8 @@ namespace io {
|
|||
else
|
||||
if (polylist_size != 0)
|
||||
err = LoadPolygonalListMesh(polylist,m,offset,info);
|
||||
if (err != E_NOERROR) return err;
|
||||
if (err != E_NOERROR)
|
||||
return err;
|
||||
}
|
||||
return E_NOERROR;
|
||||
}
|
||||
|
@ -353,6 +356,8 @@ namespace io {
|
|||
if (scn_size == 0)
|
||||
return E_NO3DSCENE;
|
||||
|
||||
int problem = E_NOERROR;
|
||||
bool found_a_mesh = false;
|
||||
//Is there geometry in the file?
|
||||
bool geoinst_found = false;
|
||||
//for each scene in COLLADA FILE
|
||||
|
@ -377,7 +382,6 @@ namespace io {
|
|||
QDomNodeList visscn_child = visscn.childNodes();
|
||||
|
||||
//for each direct child of a libscn_url visual scene find if there is some geometry instance
|
||||
int problem = 0;
|
||||
for(int chdind = 0; chdind < visscn_child.size();++chdind)
|
||||
{
|
||||
QDomNodeList geoinst = visscn_child.at(chdind).toElement().elementsByTagName("instance_geometry");
|
||||
|
@ -389,7 +393,6 @@ namespace io {
|
|||
QDomNodeList geolib = inf->dae->doc->elementsByTagName("library_geometries");
|
||||
assert(geolib.size() == 1);
|
||||
//!!!!!!!!!!!!!!!!!here will be the code for geometry transformations!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
for(int geoinst_ind = 0;geoinst_ind < geoinst_size;++geoinst_ind)
|
||||
{
|
||||
QString geo_url;
|
||||
|
@ -402,10 +405,16 @@ namespace io {
|
|||
tr.SetIdentity();
|
||||
TransfMatrix(visscn,geoinst.at(geoinst_ind),tr);
|
||||
problem |= LoadMesh(m,inf,geo,tr);
|
||||
if (problem) return problem;
|
||||
if (problem & E_NOMESH)
|
||||
found_a_mesh |= false;
|
||||
else
|
||||
found_a_mesh = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
//if there is at least a mesh I clean the problem status variable from E_NOMESH ERROR
|
||||
if ((problem & E_NOMESH) && (found_a_mesh))
|
||||
problem = problem & ~E_NOMESH;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -421,11 +430,13 @@ namespace io {
|
|||
vcg::Matrix44f tmp;
|
||||
tmp.SetIdentity();
|
||||
problem |= LoadMesh(m,inf,geochild.at(chd),tmp);
|
||||
if (problem) return problem;
|
||||
}
|
||||
}
|
||||
//if there is at least a mesh I clean the problem status variable from E_NOMESH ERROR
|
||||
if ((problem & E_NOMESH) && (found_a_mesh))
|
||||
problem = problem & ~E_NOMESH;
|
||||
info = inf;
|
||||
return E_NOERROR;
|
||||
return problem;
|
||||
}
|
||||
|
||||
static bool LoadMask(const char * filename, AdditionalInfoDAE*& addinfo)
|
||||
|
|
Loading…
Reference in New Issue