Conversation
| try { | ||
| const fileContents = await readAsStringAsync(uri); | ||
| return loader.parse(fileContents); | ||
| return new Promise((res, rej) => loader.parse(fileContents, uri, res, rej)); |
There was a problem hiding this comment.
GLTFLoader parse from three.js does not return anything, it just calls the res & rej functions when done...
This might affect others loaders included, but i did not test them
|
Hi Giorgio, first of all thank you so much for working on this issue. I've been trying to use the forked package to load gltf models but couldn't make it work, all packages seem to be installed well but I still can't read the models. Do you perhaps have a working example with the expo bare workflow, it would really be helpful. Thanks |
|
Snack is using yarn so I am not able to include the correct github module version from my repo... |
|
@giorgioma thank you so much, that's awesome. The package is working with the gltf model in the example, just had to add an atob function. Still couldn't manage to make it work with textures like in this case https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/Avocado Getting this error: |
|
I am guessing it depends on which gLTF export format you are using... Just a note: for loading subsequent files (e.g. external textures described inside the gLTF file) some extra work might be done (I am quite sure the external textures in the file includes only a partial/local URL, not a full url pointing to the github repo that you are using for the example, so the files you are trying to load are not found locally from your packager ) |
Hi! I was unable to load any glTF files on my bare workflow expo app (I did not try on managed workflow), so I made a fix, i am now able to load common files
I tested with a couple of glTF files provided by Khronos )