Exception raised on Inspector

Issue #292 resolved
William Besnard created an issue

Hi guys,

I ran into an exception while working on a custom class:

ArgumentException: Getting control 1's position in a group with only 1 controls when doing Repaint Aborting UnityEngine.GUILayoutGroup.GetNext () (at C:/buildslave/unity/build/Runtime/IMGUI/Managed/LayoutGroup.cs:115) UnityEngine.GUILayoutUtility.BeginLayoutGroup (UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options, System.Type layoutType) (at C:/buildslave/unity/build/Runtime/IMGUI/Managed/GUILayoutUtility.cs:299) UnityEngine.GUILayout.BeginHorizontal (UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Runtime/IMGUI/Managed/GUILayout.cs:306) UnityEngine.GUILayout.BeginHorizontal (UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Runtime/IMGUI/Managed/GUILayout.cs:293) Sirenix.Utilities.Editor.SirenixEditorGUI.BeginIndentedVertical (UnityEngine.GUILayoutOption[] options) (at D:/Sirenix/Sirenix Solution/Sirenix.Utilities.Editor/GUI/SirenixEditorGUI.cs:1302) Sirenix.OdinInspector.Editor.Drawers.CompositeDrawer.DrawPropertyImplementation (Sirenix.OdinInspector.Editor.InspectorProperty property, UnityEngine.GUIContent label) (at D:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Value Drawers/ColorDrawer.cs:72) Sirenix.OdinInspector.Editor.OdinDrawer.DrawProperty (Sirenix.OdinInspector.Editor.InspectorProperty property, UnityEngine.GUIContent label) Sirenix.OdinInspector.Editor.OdinDrawer.CallNextDrawer (Sirenix.OdinInspector.Editor.InspectorProperty property, UnityEngine.GUIContent label) (at D:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/PropertyTree.cs:81) Sirenix.OdinInspector.Editor.Drawers.NullableReferenceDrawer1[TagList].DrawPropertyLayout (IPropertyValueEntry1 entry, UnityEngine.GUIContent label) (at D:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Attribute Drawers/AssetListAttributeDrawer.cs:464) Sirenix.OdinInspector.Editor.OdinValueDrawer1[TagList].DrawProperty (IPropertyValueEntry1 entry, UnityEngine.GUIContent label) Sirenix.OdinInspector.Editor.OdinValueDrawer1[TagList].DrawPropertyImplementation (Sirenix.OdinInspector.Editor.InspectorProperty property, UnityEngine.GUIContent label) Sirenix.OdinInspector.Editor.OdinDrawer.DrawProperty (Sirenix.OdinInspector.Editor.InspectorProperty property, UnityEngine.GUIContent label) Sirenix.OdinInspector.Editor.OdinDrawer.CallNextDrawer (Sirenix.OdinInspector.Editor.InspectorProperty property, UnityEngine.GUIContent label) (at D:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/PropertyTree.cs:81) Sirenix.OdinInspector.Editor.Drawers.ReferenceValueConflictDrawer1[TagList].DrawPropertyLayout (IPropertyValueEntry1 entry, UnityEngine.GUIContent label) (at D:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Misc Drawers/PropertyContextMenuDrawer.cs:113) Sirenix.OdinInspector.Editor.OdinValueDrawer1[TagList].DrawProperty (IPropertyValueEntry1 entry, UnityEngine.GUIContent label) Sirenix.OdinInspector.Editor.OdinValueDrawer1[TagList].DrawPropertyImplementation (Sirenix.OdinInspector.Editor.InspectorProperty property, UnityEngine.GUIContent label) Sirenix.OdinInspector.Editor.OdinDrawer.DrawProperty (Sirenix.OdinInspector.Editor.InspectorProperty property, UnityEngine.GUIContent label) Sirenix.OdinInspector.Editor.OdinDrawer.CallNextDrawer (Sirenix.OdinInspector.Editor.InspectorProperty property, UnityEngine.GUIContent label) (at D:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/PropertyTree.cs:81) Sirenix.OdinInspector.Editor.Drawers.ReferencePathConflictDrawer1[TagList].DrawPropertyLayout (IPropertyValueEntry1 entry, UnityEngine.GUIContent label) (at D:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Misc Drawers/NullableReferenceDrawer.cs:148) Sirenix.OdinInspector.Editor.OdinValueDrawer1[TagList].DrawProperty (IPropertyValueEntry1 entry, UnityEngine.GUIContent label) Sirenix.OdinInspector.Editor.OdinValueDrawer1[TagList].DrawPropertyImplementation (Sirenix.OdinInspector.Editor.InspectorProperty property, UnityEngine.GUIContent label) Sirenix.OdinInspector.Editor.OdinDrawer.DrawProperty (Sirenix.OdinInspector.Editor.InspectorProperty property, UnityEngine.GUIContent label) Sirenix.OdinInspector.Editor.OdinDrawer.CallNextDrawer (Sirenix.OdinInspector.Editor.InspectorProperty property, UnityEngine.GUIContent label) (at D:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/PropertyTree.cs:81) Sirenix.OdinInspector.Editor.OdinDrawer.CallNextDrawer (IPropertyValueEntry entry, UnityEngine.GUIContent label) Sirenix.OdinInspector.Editor.Drawers.FixUnityNullDrawer1[TagList].DrawPropertyLayout (IPropertyValueEntry1 entry, UnityEngine.GUIContent label) (at D:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Infos/InspectorPropertyInfo.cs:556) Sirenix.OdinInspector.Editor.OdinValueDrawer1[TagList].DrawProperty (IPropertyValueEntry1 entry, UnityEngine.GUIContent label) Sirenix.OdinInspector.Editor.OdinValueDrawer1[TagList].DrawPropertyImplementation (Sirenix.OdinInspector.Editor.InspectorProperty property, UnityEngine.GUIContent label) Sirenix.OdinInspector.Editor.OdinDrawer.DrawProperty (Sirenix.OdinInspector.Editor.InspectorProperty property, UnityEngine.GUIContent label) Sirenix.OdinInspector.Editor.OdinDrawer.CallNextDrawer (Sirenix.OdinInspector.Editor.InspectorProperty property, UnityEngine.GUIContent label) (at D:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/PropertyTree.cs:81) Sirenix.OdinInspector.Editor.Drawers.ReferenceDrawer1[TagList].DrawPropertyLayout (IPropertyValueEntry1 entry, UnityEngine.GUIContent label) (at D:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Misc Drawers/NullableReferenceDrawer.cs:112) Sirenix.OdinInspector.Editor.OdinValueDrawer1[TagList].DrawProperty (IPropertyValueEntry1 entry, UnityEngine.GUIContent label) Sirenix.OdinInspector.Editor.OdinValueDrawer1[TagList].DrawPropertyImplementation (Sirenix.OdinInspector.Editor.InspectorProperty property, UnityEngine.GUIContent label) Sirenix.OdinInspector.Editor.OdinDrawer.DrawProperty (Sirenix.OdinInspector.Editor.InspectorProperty property, UnityEngine.GUIContent label) Sirenix.OdinInspector.Editor.OdinDrawer.CallNextDrawer (Sirenix.OdinInspector.Editor.InspectorProperty property, UnityEngine.GUIContent label) (at D:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/PropertyTree.cs:81) Sirenix.OdinInspector.Editor.OdinDrawer.CallNextDrawer (IPropertyValueEntry entry, UnityEngine.GUIContent label) Sirenix.OdinInspector.Editor.Drawers.PropertyContextMenuDrawer1[TagList].DrawPropertyLayout (IPropertyValueEntry1 entry, UnityEngine.GUIContent label) Sirenix.OdinInspector.Editor.OdinValueDrawer1[TagList].DrawProperty (IPropertyValueEntry1 entry, UnityEngine.GUIContent label) Sirenix.OdinInspector.Editor.OdinValueDrawer1[TagList].DrawPropertyImplementation (Sirenix.OdinInspector.Editor.InspectorProperty property, UnityEngine.GUIContent label) Sirenix.OdinInspector.Editor.OdinDrawer.DrawProperty (Sirenix.OdinInspector.Editor.InspectorProperty property, UnityEngine.GUIContent label) Sirenix.OdinInspector.Editor.OdinDrawer.CallNextDrawer (Sirenix.OdinInspector.Editor.InspectorProperty property, UnityEngine.GUIContent label) (at D:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/PropertyTree.cs:81) Sirenix.OdinInspector.Editor.Drawers.ShowIfAttributeDrawer.DrawPropertyLayout (Sirenix.OdinInspector.Editor.InspectorProperty property, Sirenix.OdinInspector.ShowIfAttribute attribute, UnityEngine.GUIContent label) Sirenix.OdinInspector.Editor.OdinAttributeDrawer1[TAttribute].DrawPropertyImplementation (Sirenix.OdinInspector.Editor.InspectorProperty property, UnityEngine.GUIContent label) (at D:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/InspectorProperty.cs:384) Sirenix.OdinInspector.Editor.OdinDrawer.DrawProperty (Sirenix.OdinInspector.Editor.InspectorProperty property, UnityEngine.GUIContent label) Sirenix.OdinInspector.Editor.InspectorUtilities.DrawProperty (Sirenix.OdinInspector.Editor.InspectorProperty property, UnityEngine.GUIContent label) Rethrow as OdinPropertyException: This error occurred while being drawn by Odin. Odin Property Path: #Level Scene.SceneData.#Scene.TagList Odin Drawer Chain: ShowIfAttributeDrawer, PropertyContextMenuDrawer<TagList>, ReferenceDrawer<TagList>, FixUnityNullDrawer<TagList>, ReferencePathConflictDrawer<TagList>, ReferenceValueConflictDrawer<TagList>, NullableReferenceDrawer<TagList>, CompositeDrawer. UnityEngine.Debug:LogException(Exception) Sirenix.OdinInspector.Editor.InspectorUtilities:DrawProperty(InspectorProperty, GUIContent) Sirenix.OdinInspector.Editor.InspectorUtilities:DrawProperty(InspectorProperty) Sirenix.OdinInspector.Editor.Drawers.BoxGroupAttributeDrawer:DrawPropertyGroupLayout(InspectorProperty, BoxGroupAttribute, GUIContent) (at D:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Value Drawers/QuaternionDrawer.cs:43) Sirenix.OdinInspector.Editor.OdinGroupDrawer1:DrawPropertyImplementation(InspectorProperty, GUIContent) (at D:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Infos/InspectorValuePropertyInfo.cs:63) Sirenix.OdinInspector.Editor.OdinDrawer:DrawProperty(InspectorProperty, GUIContent) Sirenix.OdinInspector.Editor.InspectorUtilities:DrawProperty(InspectorProperty, GUIContent) Sirenix.OdinInspector.Editor.InspectorUtilities:DrawProperty(InspectorProperty) Sirenix.OdinInspector.Editor.Drawers.CompositeDrawer:DrawPropertyImplementation(InspectorProperty, GUIContent) (at D:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Value Drawers/ColorDrawer.cs:73) Sirenix.OdinInspector.Editor.OdinDrawer:DrawProperty(InspectorProperty, GUIContent) Sirenix.OdinInspector.Editor.OdinDrawer:CallNextDrawer(InspectorProperty, GUIContent) (at D:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/PropertyTree.cs:81) Sirenix.OdinInspector.Editor.Drawers.NullableReferenceDrawer1:DrawPropertyLayout(IPropertyValueEntry1, GUIContent) (at D:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Attribute Drawers/AssetListAttributeDrawer.cs:464) Sirenix.OdinInspector.Editor.OdinValueDrawer1:DrawProperty(IPropertyValueEntry1, GUIContent) Sirenix.OdinInspector.Editor.OdinValueDrawer1:DrawPropertyImplementation(InspectorProperty, GUIContent) Sirenix.OdinInspector.Editor.OdinDrawer:DrawProperty(InspectorProperty, GUIContent) Sirenix.OdinInspector.Editor.OdinDrawer:CallNextDrawer(InspectorProperty, GUIContent) (at D:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/PropertyTree.cs:81) Sirenix.OdinInspector.Editor.Drawers.ReferenceValueConflictDrawer1:DrawPropertyLayout(IPropertyValueEntry1, GUIContent) (at D:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Misc Drawers/PropertyContextMenuDrawer.cs:113) Sirenix.OdinInspector.Editor.OdinValueDrawer1:DrawProperty(IPropertyValueEntry1, GUIContent) Sirenix.OdinInspector.Editor.OdinValueDrawer1:DrawPropertyImplementation(InspectorProperty, GUIContent) Sirenix.OdinInspector.Editor.OdinDrawer:DrawProperty(InspectorProperty, GUIContent) Sirenix.OdinInspector.Editor.OdinDrawer:CallNextDrawer(InspectorProperty, GUIContent) (at D:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/PropertyTree.cs:81) Sirenix.OdinInspector.Editor.Drawers.ReferencePathConflictDrawer1:DrawPropertyLayout(IPropertyValueEntry1, GUIContent) (at D:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Misc Drawers/NullableReferenceDrawer.cs:148) Sirenix.OdinInspector.Editor.OdinValueDrawer1:DrawProperty(IPropertyValueEntry1, GUIContent) Sirenix.OdinInspector.Editor.OdinValueDrawer1:DrawPropertyImplementation(InspectorProperty, GUIContent) Sirenix.OdinInspector.Editor.OdinDrawer:DrawProperty(InspectorProperty, GUIContent) Sirenix.OdinInspector.Editor.OdinDrawer:CallNextDrawer(InspectorProperty, GUIContent) (at D:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/PropertyTree.cs:81) Sirenix.OdinInspector.Editor.OdinDrawer:CallNextDrawer(IPropertyValueEntry, GUIContent) Sirenix.OdinInspector.Editor.Drawers.FixUnityNullDrawer1:DrawPropertyLayout(IPropertyValueEntry1, GUIContent) (at D:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Infos/InspectorPropertyInfo.cs:556) Sirenix.OdinInspector.Editor.OdinValueDrawer1:DrawProperty(IPropertyValueEntry1, GUIContent) Sirenix.OdinInspector.Editor.OdinValueDrawer1:DrawPropertyImplementation(InspectorProperty, GUIContent) Sirenix.OdinInspector.Editor.OdinDrawer:DrawProperty(InspectorProperty, GUIContent) Sirenix.OdinInspector.Editor.OdinDrawer:CallNextDrawer(InspectorProperty, GUIContent) (at D:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/PropertyTree.cs:81) Sirenix.OdinInspector.Editor.Drawers.ReferenceDrawer1:DrawPropertyLayout(IPropertyValueEntry1, GUIContent) (at D:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Misc Drawers/NullableReferenceDrawer.cs:112) Sirenix.OdinInspector.Editor.OdinValueDrawer1:DrawProperty(IPropertyValueEntry1, GUIContent) Sirenix.OdinInspector.Editor.OdinValueDrawer1:DrawPropertyImplementation(InspectorProperty, GUIContent) Sirenix.OdinInspector.Editor.OdinDrawer:DrawProperty(InspectorProperty, GUIContent) Sirenix.OdinInspector.Editor.OdinDrawer:CallNextDrawer(InspectorProperty, GUIContent) (at D:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/PropertyTree.cs:81) Sirenix.OdinInspector.Editor.OdinDrawer:CallNextDrawer(IPropertyValueEntry, GUIContent) Sirenix.OdinInspector.Editor.Drawers.PropertyContextMenuDrawer1:DrawPropertyLayout(IPropertyValueEntry1, GUIContent) Sirenix.OdinInspector.Editor.OdinValueDrawer1:DrawProperty(IPropertyValueEntry1, GUIContent) Sirenix.OdinInspector.Editor.OdinValueDrawer1:DrawPropertyImplementation(InspectorProperty, GUIContent) Sirenix.OdinInspector.Editor.OdinDrawer:DrawProperty(InspectorProperty, GUIContent) Sirenix.OdinInspector.Editor.InspectorUtilities:DrawProperty(InspectorProperty, GUIContent) Sirenix.OdinInspector.Editor.InspectorUtilities:DrawProperty(InspectorProperty) Sirenix.OdinInspector.Editor.Drawers.BoxGroupAttributeDrawer:DrawPropertyGroupLayout(InspectorProperty, BoxGroupAttribute, GUIContent) (at D:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Value Drawers/QuaternionDrawer.cs:43) Sirenix.OdinInspector.Editor.OdinGroupDrawer`1:DrawPropertyImplementation(InspectorProperty, GUIContent) (at D:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Infos/InspectorValuePropertyInfo.cs:63) Sirenix.OdinInspector.Editor.OdinDrawer:DrawProperty(InspectorProperty, GUIContent) Sirenix.OdinInspector.Editor.InspectorUtilities:DrawProperty(InspectorProperty, GUIContent) Sirenix.OdinInspector.Editor.InspectorUtilities:DrawProperty(InspectorProperty) Sirenix.OdinInspector.Editor.InspectorUtilities:DrawPropertiesInTree(PropertyTree) Sirenix.OdinInspector.Editor.PropertyTree:Draw(Boolean) Sirenix.OdinInspector.Editor.OdinEditor:OnInspectorGUI() (at D:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Children/GroupPropertyChildren.cs:50) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

