Run-time API for exporting textures from can be brought into scope with this using directive:
using AmazingAssets.TerrainTexturesExporter;
Now class will have TerrainTexturesExporter() extension with the following methods:
//Example of using TerrainTexturesExporter() extension and its methods
using UnityEngine;
using AmazingAssets.TerrainTexturesExporter;
public class ExampleScript : MonoBehaviour
{
public TerrainData terrainData;
void Start()
{
//Exporting Splatmaps
Texture2D[] splatmaps = terrainData.TerrainTexturesExporter().ExportSplatmapTextures();
//Exporting Heightmap
Texture2D heightmap = terrainData.TerrainTexturesExporter().ExportHeightmapTexture();
//Exporting Heightmap Normal
Texture2D heightmapNormal = terrainData.TerrainTexturesExporter().ExportHeightmapNormalTexture();
//Exporting Basemap textures with resolution 1024 and split in 4x4 array
Texture2D[] basemaps = terrainData.TerrainTexturesExporter().ExportBasemapDiffuseTexture(1024, false, 4, 4);
//Exporting tree objects placement map
Texture2D[] treePlacement = terrainData.TerrainTexturesExporter().ExportPrototypeDistributionMap(TerrainTexturesExporterEnum.Prototype.Tree, 1024, true);
}
}
If texture exporter methods are used in the run-time builds, make sure Terrain Textures Exporter shader is inside the Always Included Shaders array of the