0
Fixed

Bug when clicking on Reference and no project tab is opened

manuel.rodriguez.matesanz 1 year ago updated by Lazlo Bonin (Lead Developer) 1 year ago 3

Open a Script > Create a reference, in my case a Material > click on the circle > look for a material > click on the reference. It will give this: 


ExitGUIException: Exception of type 'UnityEngine.ExitGUIException' was thrown.
UnityEngine.GUIUtility.ExitGUI () (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:156)
UnityEditor.EditorGUI.DoObjectField (UnityEngine.Rect position, UnityEngine.Rect dropRect, System.Int32 id, UnityEngine.Object obj, System.Type objType, UnityEditor.SerializedProperty property, UnityEditor.EditorGUI+ObjectFieldValidator validator, System.Boolean allowSceneObjects, UnityEngine.GUIStyle style) (at C:/buildslave/unity/build/Editor/Mono/GUI/ObjectField.cs:173)
UnityEditor.EditorGUI.ObjectFieldInternal (UnityEngine.Rect position, UnityEditor.SerializedProperty property, System.Type objType, UnityEngine.GUIContent label, UnityEngine.GUIStyle style, UnityEditor.EditorGUI+ObjectFieldValidator validator) (at C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:3526)
UnityEditor.EditorGUI.DefaultPropertyField (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label) (at C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:6148)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <567df3e0919241ba98db88bec4c6696f>:0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <567df3e0919241ba98db88bec4c6696f>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <567df3e0919241ba98db88bec4c6696f>:0)
Ludiq.PeekCore.ReflectionMagic.PrivateReflectionDynamicObjectBase.InvokeMethodOnType (System.Type type, System.Object target, System.String name, System.Object[] args, System.Type[] typeArgs) (at Assets/Ludiq/Ludiq.PeekCore/Editor/Dependencies/ReflectionMagic/PrivateReflectionDynamicObjectBase.cs:308)
Ludiq.PeekCore.ReflectionMagic.PrivateReflectionDynamicObjectBase.TryInvokeMember (System.Dynamic.InvokeMemberBinder binder, System.Object[] args, System.Object& result) (at Assets/Ludiq/Ludiq.PeekCore/Editor/Dependencies/ReflectionMagic/PrivateReflectionDynamicObjectBase.cs:96)
(wrapper dynamic-method) System.Object.CallSite.Target(System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,object,UnityEngine.Rect,UnityEditor.SerializedProperty,UnityEngine.GUIContent)
Ludiq.Peek.ReferencePropertyDrawer.OnGUI (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label) (at Assets/Ludiq/Ludiq.Peek/Editor/References/ReferencePropertyDrawer.cs:20)
UnityEditor.PropertyDrawer.OnGUISafe (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label) (at C:/buildslave/unity/build/Editor/Mono/ScriptAttributeGUI/PropertyDrawer.cs:23)
UnityEditor.PropertyHandler.OnGUI (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren, UnityEngine.Rect visibleArea) (at C:/buildslave/unity/build/Editor/Mono/ScriptAttributeGUI/PropertyHandler.cs:139)
UnityEditor.PropertyHandler.OnGUI (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren) (at C:/buildslave/unity/build/Editor/Mono/ScriptAttributeGUI/PropertyHandler.cs:106)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <567df3e0919241ba98db88bec4c6696f>:0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
Sirenix.OdinInspector.Editor.UnityPropertyHandlerUtility.PropertyHandlerOnGUI (System.Object handler, UnityEngine.Rect rect, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren) (at X:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Value Drawers/UnityPropertyHandlerUtility.cs:164)
Sirenix.OdinInspector.Editor.AbstractTypeUnityPropertyDrawer`3[TDrawer,TDrawnType,T].DrawPropertyLayout (UnityEngine.GUIContent label) (at X:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Value Drawers/AbstractTypeUnityPropertyDrawer.cs:118)
Sirenix.OdinInspector.Editor.OdinDrawer.CallNextDrawer (UnityEngine.GUIContent label) (at X:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/OdinDrawer.cs:306)
Sirenix.OdinInspector.Editor.Drawers.ReferenceValueConflictDrawer`1[T].DrawPropertyLayout (UnityEngine.GUIContent label) (at X:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Misc Drawers/ReferenceValueConflictDrawer.cs:55)
Sirenix.OdinInspector.Editor.OdinDrawer.CallNextDrawer (UnityEngine.GUIContent label) (at X:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/OdinDrawer.cs:306)
Sirenix.OdinInspector.Editor.Drawers.ReferencePathConflictDrawer`1[T].DrawPropertyLayout (UnityEngine.GUIContent label) (at X:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Misc Drawers/ReferencePathConflictDrawer.cs:45)
Sirenix.OdinInspector.Editor.OdinDrawer.CallNextDrawer (UnityEngine.GUIContent label) (at X:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/OdinDrawer.cs:306)
Sirenix.OdinInspector.Editor.Drawers.PropertyContextMenuDrawer`1[T].DrawPropertyLayout (UnityEngine.GUIContent label) (at X:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Misc Drawers/PropertyContextMenuDrawer.cs:336)
Sirenix.OdinInspector.Editor.OdinDrawer.DrawProperty (UnityEngine.GUIContent label) (at X:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/OdinDrawer.cs:176)
Sirenix.OdinInspector.Editor.InspectorProperty.Draw (UnityEngine.GUIContent defaultLabel) (at X:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/InspectorProperty.cs:544)
Rethrow as OdinPropertyException: This error occurred while being drawn by Odin.
Odin Property Path: m_activatedMaterial
Odin Drawer Chain:
> PropertyContextMenuDrawer
> ReferencePathConflictDrawer
> ReferenceValueConflictDrawer
> AbstractTypeUnityPropertyDrawer
> UnityObjectDrawer
> CompositeDrawer.
UnityEngine.Debug:LogException(Exception)
Sirenix.OdinInspector.Editor.InspectorProperty:Draw(GUIContent) (at X:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/InspectorProperty.cs:594)
Sirenix.OdinInspector.Editor.InspectorUtilities:DrawPropertiesInTree(PropertyTree) (at X:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Misc/InspectorUtilities.cs:415)
Sirenix.OdinInspector.Editor.PropertyTree:Draw(Boolean) (at X:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/PropertyTree.cs:303)
Sirenix.OdinInspector.Editor.OdinEditor:DrawTree() (at X:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/OdinEditor.cs:93)
Sirenix.OdinInspector.Editor.OdinEditor:DrawOdinInspector() (at X:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/OdinEditor.cs:215)
Sirenix.OdinInspector.Editor.OdinEditor:OnInspectorGUI() (at X:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/OdinEditor.cs:85)
Ludiq.Peek.EditorPopup:OnGUI() (at Assets/Ludiq/Ludiq.Peek/Editor/Tools/Editor/EditorPopup.cs:365)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)

Btw, I have Odin in the project which may give the issue.

Unity Version:
2019.2.11
Peek Version:
Latest from the store: 1.1.4
Escalated

Hi Manuel,

From the stack trace, it looks like you are using Odin Inspector, and Odin doesn't seem to be handling ExitGUIException properly (normally, this type of exception should just be ignored, not reported).

I'll ping the devs at Sirenix to get their opinion on this, I'll get back to you soon!

Fixed (Unreleased)

Hi Manuel,

Tor from Odin just let me know that this has been fixed internally on their end and should make it into a new version of Odin soon.

In the mean time, I'm also pushing a fix for Peek's next version that should fix it on our end.

However, rest assured that the error is harmless and will not cause any issue.