Odin Inspector Version 2.1.7

Features

  • Buttons can now display the result of invoking them in the inspector - this is particularly useful in the static inspector. This new feature is enabled by default, and can be toggled in the General Drawer preferences under the General tab. The behaviour can also be toggled on or off on a case-by-case basis using the new DrawResult parameter on the [Button] attribute.

Optimization

  • Massive optimizations to Odin initialization - depending on your project, Odin might initialize several times faster than before. (That is, the lag spike you get the first time you open an inspector after a script reload should be a lot smaller.)
  • All LINQ has been removed completely from Odin's static initialization methods, and they have been hand-optimized to remove excess work.
  • Made all utility methods in TypeExtensions that check for implementations and get arguments of open generic types/classes/interfaces a lot faster.
  • Odin now uses Unity's TypeCache utility for faster reflection queries if it is present in the current Unity version.
  • TypeSearchIndex now keeps all indexed types in pre-sorted order, making search queries a bit faster since they don't need to be sorted after type matching has taken place.
  • OdinSerializeAttributeWarningDrawer no longer enters the drawer chain in cases where it would not be drawn.

Add

  • Added OdinMenuStyle.LabelVerticalOffset.
  • Added UnityTypeCacheUtility class for using Unity's TypeCache utility if it is present in the current Unity version.
  • Odin Validator will now add its own scripting preprocessor define "ODIN_VALIDATOR" when it is installed. Similar to the ODIN_INSPECTOR define, the implementing code lives in a script called 'EnsureOdinValidatorDefine.cs', which contains well-commented code that the user can edit to suit their particular use case.

Fixes

  • Added compatibility with Unity 2020.1.0a14, where Unity changed EditorApplication.delayCall from a field to an event and changed the delegate type from EditorApplication.CallbackFunction to System.Action, breaking all assemblies compiled for earlier versions of Unity. This field/event is accessed through reflection now.
  • Fixed issue where the Getting Started window wouldn't load correctly at first in 2019.3.3f
  • [OnValueChanged] is now invoked when removing elements from a list through a CustomRemoveIndexFunction or CustomRemoveElementFunction applied with [ListDrawerSettings].
  • Fixed an issue where enabling Editor Only Mode would fail if it was faultily "partially" enabled, with script files already existing where they were supposed to be moved to.
  • Fixed case where Unity Object Preview Fields being displayed suddenly (such as when opening a dropdown) would sometimes cause an exception to be thrown due to no current window/view being set internally in Unity's GUI state.
  • Fixed error in the expression compiler where it would fail to resolve identifiers that referenced virtual properties with multiple implementations.
  • Fixed error where [DisplayAsText] with overflow set to false would have incorrect label padding, resulting in weird offsets compared to other labels.
  • Fixed the General Drawer settings 'Square Unity Object Alignment' and 'Enable Globally For' under tab 'Object Fields' not persisting properly across reloads when changed.
  • Fixed the SirenixEditorFields.FolderPathField(Rect, string, string, bool, bool) overload erroneously calling itself and causing a stack overflow exception - it now passes the call onto the correct overload.
  • Odin is now overall a lot better at detecting when a thrown exception has deeply nested ExitGUIExceptions as inner exceptions.
  • Odin will now not show buttons for generic method definitions, neither in the normal nor static inspector, since they cannot be invoked.
  • The [DrawWithUnity] attribute will now correctly cause the asset/scene to become dirty when its value is changed, in the case where Odin is the serialization backend of the displayed property.
  • The attribute overview will no longer break if an assembly is loaded that has broken metadata.
  • The ListDrawerSettings info box is now displayed properly at the top of the General drawer settings 'Collection' tab, instead of two properties down.
  • The TypeFilterAttributeDrawer no longer applies to (and throws exceptions for) properties that have no ValueEntry.
  • Unity-serialized dictionaries (via custom, hand-coded serialization methods) will no longer try to faultily register Odin prefab modifications when changed in prefab instances.
  • InlineEditor will now draw previews for GameObjects in the scene when preview is turned on.

Odin Inspector Version 2.1.6

