Skip to content
This repository has been archived by the owner on Oct 20, 2020. It is now read-only.

Fix gltf loading #1006

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

samylan
Copy link

@samylan samylan commented Dec 31, 2018

When a glTF file is loaded directly from a server, outside any zip/gz archive, it is treated as text file instead of being parsed correctly as a JSON. Images are sometimes also not loaded correctly when loaded from loadImages() because fileloader.requestURI() would confuse it for a type 'arraybuffer'.

The error I get with gltf :
Unhandled rejection ReaderWriterGLTF.prototype.loadBuffers<@webpack:///./sources/osgPlugins/ReaderWriterGLTF.js?:251:25 r@http://localhost:9000/node_modules/bluebird/js/browser/bluebird.min.js:31:9667 [19]</e.exports/e.method/<@http://localhost:9000/node_modules/bluebird/js/browser/bluebird.min.js:30:4044 ReaderWriterGLTF.prototype.readJSON<@webpack:///./sources/osgPlugins/ReaderWriterGLTF.js?:1007:70 r@http://localhost:9000/node_modules/bluebird/js/browser/bluebird.min.js:31:9667 [19]</e.exports/e.method/<@http://localhost:9000/node_modules/bluebird/js/browser/bluebird.min.js:30:4044 readNodeURL/<@webpack:///./sources/osgPlugins/ReaderWriterGLTF.js?:1000:20 r@http://localhost:9000/node_modules/bluebird/js/browser/bluebird.min.js:31:9667 [22]</e.exports/i.prototype._settlePromiseFromHandler@http://localhost:9000/node_modules/bluebird/js/browser/bluebird.min.js:30:14825 [22]</e.exports/i.prototype._settlePromise@http://localhost:9000/node_modules/bluebird/js/browser/bluebird.min.js:30:15628 [22]</e.exports/i.prototype._settlePromise0@http://localhost:9000/node_modules/bluebird/js/browser/bluebird.min.js:30:16329 [22]</e.exports/i.prototype._settlePromises@http://localhost:9000/node_modules/bluebird/js/browser/bluebird.min.js:30:17684 c@http://localhost:9000/node_modules/bluebird/js/browser/bluebird.min.js:29:1555 a@http://localhost:9000/node_modules/bluebird/js/browser/bluebird.min.js:29:1496 [2]</r.prototype._drainQueues@http://localhost:9000/node_modules/bluebird/js/browser/bluebird.min.js:29:3106 r/this.drainQueues@http://localhost:9000/node_modules/bluebird/js/browser/bluebird.min.js:29:1236

The test case, to put in the "examples" folder
test-gltf-loading.zip

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant