# TerrainPaintUtility

> A set of utility functions for custom terrain paint tools.

## Definition

* **Type:** Class
* **Namespace:** [UnityEngine.TerrainTools](/engine/6000.3/script-reference/unityengine/terraintools.md)
* **Assembly:** UnityEngine.TerrainModule

```csharp
public static class TerrainPaintUtility
```

## Static Methods

| Method                                                                                                                                                                       | Description                                                                                                           |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| [BeginPaintHeightmap](/engine/6000.3/script-reference/unityengine/terraintools/terrainpaintutility/beginpaintheightmap.md)                                                   | Helper function to set up a PaintContext for modifying the heightmap of one or more Terrain tiles.                    |
| [BeginPaintHoles](/engine/6000.3/script-reference/unityengine/terraintools/terrainpaintutility/beginpaintholes.md)                                                           | Helper function to set up a PaintContext for modifying the Terrain holes of one or more Terrain tiles.                |
| [BeginPaintTexture](/engine/6000.3/script-reference/unityengine/terraintools/terrainpaintutility/beginpainttexture.md)                                                       | Helper function to set up a PaintContext for modifying the alphamap of one or more Terrain tiles.                     |
| [BuildTransformPaintContextUVToPaintContextUV](/engine/6000.3/script-reference/unityengine/terraintools/terrainpaintutility/buildtransformpaintcontextuvtopaintcontextuv.md) | Builds a Scale & Offset transform to convert between one PaintContext's UV space and another PaintContext's UV space. |
| [CalculateBrushTransform](/engine/6000.3/script-reference/unityengine/terraintools/terrainpaintutility/calculatebrushtransform.md)                                           | Creates a BrushTransform from the input parameters.                                                                   |
| [CollectNormals](/engine/6000.3/script-reference/unityengine/terraintools/terrainpaintutility/collectnormals.md)                                                             | Helper function to set up a PaintContext that collects mesh normal data from one or more Terrain tiles.               |
| [EndPaintHeightmap](/engine/6000.3/script-reference/unityengine/terraintools/terrainpaintutility/endpaintheightmap.md)                                                       | Helper function to complete a heightmap modification.                                                                 |
| [EndPaintHoles](/engine/6000.3/script-reference/unityengine/terraintools/terrainpaintutility/endpaintholes.md)                                                               | Helper function to complete a Terrain holes modification.                                                             |
| [EndPaintTexture](/engine/6000.3/script-reference/unityengine/terraintools/terrainpaintutility/endpainttexture.md)                                                           | Helper function to complete a texture alphamap modification.                                                          |
| [FindTerrainLayerIndex](/engine/6000.3/script-reference/unityengine/terraintools/terrainpaintutility/findterrainlayerindex.md)                                               | Finds the index of a TerrainLayer in a Terrain tile.                                                                  |
| [GetBlitMaterial](/engine/6000.3/script-reference/unityengine/terraintools/terrainpaintutility/getblitmaterial.md)                                                           | Returns the default material for blitting operations.                                                                 |
| [GetBrushWorldSizeLimits](/engine/6000.3/script-reference/unityengine/terraintools/terrainpaintutility/getbrushworldsizelimits.md)                                           | Calculates the minimum and maximum Brush size limits, in world space.                                                 |
| [GetBuiltinPaintMaterial](/engine/6000.3/script-reference/unityengine/terraintools/terrainpaintutility/getbuiltinpaintmaterial.md)                                           | Returns the built-in in paint material used by the built-in tools.                                                    |
| [GetCopyTerrainLayerMaterial](/engine/6000.3/script-reference/unityengine/terraintools/terrainpaintutility/getcopyterrainlayermaterial.md)                                   | Returns the default copy terrain layer material.                                                                      |
| [GetHeightBlitMaterial](/engine/6000.3/script-reference/unityengine/terraintools/terrainpaintutility/getheightblitmaterial.md)                                               | Returns the Material to use when copying the Terrain heightmap.                                                       |
| [GetTerrainAlphaMapChecked](/engine/6000.3/script-reference/unityengine/terraintools/terrainpaintutility/getterrainalphamapchecked.md)                                       | Returns the alphamap texture at mapIndex.                                                                             |
| [ReleaseContextResources](/engine/6000.3/script-reference/unityengine/terraintools/terrainpaintutility/releasecontextresources.md)                                           | Releases the allocated resources of the specified PaintContext.                                                       |
| [SetupTerrainToolMaterialProperties](/engine/6000.3/script-reference/unityengine/terraintools/terrainpaintutility/setupterraintoolmaterialproperties.md)                     | Sets up all of the material properties used by functions in TerrainTool.cginc.                                        |