Improvements

  • PrimitiveValueConflictDrawer, ReferencePathConflictDrawer and ReferenceValueConflictDrawer will no longer be part of the drawer chain for properties in a PropertyTree that has only one target, since conflicts cannot occur in those cases anyways.
  • Moved the AssemblyUtilities class from the Sirenix.Utilities assembly to the Sirenix.Utilities.Editor assembly. This is the first part of a planned drastic reduction in the contents of the Sirenix.Utilities assembly, which will end with it being stripped down to only GlobalConfig<T> and its direct dependencies.
  • Fixed a number of UI issues with Unity 2019.3+.

Fixes

  • Added extra safety around querying assemblies for types and attributes. Broken/invalid assemblies with bad metadata being loaded should no longer break any of the code that iterates over all loaded assemblies. This fixes the MissingMethodExceptions people were getting from the UnityAPICompatibilityVersion attribute when they installed various other plugins or packages for Unity.
  • Fixed issue where OnValueChanged callback would not be invoked on undo and redo.
  • Fixed null reference in File and FolderPath validators.
  • Fixed possible threading race condition in AssemblyUtilities initialization, that would sometimes cause a deadlock in old Unity runtimes (issue observed in Unity 5.6). The issue was that Thread.Join() does not seem to always work properly in old Unity Mono runtimes. A manual, "naive" thread join has been implemented instead.
  • Fixed typos in SirenixGUIStyles style names.

Odin Inspector Version 2.1.5

Optimization

  • The Cache<T> is now *significantly* faster at claiming and releasing cached values.

Improvements

  • Changed the priority of Odin's UnityEventDrawer to (0, 0, 0.45), so user code can declare a custom property drawer for UnityEvent and have it override Odin's UnityEventDrawer by default. This decision was made since Odin's drawer just draws the Unity event as it would have been drawn by Unity itself anyways, and therefore any global UnityEvent customization from a custom legacy property drawer should override Odin's drawer.
  • Made parts of the ImportSettingsConfig class public, so users with complex custom build pipelines can invoke it to automatically configure Odin's import settings at a time of their choosing.
  • The priority of legacy property drawers declared by Unity itself are now penalized by (0, 0, -0.1), so that legacy property drawers declared by user code have a higher priority by default.

Fixes

  • Attributes defined on interface type declarations now also gets included on members of that interface type.
  • Corrected DisplayAsString's documentation to correctly define the behaviour of the Overflow member.
  • Fixed a bug in TypeExtensions.TryInferGenericParameters, where it would sometimes succeed erroneously when given a partially constructed generic type, that has another partially constructed generic type as one of its constructed arguments.
  • Fixed a bug where dragging from various Odin rendered ObjectFields didn't work on Mac.
  • Fixed a bug where dragging to various Odin rendered object fields didn't always properly highlight that drop-zone when you're about to drop an item.
  • Fixed a bug where some attribute expressions wouldn't work on list elements.
  • Fixed bug where, in an OnValueChanged callback overload that takes the changed value as an argument, changes made to a 'this' struct instance in the callback would not be preserved.
  • Fixed error where value changes made during an invocation of [OnInspectorGUI] on a struct would be lost.
  • Fixed expression compiler error where using a unary operator such as '!' on the last "part" of a boolean expression of a ternary condition would cause the compiler to throw errors.
  • Fixed InspectorPropertyInfo.CreateValue not setting the order parameter that it is given on the resulting property info.
  • Fixed null reference in File and FolderPath validators.
  • Fixed subtle thread safety issue in Cache<T> where ICacheNotificationReceiver.OnFreed could be invoked during/after the cached instance had already been claimed again. This rare issue only happened in cases where the cache was really being soaked with claims and frees from many threads at once.
  • Methods invoked by clicking a button in the inspector no longer swallow all exceptions that are not an ExitGUIException.
  • Properties cached by path, that are no longer reachable when looked up, are now removed from the cache once their non-reachability is determined.
  • Removed errant debug log that would happen when a cached property is no longer reachable from the root.
  • Removed errant logging statement that happens when a property is found in a path lookup cache but is no longer reachable from the tree root.
  • Value changes made only through the SerializedProperty API in legacy CustomPropertyDrawers now correctly trigger invocation of the [OnValueChanged] attribute.

