# Export textured mesh or point cloud of the scanned sapce from MagicLeap2

**URL:** <https://forum.magicleap.cloud/t/export-textured-mesh-or-point-cloud-of-the-scanned-sapce-from-magicleap2/2516>\
**Category:** Native Development\
**Tags:** spaces, spatial-mapping\
**Created:** [September 7, 2023, 3:14pm UTC](https://forum.magicleap.cloud/t/export-textured-mesh-or-point-cloud-of-the-scanned-sapce-from-magicleap2/2516 "2023-09-07T15:14:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![shayan](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@shayan](https://forum.magicleap.cloud/u/shayan)\
**Post date:** [September 7, 2023, 3:14pm UTC](https://forum.magicleap.cloud/t/export-textured-mesh-or-point-cloud-of-the-scanned-sapce-from-magicleap2/2516/1 "2023-09-07T15:14:56Z")

</div>

A MagicLeap beginner user here.

I want to export the scanned space from the local spaces. I could export the spatial map using ADB shell:  
`adb shell mlmapping -export_space “map name”` but it only exports a `*.map` file.  
How can I export the textured mesh as an `*.obj` or any other known format?

Also doing so using Unity SDK is fine.

```auto
MagicLeap Hub version: 2.0.14
sdk: v1.4.0-dev1
Version 1.3.0
Android API Level 29
Host OS: macOS

```

---

<div class="post-metadata">

**Author:** ![shayan](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@shayan](https://forum.magicleap.cloud/u/shayan)\
**Post date:** [September 7, 2023, 6:35pm UTC](https://forum.magicleap.cloud/t/export-textured-mesh-or-point-cloud-of-the-scanned-sapce-from-magicleap2/2516/2 "2023-09-07T18:35:22Z")

</div>

UPDATE: A raw mesh is also fine not necessarily textured.

---

<div class="post-metadata">

**Author:** ![etucker](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/etucker/32/842_2.png) [@etucker](https://forum.magicleap.cloud/u/etucker)\
**Post date:** [September 8, 2023, 8:11pm UTC](https://forum.magicleap.cloud/t/export-textured-mesh-or-point-cloud-of-the-scanned-sapce-from-magicleap2/2516/3 "2023-09-08T20:11:17Z")

</div>

Hi @shayan,

We do not have anything out of the box that will do this at the moment. If you use Unity, though, you can use [AssetDatabase.CreateAsset](http://docs.unity3d.com/ScriptReference/AssetDatabase.CreateAsset.html) with your mesh, and then save it with [AssetDatabase.SaveAssets()](http://docs.unity3d.com/ScriptReference/AssetDatabase.SaveAssets.html);

Let me know if this helps.

Best,

El

---

<div class="post-metadata">

**Author:** ![abhiazadz](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/abhiazadz/32/2141_2.png) [@abhiazadz](https://forum.magicleap.cloud/u/abhiazadz)\
**Post date:** [January 14, 2025, 9:17pm UTC](https://forum.magicleap.cloud/t/export-textured-mesh-or-point-cloud-of-the-scanned-sapce-from-magicleap2/2516/4 "2025-01-14T21:17:36Z")

</div>

@kbabilinski You suggested exporting the scanned space as a .glb file (Refer to this thread [Saving spatial anchors and using on another app - General - Magic Leap 2 Developer Forums](https://forum.magicleap.cloud/t/saving-spatial-anchors-and-using-on-another-app/4468/3))

But I don't have any options in the Spaces app to export anything, I just see option to rename, delete and scan a new space. Do you know how I can get the export option?

So, the only way I could download the scan was using the ADB commands on the Bash which gives me a .map and json file. I am not able to decode these files into a mesh. Can you please help me with a way around this problem?

---

<div class="post-metadata">

**Author:** ![etucker](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/etucker/32/842_2.png) [@etucker](https://forum.magicleap.cloud/u/etucker)\
**Post date:** [January 15, 2025, 6:11pm UTC](https://forum.magicleap.cloud/t/export-textured-mesh-or-point-cloud-of-the-scanned-sapce-from-magicleap2/2516/5 "2025-01-15T18:11:57Z")

</div>

Check out this solution from @aheaney.

> [@Exporting a Space's GLB Mesh as ADB Command](https://forum.magicleap.cloud/t/exporting-a-spaces-glb-mesh-as-adb-command/4090/4):
>
> Hello, The GLB files are created when you finish mapping a space. The export button in the Spaces app just copies the file for you. You can use the adb pull command to retrieve them from the Spaces app's data directory- /sdcard/Android/data/com.magicleap.mappingtool/files example - PS C:\spacetest\> adb shell demophon:/ $ mlmapping -spaces 2 space(s) found map id :{452403ec-f574-7018-aab0-1ae55e811991} map name :Local Space 2546 map file path :/data/misc/pwservice/m…

---

<div class="post-metadata">

**Author:** ![abhiazadz](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/abhiazadz/32/2141_2.png) [@abhiazadz](https://forum.magicleap.cloud/u/abhiazadz)\
**Post date:** [January 15, 2025, 8:59pm UTC](https://forum.magicleap.cloud/t/export-textured-mesh-or-point-cloud-of-the-scanned-sapce-from-magicleap2/2516/6 "2025-01-15T20:59:26Z")

</div>

@etucker Thanks but it doesnt really seem to work in my case. Look at my adb shell with the same commands, it doesn't really show me any traces of a glb file.

 ![image](https://us1.discourse-cdn.com/flex019/uploads/magicleap1/original/2X/c/c0ed58d987d5225aa1202cbec3c95a0ada35893b.png)

Do you think my MagicLeap Os needs an update or something? what is missing?

---

<div class="post-metadata">

**Author:** ![abhiazadz](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/abhiazadz/32/2141_2.png) [@abhiazadz](https://forum.magicleap.cloud/u/abhiazadz)\
**Post date:** [January 15, 2025, 9:21pm UTC](https://forum.magicleap.cloud/t/export-textured-mesh-or-point-cloud-of-the-scanned-sapce-from-magicleap2/2516/7 "2025-01-15T21:21:58Z")

</div>

I found this at the [Spaces – Care | Magic Leap](https://www.magicleap.care/hc/en-us/articles/10274604006285-Spaces) page

## Export a Space

Starting with Magic Leap OS 1.8.0, you can now export a mapped space to a .glb file. On the spaces list, select the three dots icon to find the export option. Exported files can be retrieved via [Magic Leap Hub](https://www.magicleap.care/hc/en-us/articles/5340945010573).

And its also mentioned in the 1.8.0 release notes: [1.8.0 OS Release Notes | MagicLeap Developer Documentation](https://developer-docs.magicleap.cloud/docs/releases/release-2024-july/os-release-notes/)

And my current os is 1.3.1, so I’m gonna try to update it to 1.8.0 and see if it works
