mirror of
https://github.com/lucaspalomodevelop/meshlab.git
synced 2026-03-13 00:07:24 +00:00
fix #1387, can import gltf point clouds
This commit is contained in:
parent
c42c5ecdd8
commit
4c321e19dc
@ -504,7 +504,7 @@ bool loadAttribute(
|
||||
else { //if the attribute is triangle indices
|
||||
|
||||
//if the mode is GL_TRIANGLES and we have triangle indices
|
||||
if (p.mode == 4 && p.indices >= 0 &&
|
||||
if (p.mode == TINYGLTF_MODE_TRIANGLES && p.indices >= 0 &&
|
||||
(unsigned int)p.indices < model.accessors.size()) {
|
||||
accessor = &model.accessors[p.indices];
|
||||
}
|
||||
@ -577,9 +577,12 @@ bool loadAttribute(
|
||||
//the mesh is not indexed, and triplets of contiguous vertices
|
||||
//generate triangles
|
||||
else if (attr == INDICES) {
|
||||
//this case is managed when passing nullptr as data
|
||||
populateAttr<unsigned char>(attr, m, ivp, nullptr, 0, 0);
|
||||
attrLoaded = true;
|
||||
// avoid explicitly the point clouds
|
||||
if (p.mode != TINYGLTF_MODE_POINTS) {
|
||||
//this case is managed when passing nullptr as data
|
||||
populateAttr<unsigned char>(attr, m, ivp, nullptr, 0, 0);
|
||||
attrLoaded = true;
|
||||
}
|
||||
}
|
||||
return attrLoaded;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user