133place
0 votes Vote

Error when undo texture brush

When using texture brush, press ctrl + z undo throw errors:

Exception: Float array size wrong (layers should be 4)
UnityEngine.TerrainData.SetAlphamaps (System.Int32 x, System.Int32 y, System.Single[,,] map) (at :0)
MapMagic.Brush.Undo.TerrainUndoData.Write (UnityEngine.Terrain terrain) (at Assets/MapMagic/Brush/Core/UndoBac.cs:122)
MapMagic.Brush.Undo.Undo.Perform () (at Assets/MapMagic/Brush/Core/UndoBac.cs:260)
MapMagic.Brush.Undo.Undo.OnUndoRedoPerformed () (at Assets/MapMagic/Brush/Core/UndoBac.cs:188)

or

MissingReferenceException: The object of type 'Terrain' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
MapMagic.Brush.Undo.TerrainUndoData.Write (UnityEngine.Terrain terrain) (at Assets/MapMagic/Brush/Core/UndoBac.cs:100)
MapMagic.Brush.Undo.Undo.Perform () (at Assets/MapMagic/Brush/Core/UndoBac.cs:260)
MapMagic.Brush.Undo.Undo.OnUndoRedoPerformed () (at Assets/MapMagic/Brush/Core/UndoBac.cs:188)
UnityEditor.Undo.Internal_CallUndoRedoPerformed () (at :0)
UnityEditor.EditorApplication:Internal_CallGlobalEventHandler()

faintle, 17.12.2021, 13:28
Idea status: under consideration

Comments

faintle, 22.12.2021, 08:21
I mean a brush graph with texture output. Such as the provided Texture brush in your brush module, draw something on terrain and Undo, sometimes it works fine, but throw errors frequently. Thank you!

Leave a comment