Search Issue Tracker
Won't Fix
Votes
0
Found in
5.3.1f1
Issue ID
788317
Regression
No
Undo.RecordObject is very slow for terrains
Edit before closing: Undo.RecordObject will perform a binary exact comparison between states of the object you are monitoring to find and record what changes are made to the object. In the case of TerrainData, which contains large arrays (e.g. the height map), this approach is rather inefficient. We suggest you use Undo.RegisterCompleteObjectUndo instead, which will only create a 'snapshot' of the TerrainData, and won't do the comparison. It's much faster.
Steps to reproduce:
1. Open attached project "788317.zip"
2. Open scene "repro"
3. In top menu, select "Window > Reset Terrain"
4. Notice that height of terrain is reset but Unity becomes unresponsive
5. Unity hangs for several minutes
Workaround: Use now obsolete Undo.RegisterUndo
Reproduced with: 5.1.4f1, 5.2.4f1, 5.3.4p3, 5.4.0b15
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- “Remove Unused Overrides” available on not loaded Scene and throws “ArgumentException: The scene is not loaded” warning
- Adaptive Probe Volume occlusion edge is calculated incorrectly when viewing probes near geometry edges
- Sampling a texture using an HLSL file throws shader errors and the code does not compile
- "Graphics.CopyTexture called with null source texture" error when Base Camera of an Overlay Camera is removed with DX11 Graphics API and Compatibility Mode enabled
- WebGL sends wrong value with large numbers when SendMessage function is used
Add comment