Search Unity

[RELEASED] Odin Inspector & Serializer - The Ultimate Workflow Tool ★★★★★

Discussion in 'Assets and Asset Store' started by jorisshh, Jun 15, 2017.

  1. NS24

    NS24

    Joined:
    Feb 21, 2018
    Posts:
    14
  2. totsboy

    totsboy

    Joined:
    Jul 12, 2013
    Posts:
    248
    I am having an issue where the unity editor stops responding and I have to force close it when I use
    Code (CSharp):
    1. byte[] bytes = SerializationUtility.SerializeValue(data, DataFormat.Binary);
    It used to work normally before, not sure what could have affected it now. The weird thing is it still works nomally when I have a build of the game, the issue is only in the editor.
     
  3. smada-luap

    smada-luap

    Joined:
    Aug 22, 2013
    Posts:
    943
    Apologies if the solution is mentioned somewhere and if so, can you please point me in the direction of it? Thanks.

    What I'm wondering is that is it possible for Odin to specifically ignore a certain c# script and not change the inspector view for it. I have a couple of scripts with custom inspector editor files and having Odin installed it overrides what I have designed for those scripts.

    Thanks.
     
  4. jacwilso

    jacwilso

    Joined:
    Dec 24, 2016
    Posts:
    1
    I was wondering if someone could help me, I'm relatively new to Odin so this might be relatively simple, but what I want is to only use reference types for a field. I am using `Copy Reference` right now, but I don't want to have to go through menus to get that reference, I want the field to only accept reference types (and not be able to create new types). Is that possible?
     
  5. wheee09

    wheee09

    Joined:
    May 21, 2018
    Posts:
    22
    Quick question - are there any future plans to switch to UIElements?

    I hoping yes... and if that's the case, you know when? Asking mainly because my use case is for Editor Only mode.
     
  6. twiddle87

    twiddle87

    Joined:
    May 16, 2019
    Posts:
    1
    Any chance we can have TypeDrawer/TypeSelector implement filtering support?
    Long-term, I'd like to be able to do something like the following:

    Code (CSharp):
    1.  
    2. [SubclassOf(typeof(GameplayAttribute))]
    3. public Type ModifiedAttribute;
    4.  
    Your current TypeFilter attribute only works on instances rather than variables of type Type, which means I can't use it.

    TypeDrawer does most of what I want, but it has no way to restrict the types shown that I can see.

    Ideally there'd be an AttributeValueDrawer based TypeDrawer that can query its attribute for a base class, then forward that onto a new TypeSelector constructor that can then filter the list of types itself. Alternatively the attribute could specify a predicate method that the TypeSelector could defer filtering to.

    I can extend TypeDrawer such that it fetches an explicit list of types and passes that through to the selector, but at the moment that requires me to reimplement DrawPropertyLayout just to change which constructor is used when you create `TypeSelector selector` (TypeDrawer.cs:70).
     
  7. pdyatlov

    pdyatlov

    Joined:
    May 9, 2019
    Posts:
    4
    Odin does not compile its assemblies. Any help ?

    upload_2019-5-25_22-26-12.png
     
    luispedrofonseca and Nyphur like this.
  8. justtime

    justtime

    Joined:
    Oct 6, 2013
    Posts:
    240
    Hi there!
    I have public enum TrackKey in [System.Serializable] public class Track. Here the settings screen

    "Track" i've added manually, because wasn't added anything after scan.I also tried to add "Track.TrackKey"

    Here my error on il2cpp build
    Code (CSharp):
    1. No AOT serializer was pre-generated for the type 'Track.TrackKey'. Please use Odin's AOT generation feature to generate an AOT dll before building, and ensure that 'Track.TrackKey' is in the list of supported types after a scan. If it is not, please report an issue and add it to the list manually.
     
    Last edited: May 25, 2019
  9. Feldruebe

    Feldruebe

    Joined:
    Jun 11, 2015
    Posts:
    1
    Hi,

    im using Odin to use properties in Unity and its editor.
    Until now all worked greate. But if i want to use it for a list of a custom class i cannot add items with the + button.



    Code (CSharp):
    1. [SerializeField, HideInInspector] private List<TestClass> test;
    2.  
    3. [ShowInInspector]
    4. public List<TestClass> Test
    5. {
    6.     get => this.test;
    7.     set => this.test = value;
    8. }
    9.  
    10. [Serializable]
    11. public class TestClass
    12. {
    13.     public int t;
    14. }
    Strangely i can add items by right click and use "Set collection size".
    Do i miss something?
     
  10. tempbuffer

    tempbuffer

    Joined:
    Dec 6, 2012
    Posts:
    14
    Hi,

    I'm new to Odin inspector but I've used Full Inspector in one of my project. I found that 'fiValue' of FullInspector is very useful if I only want to use a non-unity serializer for some specific fields rather than whole MonoBehaviour or ScriptableObject.

    In a nutshell, Is there a similar solution for Odin inspector as fiValue for FullInspector to only use custom serializer for specific fields?
     
  11. sarebots2

    sarebots2

    Joined:
    Jul 4, 2016
    Posts:
    23
    Hi,

    New to Odin, I saw a video about Odin that showed an object placement demo scene. That looked really useful and I figured I can probably use it for some level design in my project, but I can't seem to be able to find it in v2.0.20. Can you let me know how to import it?

    Thanks

    P.S. Video Showing the object placement scene:
     
  12. Nyphur

    Nyphur

    Joined:
    Jan 29, 2016
    Posts:
    20
    Same happening here. I assume that it's just not compatible yet with 2019.2?
     
    luispedrofonseca likes this.
  13. ktest112233

    ktest112233

    Joined:
    Jan 7, 2019
    Posts:
    27
    Hi,

    Does the serializer work on Animation Curves?
    I would like to serialize and save to file.. possible to do it?
     
  14. Waz

    Waz

    Joined:
    May 1, 2010
    Posts:
    252
    Odin 2.1 beta is looking awesome. Hanging for the release... $property looks game-changing (but it's not in the beta, right?)
     
  15. Waz

    Waz

    Joined:
    May 1, 2010
    Posts:
    252
    The 2.1 beta seems to be working reasonably well with 2019.2, just a few fails.
     
  16. vampir26

    vampir26

    Joined:
    Mar 29, 2010
    Posts:
    84
    Same problem here.
     
  17. wesley_unity341

    wesley_unity341

    Joined:
    Dec 14, 2018
    Posts:
    9
    Is there a way to filter objects by monobehaviour when selection a new object in a PreviewField? For example, a GameObject with some MonoBehaviour (TestClass for example) and it exists in the project.
     
  18. Dark_Swordsman

    Dark_Swordsman

    Joined:
    Dec 4, 2018
    Posts:
    23
    Hi, I have encountered bug with the CustomValueDrawer attribute, it seems that polymorphic fields aren't handled properly:

    Code (CSharp):
    1. class A {}
    2. class B : A {}
    3.  
    4. class C
    5. {
    6.      [CustomValueDrawer("DrawSelector")
    7.      A _myA;
    8.  
    9.      private A DrawSelector(A value, GUIContent label)
    10.      {
    11.          return (A)EditorGUILayout.ObjectField(label, value, typeof(A), false);
    12.      }
    13. }
    When assigning an object of type B, the drawer fails and shows an error: "... must have the following parameters: B, GUIContent"

    It looks like your validation is missing a check if the parameter is assignable from the actual type.

    Similar issue with AssetList(CustomFilterMethod)
     
    Last edited: Aug 12, 2019
    Prodigga likes this.