Search Unity

Inspector Gadgets

Discussion in 'Assets and Asset Store' started by Kybernetik, Jun 8, 2019.

  1. dock

    dock

    Joined:
    Jan 2, 2008
    Posts:
    605
    Code (csharp):
    1. InvalidCastException: Specified cast is not valid.
    2. InspectorGadgets.Editor.SerializedPropertyContextMenu+ContextMenuHandler`1[T].GetDisplayString (System.Object value) (at Assets/Plugins/Inspector Gadgets/Serialization/SerializedPropertyContextMenu.cs:704)
    3. InspectorGadgets.Editor.SerializedPropertyContextMenu+ContextMenuHandler.Copy (System.Object value, UnityEditor.SerializedProperty property) (at Assets/Plugins/Inspector Gadgets/Serialization/SerializedPropertyContextMenu.cs:629)
    4. InspectorGadgets.Editor.PropertyDrawers.TransformPropertyDrawer.CopyCurrentValueToClipboard () (at Assets/Plugins/Inspector Gadgets/Inspector/Transform/TransformPropertyDrawer.cs:925)
    5. InspectorGadgets.Editor.PropertyDrawers.TransformPropertyDrawer.DoCopyButton (UnityEngine.Rect& area) (at Assets/Plugins/Inspector Gadgets/Inspector/Transform/TransformPropertyDrawer.cs:882)
    6. InspectorGadgets.Editor.PropertyDrawers.TransformPropertyDrawer.DoMiniButtonsGUI (UnityEngine.Rect& area) (at Assets/Plugins/Inspector Gadgets/Inspector/Transform/TransformPropertyDrawer.cs:830)
    7. InspectorGadgets.Editor.PropertyDrawers.RotationDrawer.DoMiniButtonsGUI (UnityEngine.Rect& area) (at Assets/Plugins/Inspector Gadgets/Inspector/Transform/RotationDrawer.cs:162)
    8. InspectorGadgets.Editor.PropertyDrawers.TransformPropertyDrawer.DoInspectorGUI (UnityEngine.Rect area) (at Assets/Plugins/Inspector Gadgets/Inspector/Transform/TransformPropertyDrawer.cs:104)
    9. InspectorGadgets.Editor.TransformEditor.OnInspectorGUI () (at Assets/Plugins/Inspector Gadgets/Inspector/Transform/TransformEditor.cs:102)
    10. UnityEditor.UIElements.InspectorElement+<>c__DisplayClass59_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <eea8364677374112b0b5e0783c3a715c>:0)
    11. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
    12.  
    Trying Inspector Gadgets Pro 6.8 on Unity 2021.2.0f1 and immediately running into issues with the Copy rotation buton.
     
  2. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    In the TransformPropertyDrawer class replace the CopyCurrentValueToClipboard method with this:
    Code (CSharp):
    1.         private void CopyCurrentValueToClipboard()
    2.         {
    3.             PrivateClipboard.CopyFrom(DisplayValues);
    4.             UpdatePasteTooltip();
    5.             ContextMenuHandler.Copy(GetDisplayCopyValue());
    6.         }
    7.  
    8.         protected virtual object GetDisplayCopyValue()
    9.             => DisplayValues.ToVector3();
    And just add this anywhere in the RotationDrawer class:
    Code (CSharp):
    1.         protected override object GetDisplayCopyValue()
    2.             => Quaternion.Euler(DisplayValues.ToVector3());
     
  3. dock

    dock

    Joined:
    Jan 2, 2008
    Posts:
    605
    Thanks @Kybernetik that seems to fix it! I'll keep an eye out for an update with this fix.
     
  4. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    Inspector Gadgets v6.9 is now available with the fixed rotation copy button and a new Selection History window which keeps track of the objects you select so you can quickly go back to them.
     
    AGregori likes this.
  5. Tsahyla

    Tsahyla

    Joined:
    Oct 20, 2012
    Posts:
    23
    Dropped it into a Unity 2020.2.f1 project and the transform Gizmos disappeared and now will not show. If I turn on "Show Movement Guides" in the Preferences I get the XYZ Transform only - the Rotate and the Size gizmos still do not show. Its very difficult to work without the gizmos heh. What is killing the gizmos showing ?

    This asset has worked marvelously until now. I miss it ...
     
    Last edited: Nov 7, 2021
  6. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    I assume you meant the newly released 2021.2f1?

    I've reported it as a Unity bug. It was working fine in the 2021.2 Beta and the problem persists even after removing the code where Inspector Gadgets overrides the regular Transform Gizmo or even deleting Inspector Gadgets from the project entirely.

    Does deleting Inspector Gadgets fix it for you?
     
  7. Tsahyla

    Tsahyla

    Joined:
    Oct 20, 2012
    Posts:
    23
    @Kybernetik TY very much for response. Yes, I deleted it from the project - all the transforms gizmos show again ; put it back in the project - all of them are gone unless you tick that one thing I mentioned above; take it back out again and all the transform gizmos are back.

    I hope you can get UNITY to fix this (or work around or something). Your tool is very helpful, awesome in fact - for years, and its a pain not having it now heh.
     
  8. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
  9. Tsahyla

    Tsahyla

    Joined:
    Oct 20, 2012
    Posts:
    23
    FYI, sadly it is not just with your asset : most all the assets I have that are supposed to show transform gizmos (like Veg Studio Pro biomes for example) also don't show the transform gizmos. This actually seems like a pretty major pervasive screw up. Hope it gets fixed asap.
     
  10. MUGIK

    MUGIK

    Joined:
    Jul 2, 2015
    Posts:
    481
    Great asset!
    Just downloaded it from Asset Store. Project specs: Unity 2020.3.19f1, URP.

    1. A bit annoyed by the preferences window. No matter how wide the window is I can't fully see field names.
    upload_2021-12-22_14-34-51.png

    2. Emphasize Non-Default Fields has almost no effect in dark theme. For several minutes I thought it doesn't work at all, and then finally saw a little shadow/outline.

    3. When I move an object in one axis - either the X or Z component shows 'scientific notation' instead of '0'.
    Also, label background obviously occupies more space than it needs to.
    upload_2021-12-22_14-45-40.png

    4. Would be cool to have ability to see these labels only when moving the handle. And when moving along only one axis show only this one axis-related label.
    upload_2021-12-22_14-57-7.png

    5. Shift+MiddleClick doesn't ping scripts from packages. For example Volume component from Core RP Library
     
    Last edited: Dec 22, 2021
    Kybernetik likes this.
  11. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    Thanks for the feedback, I'll take a look at those things for the next version.
     
    MUGIK likes this.
  12. dock

    dock

    Joined:
    Jan 2, 2008
    Posts:
    605
    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. InspectorGadgets.Editor.SelectionHistory+SelectionCommand.DoGUI (UnityEngine.Rect& area, System.Boolean isSelected, UnityEngine.GUIStyle style) (at Assets/Plugins/Inspector Gadgets/Misc/SelectionHistory.cs:343)
    3. InspectorGadgets.Editor.SelectionHistory.DoExpandedGUI () (at Assets/Plugins/Inspector Gadgets/Misc/SelectionHistory.cs:174)
    4. InspectorGadgets.Editor.SelectionHistory.OnGUI () (at Assets/Plugins/Inspector Gadgets/Misc/SelectionHistory.cs:102)
    5. UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at <55729f52d042492e9efc384182ae2feb>:0)
    6. UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect) (at <55729f52d042492e9efc384182ae2feb>:0)
    7. UnityEditor.DockArea.OldOnGUI () (at <55729f52d042492e9efc384182ae2feb>:0)
    8. UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    9. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
    10.  
    11. GUI Error: You are pushing more GUIClips than you are popping. Make sure they are balanced.
    12. UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
    13.  
    14. NullReferenceException: Object reference not set to an instance of an object
    15. InspectorGadgets.Editor.SelectionHistory+SelectionCommand.DoGUI (UnityEngine.Rect& area, System.Boolean isSelected, UnityEngine.GUIStyle style) (at Assets/Plugins/Inspector Gadgets/Misc/SelectionHistory.cs:343)
    16. InspectorGadgets.Editor.SelectionHistory.DoExpandedGUI () (at Assets/Plugins/Inspector Gadgets/Misc/SelectionHistory.cs:174)
    17. InspectorGadgets.Editor.SelectionHistory.OnGUI () (at Assets/Plugins/Inspector Gadgets/Misc/SelectionHistory.cs:102)
    18. UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at <55729f52d042492e9efc384182ae2feb>:0)
    19. UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect) (at <55729f52d042492e9efc384182ae2feb>:0)
    20. UnityEditor.DockArea.OldOnGUI () (at <55729f52d042492e9efc384182ae2feb>:0)
    21. UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    22. UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    23. UnityEngine.UIElements.IMGUIContainer.DoIMGUIRepaint () (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    24. UnityEngine.UIElements.UIR.RenderChainCommand.ExecuteNonDrawMesh (UnityEngine.UIElements.UIR.DrawParams drawParams, System.Single pixelsPerPoint, System.Exception& immediateException) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    25. Rethrow as ImmediateModeException
    26. UnityEngine.UIElements.UIR.RenderChain.Render () (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    27. UnityEngine.UIElements.UIRRepaintUpdater.Update () (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    28. UnityEngine.UIElements.VisualTreeUpdater.UpdateVisualTreePhase (UnityEngine.UIElements.VisualTreeUpdatePhase phase) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    29. UnityEngine.UIElements.Panel.UpdateForRepaint () (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    30. UnityEngine.UIElements.Panel.Repaint (UnityEngine.Event e) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    31. UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    32. UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    33. UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    34. UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    35. UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at <1c34070ddd5b426b8f32df1db927aad1>:0)
    36.  
    37. NullReferenceException: Object reference not set to an instance of an object
    38. InspectorGadgets.Editor.SelectionHistory+SelectionCommand.DoGUI (UnityEngine.Rect& area, System.Boolean isSelected, UnityEngine.GUIStyle style) (at Assets/Plugins/Inspector Gadgets/Misc/SelectionHistory.cs:343)
    39. InspectorGadgets.Editor.SelectionHistory.DoExpandedGUI () (at Assets/Plugins/Inspector Gadgets/Misc/SelectionHistory.cs:174)
    40. InspectorGadgets.Editor.SelectionHistory.OnGUI () (at Assets/Plugins/Inspector Gadgets/Misc/SelectionHistory.cs:102)
    41. UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at <55729f52d042492e9efc384182ae2feb>:0)
    42. UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect) (at <55729f52d042492e9efc384182ae2feb>:0)
    43. UnityEditor.DockArea.OldOnGUI () (at <55729f52d042492e9efc384182ae2feb>:0)
    44. UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    45. UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    46. UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    47. UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Boolean canAffectFocus) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    48. UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUIRaw (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    49. UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUI (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    50. UnityEngine.UIElements.IMGUIContainer.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    51. UnityEngine.UIElements.EventDispatchUtilities.PropagateEvent (UnityEngine.UIElements.EventBase evt) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    52. UnityEngine.UIElements.MouseEventDispatchingStrategy.SendEventToRegularTarget (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    53. UnityEngine.UIElements.MouseEventDispatchingStrategy.SendEventToTarget (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    54. UnityEngine.UIElements.MouseEventDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel iPanel) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    55. UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    56. UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    57. UnityEngine.UIElements.EventDispatcher.ProcessEventQueue () (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    58. UnityEngine.UIElements.EventDispatcher.OpenGate () (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    59. UnityEngine.UIElements.EventDispatcherGate.Dispose () (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    60. UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    61. UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    62. UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    63. UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    64. UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    65. UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    66. UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    67. UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at <1c34070ddd5b426b8f32df1db927aad1>:0)
    68.  
    69. NullReferenceException: Object reference not set to an instance of an object
    70. InspectorGadgets.Editor.SelectionHistory+SelectionCommand.DoGUI (UnityEngine.Rect& area, System.Boolean isSelected, UnityEngine.GUIStyle style) (at Assets/Plugins/Inspector Gadgets/Misc/SelectionHistory.cs:343)
    71. InspectorGadgets.Editor.SelectionHistory.DoExpandedGUI () (at Assets/Plugins/Inspector Gadgets/Misc/SelectionHistory.cs:174)
    72. InspectorGadgets.Editor.SelectionHistory.OnGUI () (at Assets/Plugins/Inspector Gadgets/Misc/SelectionHistory.cs:102)
    73. UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at <55729f52d042492e9efc384182ae2feb>:0)
    74. UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect) (at <55729f52d042492e9efc384182ae2feb>:0)
    75. UnityEditor.DockArea.OldOnGUI () (at <55729f52d042492e9efc384182ae2feb>:0)
    76. UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    77. UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    78. UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    79. UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Boolean canAffectFocus) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    80. UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUIRaw (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    81. UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUI (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    82. UnityEngine.UIElements.IMGUIContainer.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    83. UnityEngine.UIElements.CallbackEventHandler.HandleEventAtTargetPhase (UnityEngine.UIElements.EventBase evt) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    84. UnityEngine.UIElements.MouseCaptureDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    85. UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    86. UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    87. UnityEngine.UIElements.EventDispatcher.ProcessEventQueue () (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    88. UnityEngine.UIElements.EventDispatcher.OpenGate () (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    89. UnityEngine.UIElements.EventDispatcherGate.Dispose () (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    90. UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    91. UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    92. UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    93. UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    94. UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    95. UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    96. UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    97. UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at <1c34070ddd5b426b8f32df1db927aad1>:0)
    98.  
    99. NullReferenceException: Object reference not set to an instance of an object
    100. InspectorGadgets.Editor.SelectionHistory+SelectionCommand.DoGUI (UnityEngine.Rect& area, System.Boolean isSelected, UnityEngine.GUIStyle style) (at Assets/Plugins/Inspector Gadgets/Misc/SelectionHistory.cs:343)
    101. InspectorGadgets.Editor.SelectionHistory.DoExpandedGUI () (at Assets/Plugins/Inspector Gadgets/Misc/SelectionHistory.cs:174)
    102. InspectorGadgets.Editor.SelectionHistory.OnGUI () (at Assets/Plugins/Inspector Gadgets/Misc/SelectionHistory.cs:102)
    103. UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at <55729f52d042492e9efc384182ae2feb>:0)
    104. UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect) (at <55729f52d042492e9efc384182ae2feb>:0)
    105. UnityEditor.DockArea.OldOnGUI () (at <55729f52d042492e9efc384182ae2feb>:0)
    106. UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    107. UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    108. UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    109. UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Boolean canAffectFocus) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    110. UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUIRaw (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    111. UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUI (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    112. UnityEngine.UIElements.IMGUIContainer.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    113. UnityEngine.UIElements.EventDispatchUtilities.PropagateEvent (UnityEngine.UIElements.EventBase evt) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    114. UnityEngine.UIElements.MouseEventDispatchingStrategy.SendEventToRegularTarget (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    115. UnityEngine.UIElements.MouseEventDispatchingStrategy.SendEventToTarget (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    116. UnityEngine.UIElements.MouseEventDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel iPanel) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    117. UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    118. UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    119. UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    120. UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    121. UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    122. UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    123. UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    124. UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at <e88faa3aac574192a3ac9d4dae8147a1>:0)
    125. UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at <1c34070ddd5b426b8f32df1db927aad1>:0)
    126.  
    Today I had the Selection History window going berserk in 2020.3.26 LTS with thousands of guiclip errors. Closing the Selection History window fixed it.
     
  13. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    I haven't been able to get those errors, but it should be a simple fix. Just go to the DoGUI method near the bottom of the SelectionHistory script and replace:
    Code (CSharp):
    1. var selectedObject = _SelectedObject.Object;
    2. var content = EditorGUIUtility.ObjectContent(selectedObject, selectedObject.GetType());
    With:
    Code (CSharp):
    1. var selectedObject = _SelectedObject?.Object;
    2. var content = EditorGUIUtility.ObjectContent(selectedObject, selectedObject?.GetType());
     
  14. dock

    dock

    Joined:
    Jan 2, 2008
    Posts:
    605
    Code (CSharp):
    1. ExecuteMenuItem failed because there is no menu named 'Edit/Grid and Snap Settings...'
    2. UnityEngine.StackTraceUtility:ExtractStackTrace ()
    3. InspectorGadgets.Editor.PropertyDrawers.TransformPropertyDrawer:DoSnapButton (UnityEngine.Rect&) (at Assets/Plugins/Inspector Gadgets/Inspector/Transform/TransformPropertyDrawer.cs:1027)
    4. InspectorGadgets.Editor.PropertyDrawers.TransformPropertyDrawer:DoMiniButtonsGUI (UnityEngine.Rect&) (at Assets/Plugins/Inspector Gadgets/Inspector/Transform/TransformPropertyDrawer.cs:826)
    5. InspectorGadgets.Editor.PropertyDrawers.TransformPropertyDrawer:DoInspectorGUI (UnityEngine.Rect) (at Assets/Plugins/Inspector Gadgets/Inspector/Transform/TransformPropertyDrawer.cs:104)
    6. InspectorGadgets.Editor.TransformEditor:OnInspectorGUI () (at Assets/Plugins/Inspector Gadgets/Inspector/Transform/TransformEditor.cs:98)
    7. UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
    8.  
    Inspector Gadget's right click to open snap settings doesn't seem to work anymore.
    This is Unity 2021.2.13
     
  15. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    It looks like they've made a completely new snapping system UI. It has icons at the top of the scene view to open the settings, but they don't seem to be accessible from a menu function any more.
     
  16. dock

    dock

    Joined:
    Jan 2, 2008
    Posts:
    605
    Sometimes the [Button] code does not work at all. Here is the exact same code in two different Unity 2021.2.16 projects. The only difference I can tell is that one has URP enabled, but that doesn't seem related. Any ideas?
     

    Attached Files:

  17. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    The fact that the Script field at the top is also showing suggests that the Inspector Gadgets custom MonoBehaviour Editor isn't being applied.

    Do you have a custom editor for that specific script or any other editor tools that might have their own one that they're trying to apply to all scripts?
     
  18. dock

    dock

    Joined:
    Jan 2, 2008
    Posts:
    605
    The snap to grid RMB options in Inspector Gadgets have been broken for a while, but it would be helpful if the snap functionality still worked. Right now it's stuck at 1,1,1, but I'd like to snap to the world grid.
    upload_2022-5-31_11-15-50.png
    upload_2022-5-31_11-17-17.png
     
  19. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    Looks like they stopped storing the values in EditorPrefs and made a new class for it.

    Go to IGEditorUtils.cs, find
    #region Snapping
    and replace from there down to the first
    SnapPosition
    method with this:
    Code (CSharp):
    1.         #region Snapping
    2.         /************************************************************************************************************************/
    3.  
    4.         /// <summary>Wraps <see cref="EditorSnapSettings.move"/>.</summary>
    5.         public static Vector3 MoveSnapVector
    6.         {
    7.             get => EditorSnapSettings.move;
    8.             set => EditorSnapSettings.move = value;
    9.         }
    10.  
    11.         /************************************************************************************************************************/
    12.  
    13.         /// <summary>Wraps <see cref="EditorSnapSettings.rotate"/>.</summary>
    14.         public static float RotationSnap
    15.         {
    16.             get => EditorSnapSettings.rotate;
    17.             set => EditorSnapSettings.rotate = value;
    18.         }
    19.  
    20.         /// <summary>(<see cref="RotationSnap"/>, <see cref="RotationSnap"/>, <see cref="RotationSnap"/>).</summary>
    21.         public static Vector3 RotationSnapVector
    22.         {
    23.             get
    24.             {
    25.                 var snap = RotationSnap;
    26.                 return new Vector3(snap, snap, snap);
    27.             }
    28.         }
    29.  
    30.         /************************************************************************************************************************/
    31.  
    32.         /// <summary>Wraps <see cref="EditorSnapSettings.scale"/>.</summary>
    33.         public static float ScaleSnap
    34.         {
    35.             get => EditorSnapSettings.scale;
    36.             set => EditorSnapSettings.scale = value;
    37.         }
    38.  
    39.         /// <summary>(<see cref="ScaleSnap"/>, <see cref="ScaleSnap"/>, <see cref="ScaleSnap"/>).</summary>
    40.         public static Vector3 ScaleSnapVector
    41.         {
    42.             get
    43.             {
    44.                 var snap = ScaleSnap;
    45.                 return new Vector3(snap, snap, snap);
    46.             }
    47.         }
    48.  
    49.         /************************************************************************************************************************/
    50.  
    51.         /// <summary>Snaps the given `value` to a grid with the specified `snap` size.</summary>
    52.         public static float Snap(float value, float snap)
    53.             => Mathf.Round(value / snap) * snap;
    54.  
    55.         /************************************************************************************************************************/
    56.  
    57.         /// <summary>Snaps the given `position` to the grid (as specified in Edit/Snap Settings).</summary>
    58.         public static Vector3 SnapPosition(Vector3 position)
    59.         {
    60.             var snap = MoveSnapVector;
    61.             position.x = Snap(position.x, snap.x);
    62.             position.y = Snap(position.y, snap.y);
    63.             position.z = Snap(position.z, snap.z);
    64.             return position;
    65.         }
    Those values seem to be controlled by the Increment Snapping menu (to the right of the one you circled).
     
  20. dock

    dock

    Joined:
    Jan 2, 2008
    Posts:
    605
    @Kybernetik I tried the changes you suggested, but it still has the same problems.
    Here's a video showing a 0.333 world grid and 0.25 Inspector Gadgets grid. unity snap issue.gif
     
  21. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    It's reading from the menu to the right of that one which also has rotation and scale settings.
     
  22. AGregori

    AGregori

    Joined:
    Dec 11, 2014
    Posts:
    527
    Red errors appeared on Unity 2021.1.4f:


    SerializedObjectNotCreatableException: Object at index 0 is null
    UnityEditor.Editor.CreateSerializedObject () (at <ee6fd03ff96245f993c3cba83ed9657b>:0)
    UnityEditor.Editor.GetSerializedObjectInternal () (at <ee6fd03ff96245f993c3cba83ed9657b>:0)
    UnityEditor.Editor.get_serializedObject () (at <ee6fd03ff96245f993c3cba83ed9657b>:0)
    InspectorGadgets.Editor.TransformEditor.‎‌‭‏‎‭‮‏‌‪‪‌‫‫‍‌‬‪‪‭‮ (UnityEditor.Editor ) (at <600c89c250774b0ebe40cc363b5e3b4a>:0)
    InspectorGadgets.Editor.TransformEditor.OnEnable () (at <600c89c250774b0ebe40cc363b5e3b4a>:0)
     
  23. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    What were you doing at the time? I'm not getting any errors by just selecting things.
     
  24. AGregori

    AGregori

    Joined:
    Dec 11, 2014
    Posts:
    527
    It's gone now, I think a random script I got from Github interfered with it, thanks.
     
  25. Grumpy-Dot

    Grumpy-Dot

    Joined:
    Feb 29, 2016
    Posts:
    93
    @Kybernetik Hello, I got this on 2021.3.5f1 when creating an empty GameObject.

    Code (CSharp):
    1. AmbiguousMatchException: Ambiguous match found.
    2. System.RuntimeType.GetMethodImplCommon (System.String name, System.Int32 genericParameterCount, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Reflection.CallingConventions callConv, System.Type[] types, System.Reflection.ParameterModifier[] modifiers) (at <e40e5a8f982c4b618a930d29f9bd091c>:0)
    3. System.RuntimeType.GetMethodImpl (System.String name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Reflection.CallingConventions callConv, System.Type[] types, System.Reflection.ParameterModifier[] modifiers) (at <e40e5a8f982c4b618a930d29f9bd091c>:0)
    4. System.Type.GetMethod (System.String name, System.Reflection.BindingFlags bindingAttr) (at <e40e5a8f982c4b618a930d29f9bd091c>:0)
    5. InspectorGadgets.PositionDrawer.DrawTool (UnityEngine.Transform target, UnityEngine.Vector3 handlePosition) (at C:/Users/kdierk/Desktop/Projects/Kybernetik/Kybernetik/Source Code/Inspector Gadgets/InspectorGadgets.Editor/Transform Editor/PositionDrawer.cs:396)
    6. InspectorGadgets.TransformEditor.DrawHandles (UnityEngine.Transform target, InspectorGadgets.TransformPropertyDrawer currentTool) (at C:/Users/kdierk/Desktop/Projects/Kybernetik/Kybernetik/Source Code/Inspector Gadgets/InspectorGadgets.Editor/Transform Editor/TransformEditor.cs:259)
    7. InspectorGadgets.TransformEditor.OnSceneGUI () (at C:/Users/kdierk/Desktop/Projects/Kybernetik/Kybernetik/Source Code/Inspector Gadgets/InspectorGadgets.Editor/Transform Editor/TransformEditor.cs:242)
    8. System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <e40e5a8f982c4b618a930d29f9bd091c>:0)
    9. Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    10. System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <e40e5a8f982c4b618a930d29f9bd091c>:0)
    11. System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <e40e5a8f982c4b618a930d29f9bd091c>:0)
    12. UnityEditor.SceneView.CallOnSceneGUI () (at <1f0be198f5164d2489de92f22c998266>:0)
    13. UnityEditor.SceneView.HandleSelectionAndOnSceneGUI () (at <1f0be198f5164d2489de92f22c998266>:0)
    14. UnityEditor.SceneView.DoOnGUI () (at <1f0be198f5164d2489de92f22c998266>:0)
    15. UnityEditor.SceneView.OnSceneGUI () (at <1f0be198f5164d2489de92f22c998266>:0)
    16. UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <f2e1435fec084ff693c649189d4dffd4>:0)
    17. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
    18.  
     
  26. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    Are you sure you're using the latest version of Inspector Gadgets? The line PositionDrawer.cs:396 looks like an empty
    catch { }
    block which couldn't cause that exception and the GetMethod call before it specifies the type arguments so it shouldn't cause it there either.
     
    Grumpy-Dot likes this.
  27. gwelkind

    gwelkind

    Joined:
    Sep 16, 2015
    Posts:
    66
    Hey @Kibernetik, I'm a long-time Inspector Gadgets user, first time ProBuilder user. I've noticed that the two packages cannot be used together and I was wondering if there's a workaround or if you'd be willing to fix the issue/create a workaround.

    Steps to reproduce:
    • New Unity 2021 project & add ProBuilder latest (5.0.3)
    • Create new cube, note that faces, edges, vertices can be selected and transformed using Unity's default gizmos.
    • Add inspectorGadget
    • Note that selecting mesh pieces and transforming will transform the entire GameObject.

    Given that ProBuilder is now canonically integrated into Unity as a 1st party asset and is seeing widespread usage, could we either:
    • Figure out how to make sure InspectorGadget modified gizmos can play well with mesh modelling OR
    • At least have a way of temporarily disabling InspectorGadget (a hot key would be awesome), so that any packages which don't play nicely can still be used without removing the whole package and wait for reimport every time we go to use the incompatible asset.
    Much obliged for your consideration, I'm a huge fan of your work and use many of your packages in my daily workflow. Thanks for doing all you do.
     
  28. gwelkind

    gwelkind

    Joined:
    Sep 16, 2015
    Posts:
    66
    Ah, I can't believe I missed this: Anyone seeing my message, the workaround is to turn off "Override Transform Gizmos" in the Inspector Gadgets Pro section of preferences.

    (Requests for PB inter-compatibility/a hotkey to turn off gizmo override still stand, though we can probably make the hotkey on our own without too much trouble)
     
  29. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    The class which uses that pref value is unfortunately internal, but you can easily enough set it by name and tell Unity to reload all scripts to make it pick up the new value. Just stick this in any class:
    Code (CSharp):
    1. #if UNITY_EDITOR
    2. [MenuItem("GameObject/Toggle Override Transform Gizmos")]
    3. public static void ToggleOverrideTransformGizmos()
    4. {
    5.     const string Key = "InspectorGadgets.OverrideTransformGizmos";
    6.     var value = EditorPrefs.GetBool(Key);
    7.     value = !value;
    8.     EditorPrefs.SetBool(Key, value);
    9.     Debug.Log("Set Override Transform Gizmos to " + value);
    10.     UnityEditor.Compilation.CompilationPipeline.RequestScriptCompilation();
    11. }
    12. #endif
    13.  
    That will add a function to the GameObject menu and you can then go to Edit/Shortcuts... to give it whatever hotkey you want.
     
    gwelkind likes this.
  30. virtualjay

    virtualjay

    Joined:
    Aug 4, 2020
    Posts:
    68
    I have always loved the cool features this asset brings, and bought the Pro version to support the author even though I didn't need its extra features. But there's one feature I really wish it had. I wish you could set it to just show "0" for fields that are some very small value. Fields often show up this way when you have several objects nested due to single precision floats unity uses, especially when you move objects from one root to another.

    For now (since I bought Pro and have the source - I guess I did use ONE feature of it!), I have hacked it in by changing this line in TransformPropertyDrawer
    Code (CSharp):
    1. fieldValue = EditorGUI.FloatField(area, label, fieldValue, style);
    to
    Code (CSharp):
    1. fieldValue = EditorGUI.FloatField(area, label, ShrinkScientificFields && IsScientific(fieldValue) ? 0 : fieldValue, style);
    This both draws it as zero, but also shrinks it. Which is good, because it makes it clear this is a value being rounded to 0 by IG.
     
    Last edited: Sep 13, 2022
    ledshok likes this.
  31. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    I actually came up with a better way to implement that sort of thing in Animancer. Basically, it replaces small scientific notation values with "~0" (denoting "approximately zero") and compresses larger values to actually fit into the available space (so 1.234568e+07 could become 1.23e+7 if the field isn't very wide). It also shows the actual underlying value when you click in the field just in case you do actually want it. Unfortunately, the implementation is a bit complex and tied into some of Animancer's other stuff so I didn't want to maintain a copy of the same systems in another plugin. But now that it has been working without problems for a while, maybe I'll see how much effort it would take to bring it over to the next version of IG or at least have IG use it if Animancer is also in your project.
     
    ledshok and virtualjay like this.
  32. virtualjay

    virtualjay

    Joined:
    Aug 4, 2020
    Posts:
    68
    Thanks! Animancer looks cool and I'll keep it in mind if we wind up on a project that has a decent amount of animations. But otherwise, there's a lot of my projects that'd have IG Pro that wouldn't have Animancer. So it'd be a shame to miss the feature just because of that.
     
  33. AGregori

    AGregori

    Joined:
    Dec 11, 2014
    Posts:
    527
    @Kybernetik Hi there, one of the unsung great things of IG 6.9 is the PingObject context menu. However, it would be even more helpful if we users could PingObject the gameobject without the extra step of a context menu, meaning with a single (middle or right) click on the Transform, since it's used all the time in a workflow. I've been trying to achieve it, but my C# apparently sucks.
    If you agree, could you do that small fix?
     
  34. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    Middle Click and Right Click are already used to clear Transform fields and open Context Menus. That could obviously be changed, but what about something like this:
    Code (CSharp):
    1. #if UNITY_EDITOR
    2. [UnityEditor.MenuItem("Edit/Selection/Ping Selected Object &%#P")]
    3. private static void PingSelectedObject()
    4. {
    5.     UnityEditor.EditorGUIUtility.PingObject(UnityEditor.Selection.activeObject);
    6. }
    7. #endif
    Just stick that in any class and it would make Ctrl + Shift + Alt + P ping the selected object. You can change the hotkeys with the characters at the end or via the hotkey manager in recent Unity versions.
     
    AGregori likes this.
  35. AGregori

    AGregori

    Joined:
    Dec 11, 2014
    Posts:
    527
    Thank you, will do!
     
  36. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    2,443
    I am not sure if it's an InspectorGadget issue or not, but I am writing an EditorWindow class which uses a couple List elements backed by the usual SerializedProperty. If I click the little + or - buttons on the List drawer, EditorGUI.EndChangeCheck() detects the change. If I use the little bullseye and modify an element, EndChangeCheck detects the change. If I drag an object into an element, though, EndChangeCheck does not detect that anything has changed, although the SerializedProperty has actually made the appropriate updates.

    Code (CSharp):
    1.                 EditorGUI.BeginChangeCheck();
    2.                 EditorGUILayout.PropertyField(serializedPropertyForList, true);
    3.                 if (EditorGUI.EndChangeCheck())
    4.                 {
    5.                     Debug.Log($"list changed");
    6.                 }
    7.  
     
  37. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    Open ObjectDrawer.cs and comment out its CustomPropertyDrawer attribute to disable it. That's the only thing I can think of in IG that could affect it, though it only intercepts drops if you're dropping a GameObject with multiple components of the same type into a field of that type so it can show you a list to ask which one you want (which would unfortunately never work with the change check system because context menus are executed at the end of the frame).
     
  38. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    2,443
    I'll check into that. I am indeed dealing with components that have multiple instances on an object, but the drag and drop I tried was of specific instances. For example, two lists of colliders, drag a specific collider from list B to list A (and I wanted the trigger to remove it from B).
     
  39. dsilverthorn

    dsilverthorn

    Joined:
    May 14, 2017
    Posts:
    839
    @Kybernetik wanted to thank you for IG Pro. This was one of the first assets I purchased years ago, and I really can't create without it.:)
    This latest video was designed and created using Inspector Gadgets Pro extensively.
     
    Kybernetik likes this.
  40. MariuszD

    MariuszD

    Joined:
    Jan 8, 2016
    Posts:
    9
    Hello,
    this is a great asset that I highly enjoy and it has improved my workflow greatly. I have one issue with this though. The drag & drop reference setting seems to not work. Is there something I could do to have it working locally or could you update the asset with this?

    I've attached a gif explaining what I want to achieve.

    RMB -> GetComponentsInChildren doesn't help me there because IngameArrowIndicator has multiple Image children inside.

    Best regards,
    Mariusz
     

    Attached Files:

  41. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    As a quick workaround, it seems to work if you go into Editor.cs and comment out the [CustomEditor] attribute on the ComponentEditor class.

    I'll take a proper look at it this evening after work.
     
  42. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    It seems that drag and drop no longer counts as a GUI change, so the fix is to open Editor.cs and remove the calls to
    EditorGUI.BeginChangeCheck()
    and
    EditorGUI.EndChangeCheck()
    . The latter is in an if statement which becomes just
    if (current.serializedObject.ApplyModifiedProperties())
    .

    I won't bother releasing an update for a minor issue like this, but I have some ideas for new features I want to try out once I can make time for it, so I'll probably be working on an update in the next few months.
     
    MariuszD likes this.
  43. MariuszD

    MariuszD

    Joined:
    Jan 8, 2016
    Posts:
    9
    Perfect! Works just as expected now. Thank you very much for such a quick response! :)
     
  44. Wilbert-Blom

    Wilbert-Blom

    Joined:
    Aug 13, 2011
    Posts:
    111
    Can we please get the 'S' and "A' or the 'Get' buttons (optionally) back. I know some users had problems with it but now it is costing me so much time now to use to the right click menu and go through the menu to assign the reference to GameObjects. I use that a lot!
     
  45. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    The Get button still exists, but only shows when the field is null.

    If you want it to show all the time, you could go into ObjectDrawer.DoGetButtonGUI and comment out the first line of the if statement at the top. If that's what you want, I can easily add a preference for whether you want to auto hide or not in the next version.

    And if you want it to support asset search, replace the contents of the delegate that method passes into ForEachTarget with this:
    Code (CSharp):
    1. if (prop.serializedObject.targetObject is Component component &&
    2.     !Event.current.control)
    3. {
    4.     component = IGUtils.ProgressiveSearch(component.gameObject, type, prop.displayName);
    5.     if (component != null)
    6.         prop.objectReferenceValue = component;
    7. }
    8. else
    9. {
    10.     var asset = IGEditorUtils.FindAssetOfType(type, prop.displayName);
    11.     if (asset != null)
    12.         prop.objectReferenceValue = asset;
    13. }
    That way if you hold Ctrl it will search assets. The reason I removed that from the Inspector is because it can get super slow in larger projects.
     
  46. dock

    dock

    Joined:
    Jan 2, 2008
    Posts:
    605
    firefox_AAR2BMn6Ev.png

    I'm having a problem with Inspector Gadgets clashing with Ultimate Editor Enhancer, which breaks the expanded references feature of Inspector Gadgets Pro. I also encountered a problem with 'Soap scriptable objects' addon where inspector gadget was breaking in some cases.

    Are there any Inspector Gadgets settings to improve compatibility with other unity addons?
     
  47. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    Unfortunately, Unity doesn't have an inbuilt way to combine multiple property drawers. It will essentially pick either my one or theirs at random and doesn't give us any option to prioritise or choose between them (other than going into the scripts and commenting out the [CustomPropertyDrawer] attribute on my ObjectDrawer class or whatever their class is called).

    The best solution I can come up with would be:
    1. The IG preferences window lets you pick another drawer class for the IG drawer to use internally. You pick the UEE object drawer.
    2. Then you also need to go into the UEE object drawer script and remove its [CustomPropertyDrawer] attribute to ensure that Unity uses the IG drawer.
    What's the problem you're having with Soap Scriptable Objects?
     
    dock likes this.
  48. Alex-Vertax

    Alex-Vertax

    Joined:
    Sep 16, 2013
    Posts:
    205
    Last edited: Feb 28, 2023
    dock likes this.
  49. dock

    dock

    Joined:
    Jan 2, 2008
    Posts:
    605
    Thanks Kybernetik for the reply (and amazing work with the fix Alex-Vertex!!). I'm not sure what would be the best solution, especially in terms of being future proof.

    Regarding Soap, the inspector normally shows the value for referenced FloatVariables. This also works with Inspector Gadgets Lite. However, once Inspector Gadgets Pro is installed it stops working.

    explorer_bQ9kevcr1N.png
    No Inspector Gadgets Pro = visible float value

    chrome_bLAq2ltKyC.png
    Inspector Gadgets Pro = no vislble value, and some style differences too.
     

    Attached Files:

  50. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    If you go to Editor.cs and comment out the
    CustomEditor(typeof(ScriptableObject)...
    attribute it would likely fix the problem, though it's strange because I marked it as a fallback which means it should only get used if there's no more specific editor for a given type and SOAP must have a more specific editor to do their custom GUI (unless they also marked their one as a fallback).