-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix GLTF File load #165
base: master
Are you sure you want to change the base?
Fix GLTF File load #165
Conversation
@@ -110,7 +130,7 @@ export async function loadDaeAsync({ | |||
async function loadFileContentsAsync(loader, uri, funcName): Promise<any> { | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 )