Odin Inspector Version 2.1.4

Improvements

  • All C# files now include #pragma warning disable when built for Source Code.
  • GUIHelper.ContextWidth no longer has a setter, to reflect internal changes made in Unity 2019.3. Use the new GUIHelper.PushContextWidth and PopContextWidth to adjust the context width instead.
  • Removed [Obsolete] from AssetUtilities.GetAllAssetsOfType and AssetUtilities.GetAllAssetsOfTypeWithProgress, since they perform a very real and useful function.
  • Attribute Overview documentations buttons now link to odininspector.com/attributes instead of odininspector.com/documentation.
  • Refactored CustomContextMenuAttributeDrawer for more modern Odin practices and better performance.
  • Odin's AnimationCurveDrawer now tracks changes to inspected AnimationCurves not made manually through the editor, and forces Unity to update all AnimationCurve previews whenever such a change happens.

Fixes

  • Added missing RegisterValidator attributes for File- and FolderPathValidator classes.
  • AssetSelector now works with interface fields.
  • AssetUtilities.GetAllAssetsOfType and AssetUtilities.GetAllAssetsOfTypeWithProgress now correctly distinguishes cases where it should use type.FullName vs type.Name for an asset database query. This fixes the bug where [AssetList] could not properly find any Unity-defined ScriptableObject asset types such as Sprite and Material.
  • Fixed a bug in 2019.2 where IMGUI Containers will sometimes draw Odin without any current window. Causing various null references exceptions to occur. Odin no longer requires a Current Window to be present.
  • Fixed a Source Code build issue where files would have two copyright headers.
  • Fixed GUIHelper static initializer breaking in newer versions of the Unity 2019.3 alpha.
  • Fixed an issue where users couldn't click bool label-less and indented checkboxes.

Odin Inspector Version 2.1.3

Fixes

  • Automated AOT support no longer throws an ExitGUIException at build time after generating a DLL.
  • The DictionaryDrawer now only applies to properties that actually have the appropriate StrongDictionaryPropertyResolver as child resolver. This fixes the bug where Unity objects that implemented the IDictionary<TKey, TValue> would show up as dictionaries in the inspector.
  • The [CustomValueDrawer] attribute now supports polymorphism in the drawn member, and always requires a custom drawer method for the member type, not the type of the actual value in the member.

Odin Inspector Version 2.1.2

Highlights

  • Unity 2019.2 support
  • Major initialization performance improvements and more coming soon

Improvements

  • Initialization of InspectorTypeDrawingConfigDrawer is now roughly twice as fast as it was before; depending on the amount of types in your project, this can shave a few dozen to several hundred milliseconds off of your script reload times.
  • If a TargetInvocationException is thrown during validation, the validation system will display the inner exception instead of the invocation exception.
  • TableMatrix.DrawElementMethod now accepts a method overload which provides the array and index to draw, instead of the value.

Fixes

  • Fixed a bug in 2019.2 where IMGUI Containers will sometimes draw Odin without any current window. Causing various null references exceptions to occur. Odin no longer requires a Current Window to be present.
  • AOT support generation now directly references base class functionality which it will need. Usually, merely referencing a derived class is enough, but certain base class methods wouldn't be referenced properly when generating IL2CPP builds for PS4, unless they were referenced directly.
  • AOT support generation will now also generate basic support needed for serializing abstract types.
  • Fixed bug in the expression compiler where compiling would throw an exception if a method called with explicit generic arguments had a non-generic overload.
  • Fixed bug in the expression compiler where either side of the "&&" and "||" logical operators would not be implicitly converted to bool when necessary.
  • Fixed issue on AOT platforms where using tags like [OnSerialized] and [OnDeserialized] in a type would throw JIT-related exceptions during static initialization of formatters for that type.
  • Fixed issue where serialization would throw exceptions while claiming objects from the Cache<T> class on Playstation 4 (in both Mono and IL2CPP builds), due to seemingly-wonky handling of generics on PS4.
  • GUI layout exceptions and invalid GUI stack state exceptions are no longer thrown when clicking "Generate DLL" in the AOT Generation preferences.
  • If an ExitGUIException is thrown during a GUI button click, the exception will now correctly be rethrown.
  • Odin's About and Getting Started windows will now correctly display the currently installed version of Odin again.
  • The AlwaysFormatsSelf attribute can now also be applied on structs.

