"GUI Error: Invalid GUILayout state in OdinEditorWindow view. Verify that all layout Begin/End calls match" Exception when opening foldout group

Issue #878 new
Benjamin Levy created an issue
  1. Unity outputs exception “GUI Error: Invalid GUILayout state in OdinEditorWindow view. Verify that all layout Begin/End calls match” (full stack trace attached)
  2. Opening a foldout group for a field on an element in an array in an Odin Editor Window.

    1. Scriptable Object asset is opened using Sirenix.OdinInspector.Editor.OdinEditorWindow.InspectObject(Selection.activeObject);

      1. Scriptable Object has an array of serializable elements. The array has the following attributes:

        [TableList(HideToolbar = false, ShowPaging = true)] [Searchable(Recursive = false)] [ListDrawerSettings(DraggableItems = false)] [OnCollectionChanged.. [ValidateInput..

    2. One of the fields on one of these serializable elements with an InlineEditorAttribute is expanded (as shown by arrow in screenshot below)

      1. Field has the following attributes:

        [InlineEditor] [TableColumnWidth(500)] 2. Field is class that extends a Scriptable Object with many other fields in it. Fields have many Odin attributes and many are also Serializable classes that contain many Odin attributes on their fields:

        [InlineProperty] [HideLabel] [ValueDropdown.. [CustomContextMenu.. [ShowIf.. [ValidateInput.. [HorizontalGroup.. [EnableIf.. [MinMaxSlider..

  3. Screenshots:

    1. Screenshot for 2. b.

4. 2021.3.7f1

5. 3.1.3.0 (was also reproduced on 3.0.13)

6. No

7. Windows 10 Pro

Comments (1)

  1. Benjamin Levy reporter

    Note: this exception only occurs in the OdinEditorWindow, when performing the same steps in a regular Unity Inspector window, no exception occurs when expanding the Foldout Group associated with that [InlineEditor] attribute.

  2. Log in to comment