I have a script that changes automatically the splatmap of a terrain.
I would like to be able to undo the changes made by this script through the Unity undo system.
I ran into a similar issue with trying to record undo on my terrain’s TerrainData before modifying the heights. For my issue, I found that the Undo.RegisterCompleteObjectUndo function worked, so maybe try that?
Still looking for an answer on this one. Registering the terrain data should work since the splat map, like the height map, is part of the terrain data; but it doesn’t. Has to be a bug.
In the meantime, I guess you have to just implement your own solution. Save the splat map before changing it and create a button that reloads the saved map when you press it.