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
    I tried commenting out the code in Editor.cs but it appears just the same. Very weird.
     
  2. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    Try ObjectDrawer.cs then. That's really the only other option.
     
  3. dock

    dock

    Joined:
    Jan 2, 2008
    Posts:
    605
    This 'fixes it' but it takes away IG's nested references.
    I don't mind too much tbh. The most important thing is that I have the useful nested references.
     
  4. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    I have a potential solution which I could implement for the next version.

    First you need to get the type and assembly name of whatever
    PropertyDrawer
    class SOAP is using. I could implement a system to let you pick from a dropdown menu in the Preferences window, but for now just add this method to any script and run the
    Test/Log All Property Drawer Types
    menu function it adds:
    Code (CSharp):
    1. [MenuItem("Test/Log All Property Drawer Types")]
    2. private static void LogAllPropertyDrawerTypes()
    3. {
    4.     foreach (var type in TypeCache.GetTypesDerivedFrom<PropertyDrawer>())
    5.     {
    6.         if (type.IsAbstract)
    7.             continue;
    8.  
    9.         Debug.Log(type.AssemblyQualifiedName);
    10.     }
    11. }
    Once you find the correct class, you want the
    Namespace.ClassName, AssemblyName
    without the
    Version
    or any of the other stuff on the end.

    Then you can go to ObjectDrawer.cs and put this at the start of OnGUI (replacing the type name with the string you just got):
    Code (CSharp):
    1. private static PropertyDrawer _OtherDrawer;
    2.  
    3. public override void OnGUI(Rect area, SerializedProperty property, GUIContent label)
    4. {
    5.     if (_OtherDrawer == null)
    6.     {
    7.         var otherDrawerType = Type.GetType("Namespace.ClassName, AssemblyName");
    8.         _OtherDrawer = Activator.CreateInstance(otherDrawerType) as PropertyDrawer;
    9.     }
    Then you can replace both calls to
    EditorGUI.PropertyField
    with
    _OtherDrawer.OnGUI(fieldArea, property, label);
    .

    Let me know if that works and I'll see about implementing it properly for the next version (which is almost ready for release, I'll probably have a test version ready on the weekend).
     
  5. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    Good news everyone: Inspector Gadgets v7.0 is now available for testing. It has a few cool new features and various improvements all around. I've also moved it from Assets/Plugins into the Packages folder to get it out of the way.

    It's basically feature complete except for the potential solution to integrating with property drawers in other plugins from my previous post (pending feedback from @dock).

    It will still be a while before release as I need to work on the documentation and make a new trailer video (long overdue) so please let me know if you're interested in checking it out early. In particular, I'm keen to get feedback on the new Enhanced Hierarchy system.
     
    MariuszD and ledshok like this.
  6. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    dsilverthorn and ledshok like this.
  7. dock

    dock

    Joined:
    Jan 2, 2008
    Posts:
    605
    @Kybernetik I'm trying Inspector Gadgets in a clean unity 2022 project and Editor Nesting doesn't seem to be working, nor does the 'Get' button. there might be more problems too.

    I just switched over to a unity 2021 project and everything workds well, so I think I probably need to avoid Unity 2022 for a while.
     
  8. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    I tested in 2022 before release and haven't had any issues with nesting or the get button. Can you give any more details about the issues you're seeing?
     
  9. dock

    dock

    Joined:
    Jan 2, 2008
    Posts:
    605
    I don't know what it could have been that was causing the problem, unfortunately. I didn't have much else in the project yet.
     
  10. daenius

    daenius

    Joined:
    Sep 7, 2021
    Posts:
    11
    I have Inspector Gadget Pro and it has been an immense joy to use, thank you so much

    There is one minor issue with the custom inspector UI with FinalIK causing the Transform references to be drawn in the wrong place. Is it possible to disable the Transform drawer or maybe the ObjectReference feature for only that one component similar to Odin's [DrawWithUnity] attribute?

    This seems to only happen with a few components of FinalIK with the vast majority of them working perfectly fine. I know that's a third party package but I must add just how much Inspector Gadget Pro has helped when using FinalIK. Most of the intricate IK setup requires doing things in Play mode and saving those values so "Persist after Play mode" has been an absolute godsend.
     
  11. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    Can you post a screenshot so I can see what the problem looks like?
     
  12. daenius

    daenius

    Joined:
    Sep 7, 2021
    Posts:
    11
    Sure, here's what the "Full Body Biped IK" Component looks like normally at the bottom of this page here http://www.root-motion.com/finalikdox/html/page8.html

    This is what it looks like for me. Notice the "mysterious middle of nowhere" Transform drawers after the "Eyes" field right before the next "Root Node" field. I actually did manage to figure out what those are. They are the drawers for the "expanded" Transforms up top used in the "References" section and only show up when you expand that field. That field is in turn a `public BipedReferences references = new BipedReferences();`. The code for that class is just a bunch of Transforms

    Code (CSharp):
    1.  
    2.     [System.Serializable]
    3.     public class BipedReferences {
    4.        
    5.         #region Main Interface
    6.        
    7.         /// <summary>
    8.         /// The root transform is the parent of all the biped's bones and should be located at ground level.
    9.         /// </summary>
    10.         public Transform root;
    11.         /// <summary>
    12.         /// The pelvis (hip) bone.
    13.         /// </summary>
    14.         public Transform pelvis;
    15.         /// <summary>
    16.         /// The first bone of the left leg.
    17.         /// </summary>
    18.         public Transform leftThigh;
    19.         /// <summary>
    20.         /// The second bone of the left leg.
    21.         /// </summary>
    22.         public Transform leftCalf;
    23.         /// <summary>
    24.         /// The third bone of the left leg.
    25.         /// </summary>
    26.         public Transform leftFoot;
    27.         /// <summary>
    28.         /// The first bone of the right leg.
    29.         /// </summary>
    30.         public Transform rightThigh;
    31.         /// <summary>
    32.         /// The second bone of the right leg.
    33.         /// </summary>
    34.         public Transform rightCalf;
    35.  
    36. ... they all the same after this
    Not sure what exactly causes the drawers to all stack themselves at the bottom before the next field in the FullBodyBipedIK class, maybe because it's nested from the BipedReferences class or something, but basically you see N drawers appear for N Transform fields you click on.
     

    Attached Files:

  13. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    Unfortunately, that's a limitation of Unity's GUI system. For an individual object reference field Inspector Gadgets is able to draw the referenced object's Inspector right below the field, but doing that on an array field causes the nested Inspector to be drawn below the whole array instead.
     
  14. daenius

    daenius

    Joined:
    Sep 7, 2021
    Posts:
    11
    I see, thanks for the info! No big deal honestly, I found a workaround by simply not expanding the BipedReference class and called it a day. Between Inspector Gadget Pro and Odin I don't really need to expand that field to work with the IK targets anyway.
     
  15. MariuszD

    MariuszD

    Joined:
    Jan 8, 2016
    Posts:
    9
    Hello again!
    One thing that I would really love in one of the future versions of the plugin would be an InfoBox attribute. I know that Odin has a thing like that but am still using and loving your plugin because of its lightness.

    Basically a textfield to easily put up a manual for the designers. Currently am using few Header attributes but a more elegant solution could be highly appreciated. ;)
     
  16. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    Give this package a go. Make sure you have the latest version of IG first.
     

    Attached Files:

    MariuszD likes this.
  17. MariuszD

    MariuszD

    Joined:
    Jan 8, 2016
    Posts:
    9
    It both works and looks amazing, but one thing popped up after I upgraded the version*. That is:

    stopped working and I can't find the calls to your solution anymore. :(

    * - some really cool improvements by the way!
     
  18. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    Did you re-download it in the Package Manager? Otherwise you might still have your old version. Check the version number in the Package.json file in the Inspector Gadgets root folder. Should be 7.0.0.
     
  19. MariuszD

    MariuszD

    Joined:
    Jan 8, 2016
    Posts:
    9
    Hello! I deeply apologize, after reimporting the project it started working right as it should've. Thank you very much for your support!
     
  20. the_unity_saga

    the_unity_saga

    Joined:
    Sep 17, 2016
    Posts:
    273
    hey your asset is extremely important to my work flow

    any chance to get ETA on beta version (for most recent 2023.3.0beta)

    it says there is some error with this although it still works sort of, idk
     
  21. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    I don't usually test my assets in pre-release versions of Unity because they often introduce bugs which end up getting fixed on release if they haven't made an intentional breaking change.

    For starters, if you actually tell me what the error is I can decide if it sounds like it might be worth looking into.
     
    the_unity_saga likes this.
  22. the_unity_saga

    the_unity_saga

    Joined:
    Sep 17, 2016
    Posts:
    273
    when you put it that way, i think it is best to ignore me

    the bug is not something I could reproduce so far
    it went away when I went back to a previous version of the same project
    i give up.

    thanks
     
  23. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    2,445
    I don't get an error importing to Unity6 (6000.0 beta) but it also doesn't succeed, leaving things like CommentComponent missing on my prefabs, and of course no functionality.

    Unity 6 will be a big shift for a lot of customers as they're waiting to adopt a lot of the new features, so easing that transition may be of benefit.

    (I'm not worried ultimately, but just giving a heads-up.)
     
  24. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    Stuff not working but not giving errors definitely sounds like something to report to Unity, that's really the whole point of them releasing Beta testing versions.
     
  25. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    2,445
    Yup, I was giving you that chance to start communicating with Unity. IG is your product dependent on their platform. Best to be compatible on Day 1 they exit Beta. It almost sounded like you were waiting for your end-users to do your integration testing.
     
  26. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    I've already stated my stance on this:
    Things not working without any error message absolutely sounds like it's a Unity bug and I don't have the time or inclination to beta test Unity for free. I wouldn't ask my users to do that either, but if someone has already chosen to beta test Unity then it makes sense for them to report such bugs to Unity.