Odin Inspector Version 2.1.1

Improvements

  • Added try/catch and debug logging to the case where a base64-encoded string/binary blob is invalid.
  • Odin will try to deserialize with the byte[] data before the base64 string, if there is byte[] data, and will not skip byte[] if it does exist under any circumstances.

Fixes

  • Worked around the issue where accessing DateTime.Now early on the Unity loading/deserialization thread would cause Unity to throw internal exceptions - a "timeless" int counter is now used as there is no longer a safe way to access DateTime.Now or any similar time concept on non-main threads in Unity.
  • Fixed a bug where the ColorPaletteAttribute would sometimes cause other GUI elements to not work properly.
  • Fixed a bug where message boxes in the inspector could cause strange indent issues.
  • Fixed error where [AssetList] would not work for GameObject and List<GameObject>.
  • Fixed issue where marking a nullable value type such as "float?" with [ReadOnly] would cause it to throw a ton of exceptions.
  • Fixed Odin 2.1 regression where the static inspector would no longer work properly for classes (only for structs).
  • Fixed bug in the expression compiler where compiling would throw an exception if a method called with explicit generic arguments had a non-generic overload.
  • Fixed bug in the expression compiler where either side of the "&&" and "||" logical operators would not be implicitly converted to bool when necessary.

Odin Project Validator Improvements

  • Fixed an issue where error-counts woulnd't update when rescanning a profile.
  • Added more API documention coverage for Odin Project Validator.
  • The GUI of the Validation window no longer resets every time you enter a new validation profile. It now remembers which columns were selected, how wide the side menu was and so on...
  • When running a validation profile and zero issues were found, a green '0' label will be shown next to the profile name, instead of not displaying anything.

Odin Inspector Version 2.1.0

Making sure everyone on your team sets up your data correctly when working directly with assets is made easy using the live input validation features that Odin Inspector provides. However, sometimes, warning messages get ignored, assets get deleted, requirements change, and data is made obsolete as your project grows. Slowly bugs, errors, and faulty data creep in as work progresses. Manually going through your entire project to find and correct issues can quickly grow to be an insurmountable task.

Using the Odin Project Validator, you can easily scan your entire project for warnings and errors, and fix them inline right from the validator. The validator handles scene switching and saving as you work, letting you quickly and freely navigate between all issues with no hassle and no delay.

Learn more here

New tutorials, documentation and attribute overview

Our new website has brand new searchable tutorial, documentation and attribute overview sections - check them out and learn how you can get the most out of Odin already today!

Tutorials   Attribute Overview   Documentation

Community tools

Check out our new community tools page to see all the neat things people have built with Odin and made available to the community. Create an account to submit your own tools!

Learn more here

Please note: source code is now a separate pre-configured and easy-to-use package that you can download from our website, but the source code is no longer included in the core Odin Inspector package sold here and on the Asset Store.

Everyone who has purchased Odin Inspector before the 2.1 beta started (28.05.2019) will receive the source code and Odin Project Validator addons for FREE, starting now we will be selling the source code as a separate paid package.

New Odin Inspector 2.1 Features

Expressions

Start your string with an '@' sign, and write C# directly in your attribute declaration; this works in almost all attributes that take a string. This reduces boilerplate code and introduces countless new possibilities.

Learn more here

Interactive Attributes Overview Window

You no longer need to import the demo scene; all attribute examples are now available in a window: Tools > Odin Inspector > Attributes Overview

Also see our new online attributes overview

New AssetSelector attribute

A new, simpler alternative to the AssetList attribute, the AssetSelector attribute prepends a small button next to the object field that will present the user with a customizable hierarchical dropdown of selectable assets.

Learn more here

New ChildGameObjectsOnly attribute

Avoid having to manually locate the desired object in the hierarchy, while at the same time telling your designer how your component should be used!

Learn more here

New ShowIfGroup and HideIfGroup attributes

