fix issues with glb urls

This commit is contained in:
HifiExperiments 2020-06-03 15:19:54 -07:00
parent 079c0c022e
commit ade6bf24bb

View file

@ -437,7 +437,7 @@ bool GLTFSerializer::addBuffer(const QJsonObject& object) {
getIntVal(object, "byteLength", buffer.byteLength, buffer.defined);
if (_url.toString().endsWith("glb")) {
if (_url.path().endsWith("glb")) {
if (!_glbBinary.isEmpty()) {
buffer.blob = _glbBinary;
} else {
@ -677,7 +677,7 @@ bool GLTFSerializer::parseGLTF(const hifi::ByteArray& data) {
hifi::ByteArray jsonChunk = data;
if (_url.toString().endsWith("glb") && data.indexOf("glTF") == 0 && data.contains("JSON")) {
if (_url.path().endsWith("glb") && data.indexOf("glTF") == 0 && data.contains("JSON")) {
jsonChunk = setGLBChunks(data);
}
@ -1686,7 +1686,7 @@ HFMTexture GLTFSerializer::getHFMTexture(const GLTFTexture& texture) {
fbxtex.name = fname;
fbxtex.filename = textureUrl.toEncoded();
if (_url.toString().endsWith("glb") && !_glbBinary.isEmpty()) {
if (_url.path().endsWith("glb") && !_glbBinary.isEmpty()) {
int bufferView = _file.images[texture.source].bufferView;
GLTFBufferView& imagesBufferview = _file.bufferviews[bufferView];