Forum rules - please read before posting.

[Bug] Broken Layout Exception

Sometimes, I seem to get ArgumentException: GUILayout: Mismatched LayoutGroup.Repain on actionlist editor. It seems to be absolutely random, but the worst part is that when I get this error entire actionList ends up deleted. Which sometimes can be a severe data loss. The last time I got it, was At ActionSpeech.cs 313 on EditorGUILayout.BeginHorizontal (); This might be an extremely tricky bug, but avoiding at least data loss would be nice.


Comments

  • In what version of Unity?  What were you doing at the time?  Can you share steps to reproduce?
  • I'm currently using Unity 5.6.6. It's quite random. I selected multiple actions and copied them, since I wanted to move them to another actionList. Then the error popped and actions were deleted in the current list. I did Ctrl+Z. That reversed the delete. Then copied them in exactly the same manner and it worked fine. I don't think this will be reasonably reproducible, probably the only way is to catch stuff related to gui drawing, and power through/ignore the errors, so that gui draw errors don't affect the serialization functionality.
  • I'm glad to hear you were able to recover the removed Actions.

    That the Ctrl-Z worked to "bring back" the removed Actions suggests that they weren't "lost" - but instead removed as a result of either the ActionList Editor's "Cut selected" or "Delete selected" callbacks being triggered.  Unity requires explicit calls to the Undo feature to remember things, so Ctrl-Z wouldn't work unless that code was run.

    Unless you mistakenly chose "cut" instead of "copy", I can't see how this would have occured - and the "Repaint" issue hasn't affected serialization in my experience.

    The "Copy" and "Cut" callbacks did share some similar code, however, so as a safeguard I've separated them.  It may well be that this issue lies more with Unity, but we'll have to see.
  • This error repeated once more. Once again Ctrl+z restored lost display, but this time I can dump error code for future reference. 4 console errors in total:

    ArgumentException: GUILayout: Mismatched LayoutGroup.Repaint
    UnityEngine.GUILayoutUtility.BeginLayoutGroup (UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options, System.Type layoutType) (at C:/buildslave/unity/build/Runtime/IMGUI/Managed/GUILayoutUtility.cs:301)
    UnityEditor.EditorGUILayout.BeginHorizontal (UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:7259)
    UnityEditor.EditorGUILayout.BeginHorizontal (UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:7239)
    AC.ActionSpeech.ShowGUI (System.Collections.Generic.List`1 parameters) (at Assets/AdventureCreator/Scripts/Actions/ActionSpeech.cs:313)
    AC.ActionListEditorWindow.NodeWindow (Int32 i) (at Assets/AdventureCreator/Scripts/ActionList/Editor/ActionListEditorWindow.cs:656)
    UnityEngine.GUILayout+LayoutedWindow.DoWindow (Int32 windowID) (at C:/buildslave/unity/build/Runtime/IMGUI/Managed/GUILayout.cs:497)
    UnityEngine.GUI.CallWindowDelegate (UnityEngine.WindowFunction func, Int32 id, Int32 instanceID, UnityEngine.GUISkin _skin, Int32 forceRect, Single width, Single height, UnityEngine.GUIStyle style) (at C:/buildslave/unity/build/Runtime/IMGUI/Managed/GUI.cs:1817)
    UnityEditor.EditorWindow:EndWindows()
    AC.ActionListEditorWindow:NodesGUI(Boolean) (at Assets/AdventureCreator/Scripts/ActionList/Editor/ActionListEditorWindow.cs:1045)
    AC.ActionListEditorWindow:OnGUI() (at Assets/AdventureCreator/Scripts/ActionList/Editor/ActionListEditorWindow.cs:339)
    UnityEditor.DockArea:OnGUI()



    ArgumentException: Getting control 7's position in a group with only 7 controls when doing Repaint
    Aborting
    UnityEngine.GUILayoutGroup.GetNext () (at C:/buildslave/unity/build/Runtime/IMGUI/Managed/LayoutGroup.cs:115)
    UnityEngine.GUILayoutUtility.DoGetRect (Single minWidth, Single maxWidth, Single minHeight, Single maxHeight, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Runtime/IMGUI/Managed/GUILayoutUtility.cs:454)
    UnityEngine.GUILayoutUtility.GetRect (Single minWidth, Single maxWidth, Single minHeight, Single maxHeight, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Runtime/IMGUI/Managed/GUILayoutUtility.cs:443)
    UnityEditor.EditorGUILayout.GetToggleRect (Boolean hasLabel, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:7620)
    UnityEditor.EditorGUILayout.Toggle (UnityEngine.GUIContent label, Boolean value, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:5720)
    UnityEditor.EditorGUILayout.Toggle (System.String label, Boolean value, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:5714)
    AC.ActionTeleport.ShowGUI (System.Collections.Generic.List`1 parameters) (at Assets/AdventureCreator/Scripts/Actions/ActionTeleport.cs:273)
    AC.ActionListEditorWindow.NodeWindow (Int32 i) (at Assets/AdventureCreator/Scripts/ActionList/Editor/ActionListEditorWindow.cs:656)
    UnityEngine.GUILayout+LayoutedWindow.DoWindow (Int32 windowID) (at C:/buildslave/unity/build/Runtime/IMGUI/Managed/GUILayout.cs:497)
    UnityEngine.GUI.CallWindowDelegate (UnityEngine.WindowFunction func, Int32 id, Int32 instanceID, UnityEngine.GUISkin _skin, Int32 forceRect, Single width, Single height, UnityEngine.GUIStyle style) (at C:/buildslave/unity/build/Runtime/IMGUI/Managed/GUI.cs:1817)
    UnityEditor.EditorWindow:EndWindows()
    AC.ActionListEditorWindow:NodesGUI(Boolean) (at Assets/AdventureCreator/Scripts/ActionList/Editor/ActionListEditorWindow.cs:1045)
    AC.ActionListEditorWindow:OnGUI() (at Assets/AdventureCreator/Scripts/ActionList/Editor/ActionListEditorWindow.cs:339)
    UnityEditor.DockArea:OnGUI()


    ArgumentException: Getting control 7's position in a group with only 7 controls when doing Repaint
    Aborting
    UnityEngine.GUILayoutGroup.GetNext () (at C:/buildslave/unity/build/Runtime/IMGUI/Managed/LayoutGroup.cs:115)
    UnityEngine.GUILayoutUtility.DoGetRect (Single minWidth, Single maxWidth, Single minHeight, Single maxHeight, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Runtime/IMGUI/Managed/GUILayoutUtility.cs:454)
    UnityEngine.GUILayoutUtility.GetRect (Single width, Single height) (at C:/buildslave/unity/build/Runtime/IMGUI/Managed/GUILayoutUtility.cs:422)
    UnityEditor.EditorGUILayout.Space () (at C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:7154)
    AC.Action.AfterRunningOption () (at Assets/AdventureCreator/Scripts/ActionList/Action.cs:170)
    AC.ActionFade.ShowGUI (System.Collections.Generic.List`1 parameters) (at Assets/AdventureCreator/Scripts/Actions/ActionFade.cs:153)
    AC.ActionListEditorWindow.NodeWindow (Int32 i) (at Assets/AdventureCreator/Scripts/ActionList/Editor/ActionListEditorWindow.cs:656)
    UnityEngine.GUILayout+LayoutedWindow.DoWindow (Int32 windowID) (at C:/buildslave/unity/build/Runtime/IMGUI/Managed/GUILayout.cs:497)
    UnityEngine.GUI.CallWindowDelegate (UnityEngine.WindowFunction func, Int32 id, Int32 instanceID, UnityEngine.GUISkin _skin, Int32 forceRect, Single width, Single height, UnityEngine.GUIStyle style) (at C:/buildslave/unity/build/Runtime/IMGUI/Managed/GUI.cs:1817)
    UnityEditor.EditorWindow:EndWindows()
    AC.ActionListEditorWindow:NodesGUI(Boolean) (at Assets/AdventureCreator/Scripts/ActionList/Editor/ActionListEditorWindow.cs:1045)
    AC.ActionListEditorWindow:OnGUI() (at Assets/AdventureCreator/Scripts/ActionList/Editor/ActionListEditorWindow.cs:339)
    UnityEditor.DockArea:OnGUI()



    ArgumentException: GUILayout: Mismatched LayoutGroup.Repaint
    UnityEngine.GUILayoutUtility.BeginLayoutGroup (UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options, System.Type layoutType) (at C:/buildslave/unity/build/Runtime/IMGUI/Managed/GUILayoutUtility.cs:301)
    UnityEditor.EditorGUILayout.BeginHorizontal (UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:7259)
    UnityEditor.EditorGUILayout.BeginHorizontal (UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:7239)
    AC.Action.SkipActionGUI (System.Collections.Generic.List`1 actions, Boolean showGUI) (at Assets/AdventureCreator/Scripts/ActionList/Action.cs:236)
    AC.ActionListEditorWindow.NodeWindow (Int32 i) (at Assets/AdventureCreator/Scripts/ActionList/Editor/ActionListEditorWindow.cs:667)
    UnityEngine.GUILayout+LayoutedWindow.DoWindow (Int32 windowID) (at C:/buildslave/unity/build/Runtime/IMGUI/Managed/GUILayout.cs:497)
    UnityEngine.GUI.CallWindowDelegate (UnityEngine.WindowFunction func, Int32 id, Int32 instanceID, UnityEngine.GUISkin _skin, Int32 forceRect, Single width, Single height, UnityEngine.GUIStyle style) (at C:/buildslave/unity/build/Runtime/IMGUI/Managed/GUI.cs:1817)
    UnityEditor.EditorWindow:EndWindows()
    AC.ActionListEditorWindow:NodesGUI(Boolean) (at Assets/AdventureCreator/Scripts/ActionList/Editor/ActionListEditorWindow.cs:1045)
    AC.ActionListEditorWindow:OnGUI() (at Assets/AdventureCreator/Scripts/ActionList/Editor/ActionListEditorWindow.cs:339)
    UnityEditor.DockArea:OnGUI()

    1. In what version of AC and Unity?
    2. What were you doing at the time?  As with last time, I can't see how you'd be able to CtrlZ unless you were cutting/deleting them.
    3. Did all 4 errors show up at the same time?
    4. Even if the same as before, please be clear about the result of the errors on the ActionList
  • 1. Unity 5.6.6f2, AC 1.63.0
    2. I was copying actions, I had multiple scenes open in editor, since I wanted to copy a group of actions from one to another.
    3. Yes, all errors appeared at the same moment
    4. I copied actions. Errors popped and actionList editor window started showing default actionList editor window, with only one default starting action. I pressed ctrl+z and old actions reappeared. I didn't get to test the functionality of action list after the errors, but another possibility may be, that behind the curtains actionList is fine and no data is lost, but failing drawings simply result in default empty actionList representation in actionList editor window. If this happens on an actionList that isn't that complex and data loss would be negligible, I'll try running that actionList and see whether it executes as before or whether it's actually empty.
  • Thanks for the details.  It is worth mentioning that some issues related to the ActionList Editor's "Undo" system were addressed in v1.63.2.

    To be clear: this was a scene-based ActionList?
  • Yes, it was a scene based actionlist.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.