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
- Out-of-bounds memory access with multiple CanvasRenderers under a Canvas when using Mesh API
- Inspector tries to access file after it was deleted when the file was locked in Inspector window
- Changing Transform values in Search window Inspector loses focus while dragging and stopping mouse without releasing dragging action
- Saving changes on the dirty VFX Graph during the Play mode throws "The referenced script (Unknown) on this Behaviour is missing!" warnings
- VFX Graph Debug Info overlaps the "Initialize" block debug info by default
Add comment