> For the complete documentation index, see [llms.txt](https://xreal.gitbook.io/nrsdk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://xreal.gitbook.io/nrsdk/v2.1.0/development/depth-mesh/use-meshes-in-the-editor.md).

# Use Meshes in the Editor

This page provides a method of saving a mesh as a file and using it in the Unity Editor.

When working on a depth-mesh-based feature, it can be time-consuming to deploy to the device every time you try or change something. For this reason, the NRSDK offers a rudimentary system to save meshes as files on the device and reuse them in the editor for better debugging.

## Save Mesh Files

The demo scene mesh contains a UI button Save Mesh which can save the current mesh data into .obj files in the device's file system.

![](https://1774958057-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIM2VX8TwuOpFaP0UDa6i%2Fuploads%2FABIKXjZc3GBTZgNWl7er%2Fimage.png?alt=media\&token=d3118116-142e-47f6-b2ff-d87bd6a940c1)

Every push of the button creates a new folder of mesh obj. It is a good idea to save multiple meshes as you scan around if you want to reproduce mesh updates in the Unity Editor.

You will find the files under *`Android/data/package_name/files/MeshSave/`.* Save them into your assets.

![](https://1774958057-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIM2VX8TwuOpFaP0UDa6i%2Fuploads%2FsvEjVcFmBDwjEPywDDLB%2Fimage.png?alt=media\&token=0c09bd06-2ed6-4746-b997-74ff6cd18c96)

## Import Meshes into Unity

In your Unity scene hierarchy, create an empty `GameObject` called “Meshes”. The goal of that object will be to load saved meshes in the editor and test mesh-related logic without deploying to a device.

Then copy/paste the mesh files to a folder in the scene’s file hierarchy.

Drag the mesh obj to the Meshes directory

<figure><img src="https://1774958057-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIM2VX8TwuOpFaP0UDa6i%2Fuploads%2Fkt9VXGHmmZWFOmy0SDMG%2Fimage.png?alt=media&amp;token=a1afa7e2-f031-44c7-8e52-3630e06bffbf" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://xreal.gitbook.io/nrsdk/v2.1.0/development/depth-mesh/use-meshes-in-the-editor.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `build a script that syncs our docs to a CMS` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
