Access Permissions to Grab a Space's GLB Mesh Directly from a Unity App

Hello,

I recently made a post that asked about getting a Space's GLB mesh via ADB, and learned that the mesh exists in the file system of the ML2 after the space is created at the path:

/sdcard/Android/data/com.magicleap.mappingtool/files

My current question is about access permissions. My goal is to be able to pull this mesh into my app automatically, if possible. When I attempt to access files in this directory or even the Downloads folder where the .glb is placed when exported from the Spaces app, I get access denied errors. I made sure to enable the android permissions for reading external storage. Is there a way to grab .glb meshes via a Unity application, or will I have to grab the meshes manually or move them around with ADB?

Thanks!

For android 10 and up, you have to request explicit read access for the file/directory if you use File Stream. Alternatively you can use Storage Access Framework to access the file. This can be done via an android plugin .

Here is an open source plugin that allows your app to import files through the native file browser:

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.