Merge pull request #416 from HifiExperiments/model

Fix issues with glb urls
This commit is contained in:
kasenvr 2020-06-03 22:37:00 -04:00 committed by GitHub
commit ec9c584eaa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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];