Unable to open preferences window

Issue #116 resolved
Henrik Bergvin created an issue

Tested on a blank project, installed via the Asset Store, Unity 5.6.1f1. If I go to Edit->Preferences->Odin Inspector and press "Show Odin Preferences", I get the following errors:

NullReferenceException: Object reference not set to an instance of an object
Sirenix.OdinInspector.Editor.SirenixPreferencesWindow.BuildMenuTree () (at C:/Users/Bjarke/Desktop/Projects/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Misc/SirenixPreferencesWindow.cs:229)
Sirenix.OdinInspector.Editor.SirenixPreferencesWindow.DrawLeftMenu () (at C:/Users/Bjarke/Desktop/Projects/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Misc/SirenixPreferencesWindow.cs:250)
Sirenix.OdinInspector.Editor.SirenixPreferencesWindow.OnGUI () (at C:/Users/Bjarke/Desktop/Projects/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Misc/SirenixPreferencesWindow.cs:83)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)

and

ArgumentException: Getting control 0's position in a group with only 0 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)
UnityEditor.EditorGUILayout.BeginScrollView (Vector2 scrollPosition, Boolean alwaysShowHorizontal, Boolean alwaysShowVertical, UnityEngine.GUIStyle horizontalScrollbar, UnityEngine.GUIStyle verticalScrollbar, UnityEngine.GUIStyle background, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:7404)
UnityEditor.EditorGUILayout.BeginScrollView (Vector2 scrollPosition, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:7363)
Sirenix.OdinInspector.Editor.SirenixPreferencesWindow.DrawLeftMenu () (at C:/Users/Bjarke/Desktop/Projects/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Misc/SirenixPreferencesWindow.cs:259)
Sirenix.OdinInspector.Editor.SirenixPreferencesWindow.OnGUI () (at C:/Users/Bjarke/Desktop/Projects/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Misc/SirenixPreferencesWindow.cs:83)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)

Comments (9)

  1. mSkull001
    • changed status to open

    Hi, thanks for reporting this.

    We're currently investigating this. For now, you should be able to get to the preferences through Window > Odin Inspector > Preferences.

  2. mSkull001

    Unfortunately we've been unable to reproduce this error. What if you access the config files directly? Can you edit them in the inspector, or are you still getting errors?

    You'll find them under Plugins > Sirenix > Odin Inspector > Config.

  3. Henrik Bergvin reporter

    Yes, I have three files there, "ColorPaletteManager", "GeneralDrawerConfig", "InspectorConfig". They are in Plugins>Sirenix>Odin Inspecto>Config>Editor. They're directly editable.

  4. Bjarke Elias

    Nothing should be null on that line. 😶

    Try going to "Edit > Project Settings > Editor" and set the "Asset Serialization Mode" to "Force Text", and re-import. If that works then I have a good idea of what could be the problem.

    But regardless, I think we are just going to rewrite the window and add support for defining menu item ordering which we have been wanting for some time anyway.

  5. Tor Esa Vestergaard

    Could we get an update on whether this issue is still present in the newest Odin patch (1.0.5.0)?

  6. Tor Esa Vestergaard

    Seeing as we have heard nothing of this for several months now, never managed to reproduce it, and never received further replies regarding the issue, we'll asume that it is resolved.

  7. Bjarke Elias

    In the next patch, we've added a new API making editor windows using Odin, which our own preferences window also takes advantage of https://i.imgur.com/6hD24Ep.png. If you could send us an email with your Odin invoice id, I can send you the 1.0.6 beta.

    I'm curious to see if that fixes it.

  8. Drat Newman

    Will do. What's interesting is it happens on my end, but not for my partner, whose project was identical as it was pulled from Git.

  9. Log in to comment