The class creating the exception is the following:

[Serializable]
public class TagList
{


    [ValueDropdown("PotentialTags")]
    public List<String> Tags;

    private ValueDropdownList<string> PotentialTags { get { return EditorLinkedSceneManager.Instance.BuildTagsDropDown; } }

    public TagList()
    {
        Tags = new List<string> { EditorLinkedSceneManager.NoTagTag };
    }

}

where

EditorLinkedSceneManager is a singleton and BuildTagsDropDown is:

  [TabGroup("Tags"), SerializeField, PropertyOrder(1)]
    private List<string> buildTags = new List<string>();

    [TabGroup("Tags"), ValueDropdown("BuildTagsDropDown"), SerializeField, PropertyOrder(0)]
    private List<string> tagsToBuild = new List<string>();

    public ValueDropdownList<string> BuildTagsDropDown
    {
        get
        {
            ValueDropdownList<string> dropDown = new ValueDropdownList<string>();
            foreach (var key in buildTags)
            {
                dropDown.Add(key);
            }
            return dropDown;
        }
    }

The object that raises the exception uses the TagList the following way:

  [OnInspectorGUI]
    private void CheckSceneRegistered()
    {
        if (EditorSceneReference)
        {
              TagList = EditorLinkedSceneManager.Instance.GetTagListObject(EditorSceneReference);
        }
    }

    [BoxGroup("Scene"),NonSerialized,ShowInInspector,ShowIf("IsLinkedSceneDefinedEditor")]
    public TagList TagList;

Any idea why the exception is raised? It is raised only once when teh inspector shows by the way.

Thanks!

Comments (3)

  1. Bjarke Elias

    Hey, on my way out of the door, but I'll look more into it if this doesn't work. Try populating the TagList in the Repaint event.

      [OnInspectorGUI]
        private void CheckSceneRegistered()
        {
            if (EditorSceneReference && Event.current.type == Event.current.type == EventType.Repaint)
            {
                  TagList = EditorLinkedSceneManager.Instance.GetTagListObject(EditorSceneReference);
            }
        }
    
  2. Log in to comment