ShowIfGroup and HideIfGroup are group attributes that allow for showing or hiding a group of properties based on a condition. They can be combined with other group attributes using group paths, and can be used this way to show or hide groups of any kind.

See ShowIfGroup examples   See HideIfGroup examples

New validation backend

Before, Odin had separate drawers for attributes such as the Required, ValidateInput and AssetsOnly attributes. Now, all of these have been turned into standalone Validators, and are drawn in the inspector by a single drawer that integrates the new validation system.

This means that you can now easily define your own validators. Errors and warnings will then automatically show up in the inspector. Furthermore, the new validation system is completely separate from the drawer system. This means that you can manually invoke the new, straight-forward validation API from anywhere to integrate project validation in your own custom workflow and build pipelines.

You can make your own AttributeValidators and ValueValidators. Below is a simple example of how you could create a validator that would display an error in the inspector if a texture too large for your game is used.

[assembly: RegisterValidator(typeof(TextureSizeValidator<>))]

public class TextureSizeValidator<T> : ValueValidator<T>
  where T : Texture
{
  protected override void Validate(T value, ValidationResult result)
  {
    if (value && value.width > 1024 && value.height > 1024)
    {
      result.Message = "We're making a mobile game for crying out loud!";
      result.ResultType = ValidationResultType.Error;
    }
  }
}

Your custom validators will also be integrated in the new Odin Project Validator.

More examples and tutorials will be added soon.

Performance Improvements

  • Odin now triggers far fewer serialization calls per frame, vastly improving performance when inspecting data-heavy objects.
  • Odin now caches property path lookups, resulting in far less time spent parsing property paths.

Additions

  • Type entries in the AOT Generation Config window as well as Type members drawn in the inspector can now parse type names written in the style of C# identifiers, IE, writing "Dictionary<int, string>" will now work.
  • Added GUIHelper.PingObject which is a more feature rich version of Unity's PingObject.
  • Added GUIHelper.SelectObject.
  • Added IfAttributeHelper class which allows for easy implementations of If style attributes.
  • Added OdinMenuTree.Selection.SelectedValue and SelectedValues.
  • Odin Selectors now displays an infobox if the selector doesn't contain any items.
  • RectExtensions.AlignCenterXY(this Rect rect, float width, float height).
  • Added ability to provide a member/expression string to the [MinValue] and [MaxValue] attributes.
  • Added HideTabGroupIfTabGroupOnlyHasOneTab to the TabGroup attribute.
  • Added MemberFinder.HasConvertableReturnType, which requires only that it is possible to convert the return type to a given type using the new ConvertUtility.
  • Added the ConvertUtility class, to provide weakly typed conversion and casting that takes all factors, declared cast operators, and possible conversions into consideration.
  • Added the GenericNumberUtility class, which provides some weakly typed number comprehension utilities.

Changes

  • Added deprecation warning to all Odin-serialized prefabs in 2018.3 and above.
  • All If- attribute drawers now use the new IfAttributeHelper class, instead of relying on PropertyContext lookups.
  • Group attributes, specifically the base PropertyGroupAttribute no longer has the JetBrains.Annotations.MeansImplicitUse attribute.
  • Removed attributes overview card from the Getting Started window, and replaced it a button to open the Attributes Overview window.
  • Removed attributes overview scene.
  • Renamed TypeInfoBoxAttributePropertyProcessorProcessor to TypeInfoBoxPropertyProcessor because was running into errors due to long path length.
  • ValueDropdownAttributeDrawer no longer invokes the referenced member twice when getting the value.
  • Dragging a value on top of a closed list now appends the value to the end of the list instead of the front.
  • Almost all of Odin's attributes can now be applied anywhere and are no longer restricted to only a subset of possible attribute application targets.
  • Changed "MISSING" text for type entries in the AOT generation config to "INVALID" to be clearer about the fact that it will do nothing.
  • InspectorProperty.Update() now returns a bool, indicating whether an update was performed or not.
  • Moved FastTypeComparer from Sirenix.OdinInspector.Editor to Sirenix.Utilities.Editor assembly.
  • Moved MemberFinder from Sirenix.Utilities to Sirenix.Utilities.Editor assembly.
  • Removed the Sirenix.Utilities.Editor.CodeGeneration namespace and all types therein, as they were an unused remnant of old systems that have since been replaced. If you were using it, you can extract the types from old versions of the source code and continue using them as you please.

