Exception in OdinMenuEditorWindow when windows dialog is opened and selected menu node is not connected to a scriptable object.

Issue #751 new
Vladimir Terziyski created an issue

The exception is: “EndLayoutGroup: BeginLayoutGroup must be called first.“ After that it gives multiple similar exceptions related to EndLayoutGroup call

You can see the exception in the Demo project.
Unity version: 2020.1.7f
Odin inspector version:
Windows 10

Steps to reproduce:

  1. Import “Sample - RPG Editor” demo project
  2. Open the RPGEditor Window from the demo project
  3. Click on Weapons “Root” node.
  4. Click “Create character” in the top right corner
  5. After the popup to save the character is opened - click on “Cancel”
  6. Unity shows the exceptions mentioned at the beginning.

What I found so far:

  • Associating the menu node with a scriptable object resolves the exception, but it gives a warning (that it should be instantiated) when done like this:

    tree.Add("Weapons", new TestObject()); //Where TestObject is just an empty ScriptableObject

  • It happens only when opening a windows popup from a button inside the OdinMenuEditorWindow like the one in the top toolbar, for example:

    EditorUtility.SaveFilePanel("Save object as", dest, "New " + typeof(T).GetNiceName(), "asset");

  • It doesn’t work with other type of object, only with types inheriting ScriptableObject. This custom ScriptableObject type can be just an empty class.

  • “Create item” button - next to the “Create Character” shows an overlay with item selection (weapons, armours and consumables). But after choosing the item from this overlay - the windows popup doesn’t trigger the exceptions

Below are the screenshot illustrating the steps

Comments (3)

  1. Log in to comment