expo-three
expo-three copied to clipboard
Fix GLTF File load
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 )
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... I still can share the rest of the code https://snack.expo.io/70V_Zrs_8 You will need to use it on your project and update package.json to use the correct dependencies
@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 or this https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/Duck
Getting this error: Unhandled promise rejection: Error: Creating blobs from 'ArrayBuffer' and 'ArrayBufferView' are not supported
I am guessing it depends on which gLTF export format you are using... I have only used files with embedded textures, but I am not sure which version you have used If they are not already available, have you tried opening the files you want with a gLTF compatible software (e.g. blender ), including the textures and exporting everything again as a single file with embedded textures?
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 )