Fixes

  • Fixed an issue where the effect of the TypeFilter would in some cases not be cleared and hence applied to other properties.
  • Fixed a crash when using DeepReflection on const fields.
  • Fixed divide by zero exception in RectExtensions.SplitGrid.
  • Fixed issue in 2018.3 where changing a PreviewField with the Unity object picker would sometimes change other preview fields as well.
  • Fixed a typo in FolderPath attribute drawer.
  • If an enum has a None value with [HideInInspector] on it, a new None value will no longer be injected by EnumSelector<T>.
  • Odin's default property member selection logic in InspectorPropertyInfoUtility will now always ignore properties that have index parameters.
  • TypeExtensions.GetCastMethod now also searches parent types for valid methods.
  • TypeExtensions.GetOperatorMethod and TypeExtensions.GetOperatorMethods now also search parent classes for valid operators.
  • A property's children are now disposed immediately when the property enters a value state that does not allow having children (null, reference, value conflicts).
  • AssetUtilities.GetAllAssetsOfTypeWithProgress now correctly handles cases where types with the same name exist in multiple different namespaces. #542.
  • Collection resolvers can now correctly handle the case of being asked about their child count, when the inspected collection is null.
  • Corrected spelling of ValidateInputAttribute.ContiniousValidationCheck to ContinuousValidationCheck and obsoleted the old member as a wrapping property.
  • Fixed a bug where the AssetSelector attribute would cause errors when used on components.
  • Fixed a bug where the ChildGameObjectsOnly attribute didn't work on list elements.
  • Fixed a bug where the ChildGameObjectsOnly attribute didn't work on list elements.
  • Fixed a bug where the MinMaxSlider attribute would clamp the values while you where entering numbers in the fields.
  • Fixed bug where a ColorBlock being drawn by the Unity PropertyDrawer legacy support system would cause an exception to be thrown any time a color value in the block is changed.
  • Fixed various places in the code where InspectorProperty.Info.GetAttribute<T>() method was being used instead of the more correct InspectorProperty.GetAttribute<T>() method. This was causing some attributes to not register correctly some places when added through a self property attribute processor.
  • Odin now uses PropertyHandler.GetHeight() to calculate the height for legacy Unity property drawers (when available), for its Unity property drawer backwards compatibility system. This means that property drawers which call EditorGUI.GetPropertyHeight() with their own property in a PropertyDrawer.GetPropertyHeight() override to calculate their drawing height, will no longer see a duplicate recursive call to PropertyDrawer.GetPropertyHeight() from that call, and they will be calculating the correct property height.
  • Properties returned by path through the PropertyTree path lookup methods GetPropertyAtPath, GetPropertyAtUnityPath and GetPropertyAtPrefabModificationPath are now always guaranteed to be reachable from the tree root - before, the newly introduced path-to-property cache might return invalid properties that were no longer reachable from the tree root.
  • Removed all API calls that were causing the assembly updater to need to run during import. This should fix Unity 2019.3 crashing during import of Odin, and should also mean that the assembly updater no longer asks to upgrade Odin assemblies during import.
  • Removed all references to the UnityEngine.UI assembly. Old functionality that used UnityEngine.UI is now weakly typed by reflection, and conditional on the assembly being loaded by Unity.
  • Setting a new value to a dictionary on a prefab instance now correctly sets the value that was constructed before adding, instead of default(TKey) - this fixes a regression that was likely introduced somewhere in between 2.0.10 and 2.0.20.
  • ValueDropdown now updates cached value names when the dropdown is opened; this means the label on the dropdown will now reflect the last collection passed to the dropdown.

Beta fixes

  • Fixed case where a validation scan would error when recursively validating a type which implemented only ICollection<T> but not ICollection or another other common collection interfaces.
  • Fixed a bug were the opening the Odin Project Validator window would undock it if it was already docked instead of focusing it.
  • Fixed issue where validation overview would break if any validator threw an exception the first time it ran.
  • The scene setup will now be properly restored when a scene validation profile is cancelled mid-validation.