Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Power Inspector | Complete Inspector Rewrite

Discussion in 'Assets and Asset Store' started by SisusCo, Aug 28, 2019.

?

What Are Your Favorite Features?

  1. Back and Forward Buttons

  2. Search Box

  3. Split View

  4. Copy-Paste

  5. Debug Mode+

  6. Quick Invoke Menu

  7. Create Script Wizard

  8. Keyboard Friendly

  9. Improved Tooltips

  10. Target Window

Multiple votes are allowed.
Results are only viewable after voting.
  1. AGregori

    AGregori

    Joined:
    Dec 11, 2014
    Posts:
    405
    Material listing works fine, and no errors thrown in 1.3.1, all cool.

    The Show in Explorer button is great. There's a long (3second?) lag after pressing it though, but it may be a local issue of my own rig.

    Unity_IqZWPxrut0.png
     
  2. AGregori

    AGregori

    Joined:
    Dec 11, 2014
    Posts:
    405
    Actually, there is a major error: in material drawers, I can't choose items from pulldown menus. For instance, can't choose other than Opaque in this one:

    Unity_eMYoHUfFy8.png
     
  3. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,535
    ah yeah good point.
     
  4. SisusCo

    SisusCo

    Joined:
    Jan 29, 2019
    Posts:
    431
    @Gregorik thanks for reporting these issues, I'll check them out. I've had a lot of troubles with the MaterialEditor in the past, it seems to work in mysterious ways and differently in every different major Unity version.
     
  5. AGregori

    AGregori

    Joined:
    Dec 11, 2014
    Posts:
    405
    @SisusCo there's a similar issue where on a Standard Specular setup, the Specular slot is not showing.

    Unity_VNYhMhySfG.png
     
  6. SisusCo

    SisusCo

    Joined:
    Jan 29, 2019
    Posts:
    431
    Confirmed and fixed. The MaterialEditor is now refetched every time that changes are made to any of its properties, which causes the shader-specific GUI elements to get instantly updated.


    The issue of enum popups not working in the material drawer is a strange one... At first I was able to replicate the issue, and spent many hours trying to get them working to no avail. Then when I opened up the project again today the issue had just gone away - seemingly without anything relevant to the bug having been changed in the code! I still don't have any idea what the underlying issue was, but it might be that simply restarting the project or your computer might be able to get rid of it.


    I was not able to replicate the 3 second lag when using the Show In Explorer button. The code that gets executed when the button is used is basically just this:

    Code (CSharp):
    1. EditorUtility.RevealInFinder(AssetDatabase.GetAssetPath(Target));
    So I probably won't be able to do anything to fix this on my end.
     
    AGregori likes this.
  7. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,535
    Code (CSharp):
    1.  
    2. TypeLoadException: Could not resolve type with token 01000085 (from typeref, class/assembly UnityEngine.AssemblyIsEditorAssembly, UnityEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null)
    3. System.MonoCustomAttrs.GetCustomAttributesBase (System.Reflection.ICustomAttributeProvider obj, System.Type attributeType, System.Boolean inheritedOnly) (at <437ba245d8404784b9fbab9b439ac908>:0)
    4. System.MonoCustomAttrs.GetCustomAttributes (System.Reflection.ICustomAttributeProvider obj, System.Type attributeType, System.Boolean inherit) (at <437ba245d8404784b9fbab9b439ac908>:0)
    5. System.Reflection.Assembly.GetCustomAttributes (System.Type attributeType, System.Boolean inherit) (at <437ba245d8404784b9fbab9b439ac908>:0)
    6. Sisus.OdinSerializer.DefaultSerializationBinder.RegisterAssembly (System.Reflection.Assembly assembly) (at E:/Unity Projects/Odin Serializer  for Power Inspector 1.1.0/OdinSerializer/Core/Misc/DefaultSerializationBinder.cs:121)
    7. Sisus.OdinSerializer.DefaultSerializationBinder..cctor () (at E:/Unity Projects/Odin Serializer  for Power Inspector 1.1.0/OdinSerializer/Core/Misc/DefaultSerializationBinder.cs:100)
    8. Rethrow as TypeInitializationException: The type initializer for 'Sisus.OdinSerializer.DefaultSerializationBinder'
    Code (CSharp):
    1.  
    2. Exception: Illegal API call was made: cannot query members of a property that are dependent on children being initialized, during the initialization of the property's children.
    3. Sirenix.OdinInspector.Editor.BaseMemberPropertyResolver`1[TValue].LazyInitialize () (at X:/Repositories/sirenix-development/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Resolvers/Property Resolvers/BaseMemberPropertyResolver.cs:58)
    4. Sirenix.OdinInspector.Editor.BaseMemberPropertyResolver`1[TValue].GetChildCount (TValue value) (at X:/Repositories/sirenix-development/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Resolvers/Property Resolvers/BaseMemberPropertyResolver.cs:45)
    5. Sirenix.OdinInspector.Editor.OdinPropertyResolver`1[TValue].CalculateChildCount () (at X:/Repositories/sirenix-development/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Resolvers/Property Resolvers/OdinPropertyResolver.cs:129)
    6. Sirenix.OdinInspector.Editor.OdinPropertyResolver.get_ChildCount () (at X:/Repositories/sirenix-development/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Resolvers/Property Resolvers/OdinPropertyResolver.cs:73)
    7. Sirenix.OdinInspector.Editor.PropertyChildren.get_Count () (at X:/Repositories/sirenix-development/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/PropertyChildren.cs:80)
    8. Sirenix.OdinInspector.Editor.PropertyChildren.Get (System.Int32 index) (at X:/Repositories/sirenix-development/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/PropertyChildren.cs:181)
    9. Sirenix.OdinInspector.Editor.PropertyChildren.get_Item (System.Int32 index) (at X:/Repositories/sirenix-development/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/PropertyChildren.cs:41)
    10. Sirenix.OdinInspector.Editor.Drawers.Vector3Drawer.DrawPropertyLayout (UnityEngine.GUIContent label) (at X:/Repositories/sirenix-development/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Value Drawers/Vector3Drawer.cs:35)
    11. Sirenix.OdinInspector.Editor.OdinDrawer.CallNextDrawer (UnityEngine.GUIContent label) (at X:/Repositories/sirenix-development/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/OdinDrawer.cs:306)
    12. Sirenix.OdinInspector.Editor.Drawers.PropertyContextMenuDrawer`1[T].DrawPropertyLayout (UnityEngine.GUIContent label) (at X:/Repositories/sirenix-development/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Misc Drawers/PropertyContextMenuDrawer.cs:336)
    13. Sirenix.OdinInspector.Editor.OdinDrawer.DrawProperty (UnityEngine.GUIContent label) (at X:/Repositories/sirenix-development/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/OdinDrawer.cs:176)
    14. Sirenix.OdinInspector.Editor.InspectorProperty.Draw (UnityEngine.GUIContent defaultLabel) (at X:/Repositories/sirenix-development/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/InspectorProperty.cs:544)
    15. Rethrow as OdinPropertyException: This error occurred while being drawn by Odin.
    16. Odin Property Path: lastPos
    17. Odin Drawer Chain:
    18. > PropertyContextMenuDrawer<Vector3>
    19. > Vector3Drawer
    20. > CompositeDrawer.
    21. UnityEngine.Debug:LogException(Exception)
    22. Sirenix.OdinInspector.Editor.InspectorProperty:Draw(GUIContent) (at X:/Repositories/sirenix-development/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/InspectorProperty.cs:594)
    23. Sirenix.OdinInspector.Editor.InspectorUtilities:DrawPropertiesInTree(PropertyTree) (at X:/Repositories/sirenix-development/Sirenix Solution/Sirenix.OdinInspector.Editor/Misc/InspectorUtilities.cs:418)
    24. Sirenix.OdinInspector.Editor.PropertyTree:Draw(Boolean) (at X:/Repositories/sirenix-development/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/PropertyTree.cs:308)
    25. Sirenix.OdinInspector.Editor.OdinEditor:DrawTree() (at X:/Repositories/sirenix-development/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/OdinEditor.cs:93)
    26. Sirenix.OdinInspector.Editor.OdinEditor:DrawOdinInspector() (at X:/Repositories/sirenix-development/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/OdinEditor.cs:215)
    27. Sirenix.OdinInspector.Editor.OdinEditor:OnInspectorGUI() (at X:/Repositories/sirenix-development/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/OdinEditor.cs:85)
    28. Sisus.CustomEditorBaseDrawer`2:DrawOnInspectorGUI(Editor) (at Assets/Sisus/Power Inspector/Code/Drawers/UnityObject/CustomEditorBaseDrawer.cs:848)
    29. Sisus.CustomEditorBaseDrawer`2:OnInspectorGUI(Editor) (at Assets/Sisus/Power Inspector/Code/Drawers/UnityObject/CustomEditorBaseDrawer.cs:804)
    30. Sisus.CustomEditorBaseDrawer`2:DrawMembers(Rect) (at Assets/Sisus/Power Inspector/Code/Drawers/UnityObject/CustomEditorBaseDrawer.cs:684)
    31. Sisus.CustomEditorBaseDrawer`2:DrawBody(Rect) (at Assets/Sisus/Power Inspector/Code/Drawers/UnityObject/CustomEditorBaseDrawer.cs:652)
    32. Sisus.CustomEditorBaseDrawer`2:Draw(Rect) (at Assets/Sisus/Power Inspector/Code/Drawers/UnityObject/CustomEditorBaseDrawer.cs:580)
    33. Sisus.GameObjectDrawer:DrawBody(Rect) (at Assets/Sisus/Power Inspector/Code/Drawers/UnityObject/GameObject/GameObjectDrawer.cs:1708)
    34. Sisus.GameObjectDrawer:Draw(Rect) (at Assets/Sisus/Power Inspector/Code/Drawers/UnityObject/GameObject/GameObjectDrawer.cs:1533)
    35. Sisus.Inspector:DrawViewport() (at Assets/Sisus/Power Inspector/Code/Inspector/Core/Inspector.cs:1822)
    36. Sisus.Inspector:DrawViewport(Rect) (at Assets/Sisus/Power Inspector/Code/Inspector/Core/Inspector.cs:1756)
    37. Sisus.PowerInspector:OnGUI(Rect, Boolean) (at Assets/Sisus/Power Inspector/Code/Inspector/Power Inspector/PowerInspector.cs:144)
    38. Sisus.InspectorDrawerWindow:OnGUI() (at Assets/Sisus/Power Inspector/Code/Editor/EditorWindow/InspectorDrawerWindow.cs:1758)
    39. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
    40.  
    41.  
    Get those errors.. also using Odin maybe its that not PowerInspector or both?
     
  8. SisusCo

    SisusCo

    Joined:
    Jan 29, 2019
    Posts:
    431
    @Player7

    The second error seems to originate from deep inside Odin code (Power Inspector just calls OdinEditor.OnInspectorGUI and the rest is all Odin logic), so the Odin devs would probably be in a better position to try to figure out what could be causing this one.


    The first error seems to occur from inside a dll included in Power Inspector, so that one could very well be an issue on my end. Do you have more information you could share about when exactly this error occurs?

    Could also you provide me with the following information about your project setup:
    • Unity version
    • Player Settings > Scripting Backend (IL2CPP or Mono)
    • Player Settings > Api Compatibility Level (.NET Standard 2.0 or .NET 4.x)
    • Build Target
    I tried testing the latest version of Power Inspector and Odin together in Unity 2019.2.9f1 with several different configurations but was not able to replicate either of these errors yet.
     
  9. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,535
    2019.3 f5, mono, windows... maybe a script with public fields like Transform[], Transform, Vector3[], Vector3 might trigger it? will look at my script again
     
  10. SisusCo

    SisusCo

    Joined:
    Jan 29, 2019
    Posts:
    431
    @Player7 I still was not able to replicate the errors you're seeing. Transform[], Transform, Vector3[] and Vector3 fields are working fine for me with those settings and Unity version.

    You could try reinstalling Odin and see if it helps.
     
  11. SisusCo

    SisusCo

    Joined:
    Jan 29, 2019
    Posts:
    431
    Power Inspector 1.3.2 is now available. It doesn't introduce any new exciting features but contains a bunch of bug fixes and small UX improvements.

    Changes:
    • Added ability to add one or more Object references into an Object collection by dragging them onto the header the collection drawer.
    • Added a colored line between split views to separate them visually from each other more clearly.
    • The split view is now automatically unlocked if its contents match the selected targets when you close the main view.
    • You can now begin an Object reference drag from GameObject headers.
    • Prefab instance modification indicators are updated as needed to reflect any changes made.
    • Added Apply and Revert context menu items for drawers of components on prefab instances.
    • Improved reliability of copy-paste operations by also copying over all private fields by default. This fixes copy-pasting for UnityEvents.
    • Other bug fixes.
     
    AGregori likes this.
  12. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,535

    Latest Odin+ Latest Power Inspector
    ...on the demo scenes of KinematicCharacterController...
     
  13. SisusCo

    SisusCo

    Joined:
    Jan 29, 2019
    Posts:
    431
    @Player7

    Looking at the error message, it looks to me like the source of your issue is that your project contains a dll that has the UnityEngine.AssemblyIsEditorAssembly attribute but probably does not contain a reference to the UnityEngine assembly.

    Due to this when Odin's custom editor creates an instance of Sisus.OdinSerializer.DefaultSerializationBinder it calls Assembly.GetCustomAttributes for all assemblies in the project, resulting in the TypeLoadException occuring when failing to read said attribute.


    Possible fixes for the issue:

    1. If this is caused by corrupted project files, you could try deleting your Library folder to force all script assemblies and other temporary files to get rebuilt.

    2. If this is caused by a third party dll that has some missing reference, then the dll would need to be rebuilt correctly by its developer.

    3. It looks like in the latest OdinSerializer version they've also added an ad-hoc fix for issues like this by wrapping the Assembly.GetCustomAttributes call inside try-catch. I'll update OdinSerializer to the latest version to integrate this into Power Inspector too. This however won't fix the underlying source of the issue in your project, so it is still recommended your try to fix the real source.
     
  14. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,535
    I'll take a look for that later then it is annoying trying to track down something that is in a dll though :(
     
  15. AGregori

    AGregori

    Joined:
    Dec 11, 2014
    Posts:
    405
    I wonder if the appearance of this division line is supposed to be like this. It feels a little disruptive.
    Unity_AJnRDWtoMm.png
     
  16. SisusCo

    SisusCo

    Joined:
    Jan 29, 2019
    Posts:
    431
    Definitely not supposed to look like that...

    prefix-resizer.png
     
  17. AGregori

    AGregori

    Joined:
    Dec 11, 2014
    Posts:
    405
    OK so it must be a conflict with another asset I suppose.
     
  18. SisusCo

    SisusCo

    Joined:
    Jan 29, 2019
    Posts:
    431
    Hmm, it looks like visual issues similar to yours occur if you use the UI Scaling feature found in beta versions of Unity.

    I guess I'll need to start investigating how I can change my GUI code so that everything can be properly rendered with any scaling settings.
     
  19. SisusCo

    SisusCo

    Joined:
    Jan 29, 2019
    Posts:
    431
    @Gregorik Fixing the UI Scaling glitch wasn't as bad as I thought, only had to build one GUIStyle I was using in various places differently. Everything now seems to function properly with scaling.

    @Player7 I also updated OdinSerializer to the latest version. This should hopefully result in better handling of the TypeLoadException that occurs in your project.

    I'll let you know when the update with these improvements has passed asset store validation.
     
    AGregori and Player7 like this.
  20. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,535
    haven't seen the asset store update yet.. but still getting them maybe same as other not sure
     
  21. SisusCo

    SisusCo

    Joined:
    Jan 29, 2019
    Posts:
    431
    Yeah the update is still awaiting approval...

    pending-review.PNG

    I'll try resubmitting the update package before Monday in case it hasn't been reviewed yet due to some sort of bug.
    But it could also just be that this was a busy week for the asset store team.
     
  22. SisusCo

    SisusCo

    Joined:
    Jan 29, 2019
    Posts:
    431
    The update is now out.
     
    AGregori likes this.
  23. vfqd

    vfqd

    Joined:
    May 20, 2015
    Posts:
    3
    Hi there @sisus_co - really cool tool, just having a few issues with it. I'm using it on an old version of Unity and a big project.

    Unity 2017.4.7f1 to be exact.

    I needed to add a preprocessor directive to `AssemblyDefinitionDrawer` to get the project to compile and then it did, but I have two issues.

    1) My `E` and `B` keys are now disabled in Unity, I assume this has something to do with the new keyboard stuff
    2) I could not open the preferences, I got a null ref when I tried. Full stack trace below

    NullReferenceException: Object reference not set to an instance of an object
    Sisus.PowerInspectorPreferencesWindow.GetPrefencesDrawer (IInspector preferencesInspector) (at Assets/Sisus/Power Inspector/Code/Editor/Inspector/Preferences/PowerInspectorPreferencesWindow.cs:40)
    Sisus.PowerInspectorPreferencesWindow.GetPrefencesDrawer (IInspectorDrawer preferencesWindow) (at Assets/Sisus/Power Inspector/Code/Editor/Inspector/Preferences/PowerInspectorPreferencesWindow.cs:34)
    Sisus.PowerInspectorPreferencesWindow.GetExistingOrCreateNewWindow () (at Assets/Sisus/Power Inspector/Code/Editor/Inspector/Preferences/PowerInspectorPreferencesWindow.cs:70)
    Sisus.PowerInspectorMenuItems.OpenPreferences () (at Assets/Sisus/Power Inspector/Code/Editor/Inspector/Power Inspector/PowerInspectorMenuItems.cs:146)



    I'd really like to use this as it would be a life saver on this old, clunky project. Please let me know what you find
     
  24. SisusCo

    SisusCo

    Joined:
    Jan 29, 2019
    Posts:
    431
    Hi @vfqd ! Sorry to hear that you've ran into issues.

    I'm a bit busy this weekend but I'll fire up the good ol' Unity 2017.4.7f1 and start working on getting all of these fixed first thing come Monday.
     
  25. vfqd

    vfqd

    Joined:
    May 20, 2015
    Posts:
    3
    Thanks @SisusCo - let me know what you find / if you need anything from me
     
  26. SisusCo

    SisusCo

    Joined:
    Jan 29, 2019
    Posts:
    431
    @vfqd Okay, I think I have them all fixed now. I submitted a new update with the fixes to the asset store.

    If you'd rather not wait for the update to pass approval just let me know and I can send you the updated package
    beforehand.

    The curious issue of E and B keys not working turned out to be because of two menu items "Reset _Backspace"
    and "Peek _MMB".
    In earlier Unity versions it seems that "_Backspace" shortcut was parsed to mean the keyboard input E and "_MMB" was parsed to mean the keyboard input B.
    I changed these to "Peek\tMMB" and "Reset\tBackspace" so Unity won't try to parse any keyboard shortcuts out of them, fixing the issue.
     
  27. vfqd

    vfqd

    Joined:
    May 20, 2015
    Posts:
    3
    @sisus_co Yeah that'd be great! What's the best way for you to send it to me?
     
  28. SisusCo

    SisusCo

    Joined:
    Jan 29, 2019
    Posts:
    431
    @vfqd I sent you a PM.
     
  29. tieum67

    tieum67

    Joined:
    Mar 7, 2017
    Posts:
    18
    Hello,

    I just bought your asset and installed it on a project on Unity 2018.1.6.f, w10
    It crashes on playmode.
    To be more precise, it crashes when i have one tab of power inspector opened, on a script where i want to display the methods i would like to invoke.
    If there s no tab opened, it works. When there s one tab it works. ( on play mode).
    Do you know how it could be solved ? Cheers !
     
  30. SisusCo

    SisusCo

    Joined:
    Jan 29, 2019
    Posts:
    431
    Hello @tieum67

    I was not able to reproduce the crash you're describing with a fresh install of Power Inspector in Unity 2018.1.6f1.

    Could you recreate the crash one more time and then send me a PM with your editor log file?
    The editor log can be found at the following path:

    C:\Users\[UserName]\AppData\Local\Unity\Editor\Editor.log

    Also if you can send me the script that is causing the crash to occur I can try to reproduce the crash with it locally.

    Thanks!
     
  31. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,535
  32. SisusCo

    SisusCo

    Joined:
    Jan 29, 2019
    Posts:
    431
    @Player7 Yeah this would be pretty sweet. I have been exploring different ways of achieving just this.

    I've actually been working on system that would allow integrating Power Inspector's features, toolbar and all, inside the default inspector in all its different incarnations. Provided that I can get it working, it would cover the default inspector window, the new properties inspector and likely even support things like Peek's reference inspector. There are still some sizable challenges that I'd need to solve to get this working though, so no promises that this feature will ship.

    If this approach turns out to be unfeasible, I have some other ideas for handling the properties inspector as well...
     
  33. SisusCo

    SisusCo

    Joined:
    Jan 29, 2019
    Posts:
    431
  34. okanc

    okanc

    Joined:
    Jun 1, 2017
    Posts:
    1
    Hello @SisusCo,
    First of all, thanks for this great asset.
    I tried Power Inspector on a blank project and got it built before I added it to my main project. In this build, I see the runtime footprint of Power Inspector is high. The dll's below are directly included in build.

    PowerInspector.Runtime.dll
    Sisus.Attributes.dll
    Sisus.Newtonsoft.Json.dll
    Sisus.OdinSerializer.dll

    I tweaked on Asmdefs but I did not get any results. The last two dlls are extra sad because we are not using odin and newtonsoft json is already in the project. These two are added unnecessarily. PowerInspector.Runtime.dll is also quite large. Is there a way to get these three out of build? I expect to see only Sisus.Attributes.dll in build.
     
  35. SisusCo

    SisusCo

    Joined:
    Jan 29, 2019
    Posts:
    431
    Hi @okanc

    Thanks for spotting this and bringing it to my attention!

    At some point in time I had ambitions for having full support for creating runtime inspectors. The idea was that it could be used as a powerful debugging tool for examining and manipulating data even in builds and stuff like that. The feature was actually working in the early days before the first official release, but while it was a nice thing to have, over time I stopped putting the work to keep it functioning as I wasn't really using it myself and wasn't sure if it had enough value to justify all the effort.

    It is clear at this point that it would be very difficult to both support runtime inspectors as an option as well as automatically stripping all code from builds when the feature isn't being used. And the latter is what 99% of users would probably prefer. So I think will go ahead and convert all code to be editor-only - except for the attributes like you said - ensuring that everything gets stripped from builds.
     
    okanc likes this.
  36. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,535
    Just another issue with bundling Odin, is that I get a bad error
    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. UnityEditor.DelayedCallback.Update () (at <ae11075fb7224233bbedf2dc2ef9224c>:0)
    3. System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <437ba245d8404784b9fbab9b439ac908>:0)
    4. Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    5. System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <437ba245d8404784b9fbab9b439ac908>:0)
    6. System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <437ba245d8404784b9fbab9b439ac908>:0)
    7. System.Delegate.DynamicInvokeImpl (System.Object[] args) (at <437ba245d8404784b9fbab9b439ac908>:0)
    8. System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) (at <437ba245d8404784b9fbab9b439ac908>:0)
    9. System.Delegate.DynamicInvoke (System.Object[] args) (at <437ba245d8404784b9fbab9b439ac908>:0)
    10. UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at <ae11075fb7224233bbedf2dc2ef9224c>:0)
    11.  
    with Odin Inspector in a project on 2020.1.a24 during runtime playback, bug is reported with Unity, but doesn't looking like Sirenx can fix this one... Anyway after removing Odin from the project I was still getting error until I found that your asset was including the dll aswel, which meant I had to remove your asset aswel. Would be nice to still use Power Inspector if I'm not using Odin in the project really.. atleast until its fixed.
     
  37. SisusCo

    SisusCo

    Joined:
    Jan 29, 2019
    Posts:
    431
    @Player7
    Hm, yeah... since there have been issues with the Odin Serializer before there's now an easy(-ish) way to fully remove it from Power Inspector. As a temporary workaround, this can be done by following these steps:
    1. Add DONT_USE_ODIN_SERIALIZER to Scripting Define Symbols in Player settings.
    2. Delete the demo scene and all related assets at Assets\Sisus\Power Inspector\Demo.
    3. Delete Odin Serializer at Assets\Sisus\Power Inspector\Code\HelperAssets\Sirenix.
    I'm still using the Odin Serializer in a couple of places, like when copy-pasting certain UnityEngine.Object targets, and as an easy way to serialize dictionaries and such in the demo scene. I used to rely on it much more, but I have now tinkered with Json.NET enough so that it seems to be able to handle serializing pretty much anything that is thrown at it.

    So it is possible that some side effects could occur from removing Odin Serializer, but they should be on the rare side. Something along the lines of copy-paste of some UnityEngine.Object targets not including non-public fields.


    I might be able to remove Odin Serializer completely from the project nowadays, but first I'll need to do some testing and make sure there are no side effects.
     
  38. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,535
    ok, well might have to use that in the future but I've gone back to 2019.3 for now as 2020.1 was getting to many issues for me to bother trying to stay on it.

    Anyway Power Inspector does seem to be bit more heavy as inspector than the default, as an example the Enviro https://assetstore.unity.com/packages/tools/particles-effects/enviro-sky-and-weather-33963 when the main component is active on power inspector profiler shows the editor taking over 100-150ms every frame, with the default inspector it is around 30ms with spikes at over 100ms, it obviously more usable and less laggy to make changes in the inspector. Is there anything you would suggest other asset developers with the way they make there components.. Enviro literately just bundles everything into an inspector view where all settings for things are there... so its very heavy, just wondering if there maybe more performant ways of doing this so it isn't dragging the editor responsive down so much.
     
  39. SisusCo

    SisusCo

    Joined:
    Jan 29, 2019
    Posts:
    431
    @Player7
    Unfortunately I don't own Enviro so I can't do the same AB test or any in-depth profiling with it.

    I have put a lot of time and effort into optimizing Power Inspector in various ways. For example things that are off-screen are not drawn at all when possible to save performance, and I have avoided using GUILayout like the coronavirus because it is not that well optimized. Even with all the optimizations I'm doing Unity's internal inspector is still faster to a degree, but this should only really become noticeable when inspecting classes with huge amounts of data.

    I haven't measured exact response times for comparison between Power Inspector and the default inspector, so I'm not sure if 30ms vs 100-150ms are normal numbers. I can tell you that in my own use Power Inspector rarely starts getting sluggish, only in pretty extreme cases when there are more than a hundred fields shown simultaneously in the inspector, like with more than a dozen unfolded components or something like that.

    I could do some stress testing to try and see if there are specific drawers that could use some further optimization to gradually improve overall performance.

    In the future converting all drawers to use UIElements could bring some performance improvements, though that would be such a gargantuan undertaking that I'm not quite sure yet if it is really a reasonable option.
     
  40. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,535
    Oh right, I mean I prefer power inspector, but maybe for these problem assets that absolutely load up an inspector view, maybe some option of marking them, so selecting them in hierarchy could default to opening those marked gameobjects/prefabs in default inspector instead (I currently have both the power inspector and default inspector in tabs on the same panel as a workaround to switch myself when working with some of them) but if power inspector could just fallback to showing the default inspector in the same power inspector tab it would be better, I understand is only so much that can be done to provide better features than the default without performance issues.

    anyway I'll send you a pm
     
  41. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    830
    FYI all the images in your first post (and all posts up until the Nov 8, 2019 post) are showing up as broken links. I thikn you've got some javascript blokcer running, prevenitng sites from opening the images?

    On Nov 8th, your images are being displayed as plain images and work fine, but everything else is hosed (so you're missing out on at least some people seeing any of the screensnhots in your main post)
     
  42. SisusCo

    SisusCo

    Joined:
    Jan 29, 2019
    Posts:
    431
    Thanks for letting me know! I just noticed the same issue in another place and we are working on getting it fixed asap. We had to switch our hosting platform recently, and some of the images here that are hosted on our severs didn't seem to agree with the change.
     
  43. SisusCo

    SisusCo

    Joined:
    Jan 29, 2019
    Posts:
    431
    Right, that makes sense. Yeah it could definitely be possible to add a system where you could blacklist certain Object types. I'm wondering what the ideal behavior would be when a blacklisted Object is encountered though. I can think of a couple of different ways to handle the situation:
    1. Display the target in Power Inspector but using its default Editor instead of Power Inspector's own drawers.
    2. Completely ignore the selection, locking Power Inspector to display the previous target.
    3. If a target with a blacklisted component is selected, display the GameObject and all of its components except for the blacklisted ones, and show a message like "Some components are blacklisted and not shown." - similar to the info box you see when you select multiple targets with mixed components.
    4. Actually temporarily swap Power Inspector window with the default inspector window somehow.
    1. Seems like the most seamless option to me, with the user not necessarily even noticing anything out of the ordinary happening behind the scenes.
    You could also use this same system to disable certain drawers even if you're not having any performance issues, if e.g. you just prefer the default Editor for some reason.
    The only downside I can think of is that if slowdowns are occurring due to the huge number of components existing on a GameObject instead of the huge number of field drawers being used, then this method wouldn't be of much help necessarily. I could do some testing to see how many components using default Editors are needed until Power Inspector starts showing signs of slowing down.

    I'm afraid that 2. isn't intuitive enough, could lead to user confusion when you don't understand why your selection change is having no effect. This could perhaps be alleviated with a text popup notifying the user why the new selection is being ignored.

    3. seems like a pretty good and intuitive solution. It partially suffers from the same problem as solution 1., but as drawing blacklisted components would be skipped completely it might help a bit more with performance in that scenario. It's much more disruptive than solution 1. though in that you'll always need to switch over to the default inspector to view any blacklisted components.

    4. could work by automatically finding an existing default inspector window in the same tab area where Power Inspector is, and if one is not found creating a new one, then making it the active tab. Once the blacklisted target is deselected Power Inspector could automatically be made the active tab again.
    This feels pretty hack-y and weird in my opinion. Although workflow-wise I guess it would be one of the less disruptive ones, as you wouldn't need to manually open the default inspector or switch focus to an existing one.

    I'm thinking that solution 1 would be the best one of these to implement.
     
  44. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,535
    Yeah solution 1 does seem best and easiest to implement?

    For me if just the component that is troublesome in performance/or future layout issue bugs etc and that could use the default inspector layout, ie that entire component goes back to default inspector layout.. while other non blacklisted components feature the powerinspector improvements, that would be ideal... more hybrid approach if it were possible
     
    SisusCo likes this.
  45. Stexe

    Stexe

    Joined:
    Feb 2, 2014
    Posts:
    118
    Haven't checked to see if others have this error, but this is what I'm having:

    Code (CSharp):
    1. You cannot call GetLast immediately after beginning a group.
    2. UnityEngine.GUILayoutUtility:GetLastRect()
    3. Sisus.EditorGUIDrawer:AssetHeader(Rect, Editor) (at Assets/Plugins/Sisus/Power Inspector/Code/Editor/DrawGUI/EditorGUIDrawer.cs:447)
    4. Sisus.CustomEditorAssetDrawer:DrawHeaderBase(Rect) (at Assets/Plugins/Sisus/Power Inspector/Code/Editor/Drawers/UnityObject/Asset/CustomEditor/CustomEditorAssetDrawer.cs:531)
    5. Sisus.UnityObjectDrawer`2:DrawPrefix(Rect) (at Assets/Plugins/Sisus/Power Inspector/Code/Editor/Drawers/UnityObject/UnityObjectDrawer.cs:1738)
    6. Sisus.CustomEditorBaseDrawer`2:DrawPrefix(Rect) (at Assets/Plugins/Sisus/Power Inspector/Code/Editor/Drawers/UnityObject/CustomEditorBaseDrawer.cs:664)
    7. Sisus.CustomEditorAssetDrawer:DrawPrefix(Rect) (at Assets/Plugins/Sisus/Power Inspector/Code/Editor/Drawers/UnityObject/Asset/CustomEditor/CustomEditorAssetDrawer.cs:610)
    8. Sisus.CustomEditorBaseDrawer`2:Draw(Rect) (at Assets/Plugins/Sisus/Power Inspector/Code/Editor/Drawers/UnityObject/CustomEditorBaseDrawer.cs:603)
    9. Sisus.GameObjectDrawer:DrawBody(Rect) (at Assets/Plugins/Sisus/Power Inspector/Code/Editor/Drawers/UnityObject/GameObject/GameObjectDrawer.cs:1781)
    10. Sisus.GameObjectDrawer:Draw(Rect) (at Assets/Plugins/Sisus/Power Inspector/Code/Editor/Drawers/UnityObject/GameObject/GameObjectDrawer.cs:1592)
    11. Sisus.Inspector:DrawViewport() (at Assets/Plugins/Sisus/Power Inspector/Code/Editor/Inspector/Core/Inspector.cs:1831)
    12. Sisus.Inspector:DrawViewport(Rect) (at Assets/Plugins/Sisus/Power Inspector/Code/Editor/Inspector/Core/Inspector.cs:1756)
    13. Sisus.PowerInspector:OnGUI(Rect, Boolean) (at Assets/Plugins/Sisus/Power Inspector/Code/Editor/Inspector/Power Inspector/PowerInspector.cs:144)
    14. Sisus.InspectorDrawerWindow:OnGUI() (at Assets/Plugins/Sisus/Power Inspector/Code/Editor/EditorWindow/InspectorDrawerWindow.cs:1775)
    15. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
    16.  
    I get it when selecting a Sprite GameObject in the Hierarchy that is a child of the Main Camera and as long as I have that GameObject selected it throws an error every frame it seems. Not a huge deal, just thought I should let you know.
     
  46. SpyrosUn

    SpyrosUn

    Joined:
    Nov 20, 2016
    Posts:
    124
    Hi ! When opening a prefab on the Power inspector, I am getting this error :

    InvalidCastException: Specified cast is not valid.

    showing up pretty much every frame. Is this a known bug maybe ? (Works fine in the default inspector tab)

    Thinking it may be some sort of custom drawer conflict from the top down engine. The error originates here(last line) :


    Code (CSharp):
    1.     [CustomPropertyDrawer (typeof(MMInformationAttribute))]
    2.     /// <summary>
    3.     /// This class allows the display of a message box (warning, info, error...) next to a property (before or after)
    4.     /// </summary>
    5.     public class MMInformationAttributeDrawer : PropertyDrawer
    6.     {
    7.         // determines the space after the help box, the space before the text box, and the width of the help box icon
    8.         const int spaceBeforeTheTextBox = 5;
    9.         const int spaceAfterTheTextBox = 10;
    10.         const int iconWidth = 55;
    11.  
    12.         MMInformationAttribute informationAttribute { get { return ((MMInformationAttribute)attribute); } }
    13.  
    Thanks !


    EDIT: Not sure why, but it did open the prefab on the power inspector after browsing around other game objects. Before doing so, it did some weird shuffle like glitch on the editor. Maybe worth taking a look at, something is definitely going on there.
     
    Last edited: Mar 21, 2020
  47. SpyrosUn

    SpyrosUn

    Joined:
    Nov 20, 2016
    Posts:
    124
  48. SisusCo

    SisusCo

    Joined:
    Jan 29, 2019
    Posts:
    431
    Hi Stexe! Have you already updated to version 1.3.4? I think that the issue you're describing has already been fixed in the latest version.
     
  49. SisusCo

    SisusCo

    Joined:
    Jan 29, 2019
    Posts:
    431
    Hi @SpyrosUn

    Could you also make sure you have updated to version 1.3.4? The mesh leak bug looks like it might be related to a bug in an older version that could prevent custom Editors from being used inside Power Inspector if you also had Odin installed in the project.

    If updating doesn't resolve all of your problems could you try to recreate the errors you're experiencing and them PM me your Editor.log file? Being able to see the full stack traces for the errors inside the log would help me a lot in tracking the sources of the bugs.

    On windows the log file is located at:
    C:\Users\[UserName]\AppData\Local\Unity\Editor\Editor.log​

    Thanks!
     
  50. Stexe

    Stexe

    Joined:
    Feb 2, 2014
    Posts:
    118
    Yup. I'm on the latest version. I'm using Hierarchy Pro. Don't know if that is contributing to it or not.
     
unityunity