# MeshPreview

> Use this class to render an interactive preview of a mesh.

## Definition

* **Type:** Class
* **Namespace:** [UnityEditor](/engine/6000.7/script-reference/unityeditor.md)
* **Assembly:** UnityEditor.CoreModule
* **Implements:** [IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable)

```csharp
public class MeshPreview : IDisposable
```

## Remarks

Use this class from an [ObjectPreview](/engine/6000.7/script-reference/unityeditor/objectpreview.md) or [Editor.OnPreviewGUI](/engine/6000.7/script-reference/unityeditor/editor/onpreviewgui.md) to render an interactive mesh preview.

## Constructors

| Constructor                                                                                      | Description                                                                                                                                                                 |
| ------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [MeshPreview(UnityEngine.Mesh)](/engine/6000.7/script-reference/unityeditor/meshpreview/ctor.md) | Creates a new [MeshPreview](/engine/6000.7/script-reference/unityeditor/meshpreview.md) instance with a [Mesh](/engine/6000.7/script-reference/unityengine/mesh.md) target. |

## Properties

| Property                                                                | Description                                                                                      |
| ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
| [mesh](/engine/6000.7/script-reference/unityeditor/meshpreview/mesh.md) | The [Mesh](/engine/6000.7/script-reference/unityengine/mesh.md) to display in the preview space. |

## Methods

| Method                                                                                                | Description                                                                                                                                                                                                                                                                                        |
| ----------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Dispose](/engine/6000.7/script-reference/unityeditor/meshpreview/dispose.md)                         | Releases allocated resources associated with this object.                                                                                                                                                                                                                                          |
| [OnPreviewGUI](/engine/6000.7/script-reference/unityeditor/meshpreview/onpreviewgui.md)               | Call this from an [Editor.OnPreviewGUI](/engine/6000.7/script-reference/unityeditor/editor/onpreviewgui.md) or [ObjectPreview.OnPreviewGUI](/engine/6000.7/script-reference/unityeditor/objectpreview/onpreviewgui.md) to draw a mesh preview.                                                     |
| [OnPreviewSettings](/engine/6000.7/script-reference/unityeditor/meshpreview/onpreviewsettings.md)     | Call this from [Editor.OnPreviewSettings()](/engine/6000.7/script-reference/unityeditor/editor/onpreviewsettings.md) or [ObjectPreview.OnPreviewSettings](/engine/6000.7/script-reference/unityeditor/objectpreview/onpreviewsettings.md) to draw additional settings related to the mesh preview. |
| [RenderStaticPreview](/engine/6000.7/script-reference/unityeditor/meshpreview/renderstaticpreview.md) | Creates a texture preview to override [Editor.RenderStaticPreview](/engine/6000.7/script-reference/unityeditor/editor/renderstaticpreview.md). The current [MeshPreview.mesh](/engine/6000.7/script-reference/unityeditor/meshpreview/mesh.md) will be drawn.                                      |

## Static Methods

| Method                                                                                    | Description                                                                                                                                                              |
| ----------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [GetInfoString](/engine/6000.7/script-reference/unityeditor/meshpreview/getinfostring.md) | Returns a short summary of the [Mesh](/engine/6000.7/script-reference/unityengine/mesh.md) attributes (ex, does this mesh contain positions, normals, tangents, etc...). |
