Adding support for "vertex_index" property to the ply decoder.

The old decoder expected "vertex_indices" for the face list property.
This commit is contained in:
Ondrej Stava 2017-01-13 14:28:10 -08:00
parent 6da5d81b21
commit a58a08b7a0

View File

@ -86,8 +86,12 @@ bool PlyDecoder::DecodeFaceData(const PlyElement *face_element) {
}
const int64_t num_faces = face_element->num_entries();
out_mesh_->SetNumFaces(num_faces);
const PlyProperty *const vertex_indices =
const PlyProperty *vertex_indices =
face_element->GetPropertyByName("vertex_indices");
if (vertex_indices == nullptr) {
// The property name may be named either "vertex_indices" or "vertex_index".
vertex_indices = face_element->GetPropertyByName("vertex_index");
}
if (vertex_indices == nullptr || !vertex_indices->is_list()) {
return false; // No faces defined.
}