From 997660d430b6341a78a613d07916d76425a5ea6e Mon Sep 17 00:00:00 2001 From: raveenajain Date: Thu, 31 Jan 2019 13:50:17 -0800 Subject: [PATCH] review changes --- libraries/fbx/src/GLTFSerializer.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/libraries/fbx/src/GLTFSerializer.cpp b/libraries/fbx/src/GLTFSerializer.cpp index c2fdc4f0bd..01e3cce560 100755 --- a/libraries/fbx/src/GLTFSerializer.cpp +++ b/libraries/fbx/src/GLTFSerializer.cpp @@ -843,14 +843,9 @@ bool GLTFSerializer::buildGeometry(HFMModel& hfmModel, const QUrl& url) { qWarning(modelformat) << "There was a problem reading glTF COLOR_0 data for model " << _url; continue; } - if (accessor.type == 3) { - for (int n = 0; n < colors.size(); n = n + 4) { - mesh.colors.push_back(glm::vec3(colors[n], colors[n + 1], colors[n + 2])); - } - } else { - for (int n = 0; n < colors.size(); n = n + 3) { - mesh.colors.push_back(glm::vec3(colors[n], colors[n + 1], colors[n + 2])); - } + int stride = (accessor.type == GLTFAccessorType::VEC4) ? 4 : 3; + for (int n = 0; n < colors.size() - 3; n += stride) { + mesh.colors.push_back(glm::vec3(colors[n], colors[n + 1], colors[n + 2])); } } else if (key == "TEXCOORD_0") { QVector texcoords;