How to load a remote obj file with ExpoTHREE?


Hi I am trying to use Poly API ( with Expo Three. How do you load a remote obj file? Is it a combination of FileSystem.downloadAsync and ExpoTHREE.loadAsync? I have the filesystem part down, but I don’t know how to use the returned uri (file:///var/mobile/Containers/Data/Application/…/Documents/ExponentExperienceData/…/model.obj) with ExpoTHREE.loadAsync since it needs a require(something) for the third argument.

Here is my source to get a better idea:

ExpoTHREE.loadAsync partially works with remote urls. The model loaded but it was all black.
const mesh = await ExpoTHREE.loadAsync( [ objFormat.root.url, => resource.url) ], this.handleLocalDownload );

I was able to load a remote obj file with color using the simplest way.
var urlOBJ = objFormat.root.url; var urlMTL = objFormat.resources[0].url; var mtlloader = new THREE.MTLLoader(); mtlloader.load( urlMTL, mats => { var objloader = new THREE.OBJLoader(); objloader.setMaterials(mats); objloader.load( urlOBJ, mesh => { this.addCustomDestination({ mesh }); this.setState({ polySelection: { mesh }, showDownloadProgress: false }); }, this.handleLocalDownload ); }, this.handleLocalDownload );