Fixed a bunch of issues with the SceneObjectsOnly attribute by utilizing the new PrefabKind from OdinPrefabUtility.
Fixed a bug in GlobalConfigUtility where it would not correctly locate and load configs from /Resources/ folders.
Fixed case where the position of Odin Validator in right click asset context menus would sometimes become the first item instead of the last.
Fixed null reference exception in GetNiceValidatorTypeName method.
Odin Inspector Version 3.1.3
Greatly reduced Odin's impact on reload times in certain kinds of projects where it would be unusually large despite only a
tiny fraction of the main thread reload time consisting of executing Odin code. This was done by removing a great deal of threaded
initialization and caching code from the AssemblyUtilities class and replacing it with simpler, fully synchronous and lazily
resolved implementations. This prevents a great deal of up-front reflection work from taking place; even though this was taking
place on another thread, exhaustive profiling indicated that it was still indirectly greatly slowing down several parts of Unity's
main thread initialization steps, such as the Burst compiler and HDRP initialization. We're unsure as to the exact runtime
mechanisms that caused this interaction, but nevertheless, in large reproduction projects set up to exhibit this behaviour, this
reduced Odin's combined direct and indirect impact on reload times from about ~8-10 seconds to about ~0-2 seconds.
The issue reporter's reported project reload times went from 15 seconds with Odin installed and 8 seconds without Odin installed,
to also being 8 seconds with Odin installed. This indicates that Odin's impact on project reload times has been rendered negligible,
at least in this case.
Dragging a Component onto a GameObject drop zone, and a GameObject onto a Component drop zone is now supported when using DragAndDropUtilities. Furthermore, DragAndDropUtilities drop zones now also support all implicit and explicit cast operators from the dragged type to the target type.
ConvertUtility can now convert from Component to GameObject, and the reverse, returning respectively the Component's GameObject when converting from Component to GameObject, and the first Component instance of the requested type on the GameObject (or null if no such component exists), when converting from GameObjects to Components.
Added OdinPrefabUtility.GetNearestPrefabAsset(UnityEngine.Object obj), which will locate the prefab asset for the current/closest prefab serialization scope. IE, given prefab assets A and B, and a prefab instance A1 containing a nested prefab instance B1, the nearest prefab asset for a component inside B1 would be B, while it would be A for a component inside A1 that is not part of another nested instance.
DragAndDropUtilities now uses ConvertUtility to attempt to coerce dragged object values into values compatible with targeted drop zones.
Object fields now correctly show "Missing" when a reference has gone missing or been destroyed, instead of showing "None". When the missing reference is restored, the inspector will now display the restored instance despite the actual managed object reference in the inspected data still being fake null. This emulates Unity's own native inspector behaviour in this case. It is important to note that this fix, taking the form of a value swap, happens within the property system itself. As such, all inspected null Unity object references with instance IDs that point to valid objects will now be seamlessly swapped for the valid object references when the property tree is gathering values from inspected members.
Added the ability to add prefab exceptions to the duplicate components. These exclude filters can be added when right-clicking a duplicate component issue in the validator when the validated object belongs to a prefab assset or instance.
Issue severity can now be configured in the duplicate components rule.
Fixed errors and warnings about invalid and discouraged formatter creation being thrown and logged by AOT support generation after changes made to more aggressively generate support for more types.
Odin Inspector Version 3.1.2
Fixed case where InvalidCastException would be thrown when a value in the inspector was null and being requested by a drawer, processor or validator that was using the new non-generic targeting to match the base type of the containing member.
Improved validator window layout when it has a narrow window size.
Validation events occuring occurring while entering playmode, where background validation has not yet gotten the signal to be turned off, are now ignored.
No changes were made to Odin Serializer in this version.
Odin Inspector Version 3.1.1
The minimum supported version of Unity is now 2019.4 across all Odin products
Odin 3.1 is now out of beta with a brand new Odin Validator, available on the Asset Store!
See the Odin Validator in action!
Right Click > Validate This
Seamless scene switching
Additions since beta release 184.108.40.206
Added several new project window context menus to Assets > Odin Validator > Filter to help with quickly including and excluding items from the current validation profile:
Assets > Odin Validator > Filter > Exclude from active validation profile Assets > Odin Validator > Filter > Include in active validation profile
Including an excluded item removes the exclusion instead of adding a new included item - and vice versa. It also detects if scenes filters need to be added or removed. It also works with multi selection.
Assets > Odin Validator > Filter > Open filter settings
Opens the filter settings for the active validation profile in the validator window.
Enabling filter drawing will cause icons to be drawn in the project window that indicate whether an item is included or excluded from validation.
The circle indicates whether the asset will be validated, and the + / X icons indicate whether a filter item exists for the asset.
An exclamation mark appears if an include rule is being overridden by an exclude rule; these don't do any harm, the include just won't have any effect.
The drawing of filter icons is off by default, and can be toggled from the right context menu.
Added welcome flow to Odin Validator; when it is first installed, only a single error message will be shown, prompting the user to go through the setup wizard or to skip it.
Added context menu options to export HTML and JSON reports to the Validator window
Added Validator tutorial links to the Validator section of the new Getting Started window.
Fixes since beta release 220.127.116.11
Fixed issue where changes made to asset filters would not always be instantly applied.
Changes since beta release 18.104.22.168
OpenOrFocusWindowForSession now returns the ValidationSessionEditor instance instead of the window.
Changed default validate on load settings to be false.
Changed the ValidationReport API and extension methods around a bit to their final form.
New Getting Started window
We've added a new and improved Getting Started window, with sections for each current product in our lineup.
It contains all the same things the old one did, as well as a setup wizard for Odin Validator,
new tutorials, and more.
Six New Attributes
We've added six new attributes that make it far easier to work with Unity's prefabs.
They let you easily specify in which sorts of prefabs - for example, a value like a target
that must be set on all prefab instances in scenes, but not necessarily on all prefab assets.
For this purpose, we've also introduced a new PrefabKind enum which expresses the kinds of different
prefabs that it is commonly useful to talk about and distinguish between, such as prefab
assets, variants, instances in scenes, instances in prefabs, and so on.
Which prefab kinds to show a value in.
Which prefab kinds to hide a value in.
Which prefab kinds to disable a value in.
Which prefab kinds to enable a value in.
Which prefab kinds to require a value in.
Which prefab kinds to disallow making modifications to this value in.
// The pressure plate must target an object in a scene,
// but does not need a target when it's a prefab asset.
// At the same time, it dispatches events to a global
// event manager ScriptableObject which must only be set
// on prefab assets and cannot be changed in instances
// or prefab variants.
public class PressurePlate : MonoBehaviour
public Interactable Target;
public GlobalEventManager EventManager;
New SdfIcon Library
We've added a new SdfIcons class for drawing icons using signed distance fields for pixel perfect
rendering at any scale and resolution. The SdfIcon enum include the entire
Bootstrap icon library, which is searchable in the
new Icon Overview window which can be found at the Tools > Odin > Inspector > Sdf Icon Overview.
This is as yet merely a new API accessible from code, as SdfIcon options have not yet been added to
all attributes where it might make sense. This will, however, happen in the future.
EditorOnlyModeConfig now has far less of an impact on startup time.
Added lazy fetching of PrefabUtility.GetPropertyModifications for a PropertyTree's PrefabModificationHandler, so it is only fetched when it is needed, as fetching it is very slow.
Attribute expressions are now cached for a time to prevent constant repeated parsing and compilation of the same expressions in cases such as validation scanning.
PrefabModificationHandler is now cached and reused when PropertyTree instances are cached and reused.
The property grouping system now uses a new internal emitted deep copier utility for greatly increased grouping performance due to reduced overhead for copying attribute instances.
Added ISelfValidator interface, which lets any type specify validation logic for itself which will be executed as part of validation as though a custom validator has been written for it.
Added support for non-generic polymorphic targeting when type matching for drawers, validators, processors, resolvers, and so on. This means that for example MyDrawer : OdinValueDrawer<UnityEngine.Object> will now apply to all UnityEngine.Object derived types, without needing to declare it as a generic match such as MyDrawer<T> : OdinValueDrawer<T> where T : UnityEngine.Object. Apply the new [DisableNonGenericPolymorphicTypeMatching] attribute to disable this behaviour.
Added the ProjectSetting, ProjectSettingsGlobalConfig and EditorPref classes to assist with settings values. As we go, we will be converting more of Odin's settings to use these so that more settings can be set both on a project and machine basis.
ResultItem instances used by Validators can now contain multiple results instead of representing just a single result, using the new ResultItem.AddError() and ResultItem.AddWarning() methods. This lets a single validator generate multiple separate errors and warnings Use these new methods instead of setting message and result types directly on the ResultItem instance.
Added builder pattern to ResultItem for both Validator and ISelfValidator, IE, result.AddError(foo).WithFix(bar).WithMetaData(baz).
Added leak detection for Odin PropertyTree instances, which will print a helpful message to the debug log when a PropertyTree is garbage collected without first having been disposed, and which contains information about where the tree was allocated to help track down the source of the leak. Use the PropertyTree.EnableLeakDetection member to disable and enable this functionality.
Added support for Validators to implement the IDefineGenericMenuItems interface. Menu items added by a validator will appear for displayed issues in both the inspector and in the validator window.
this.ValueEntry.SmartValue can now be accessed through this.Value in ValueDrawers, AttributeDrawers with values, AttributeValidators, RootObjectValidators and ValueValidators.
Added EnumTypeUtilities and cleaned up EnumSelector.
Added SirenixEditorGUI.MessageBox overload that takes a GuiStyle as parameter.
Added MiniLabelCentered to SirenixGUIStyles.
Added more menu item shortcuts to Odin Serialization preferences.
Added RecordUndoForChanges member to PropertyTree, that lets you specify whether or not the undo should be recorded.
Added Sirenix.OdinInspector.Editor.UndoTracker utility that can be used to track when objects are modified, as well as when those modifications are undone and redone on which objects.
Added various OdinMenuTree colors to SirenixGuiStyles.
Added GUITimeHelper class, which helps keep track of time and replaces the old EditorTimeHelper class.
Added new overload of SirenixEditorGUI.MessageBox which takes a delegate that can add items to the context menu when right-clicking the message box.
Added OdinEditorResources class to Sirenix.OdinInspector.Editor which contains logos of Odin and other things.
Added PrefabKind enum to the Sirenix.OdinInspector.Attributes assembly, and added the new method OdinPrefabUtility.GetPrefabKind(obj).
Added PropertyTree.SerializationBackend property, which controls which SerializationBackend to use for the PropertyTree instance's root, and which overrides any default behaviour. Also added overloads to PropertyTree.Create that lets you pass in an initial SerializationBackend to use.
Added Sirenix.Utilities.Editor.CleanupUtility class to help clean up objects and disposables upon app domain reloads.
Added TakeFromLeft, TakeFromRight, TakeFromTop and TakeFromBottom to RectExtensions.
Added TextureUtilities.ResizeByBlit() that can resize a texture regardless of its readOnly state.
The root object of a PropertyTree can be accessed from attribute expressions via the $root named value. For example, [InfoBox("@$root.name")] will print the name of the component if a component is inspected.
Added .Slice() extension method to strings which is the same as .Slice(0).
Added TrimStart(), TrimEnd() and Trim() to StringSlice.
Added Vector2Int & Vector3Int to GenericNumberUtility.Vectors
Added Vector2Int & Vector3Int to GenericNumberUtility.Vectors. The MinValue, MaxValue and MinMaxSlider attributes should now work with them.
InspectorProperty.NiceName for ordered collection elements now takes the form of "CollectionNiceName [index]" instead of just "index".
Marked various obsolete members as being hidden from IDE intellisense for IDEs which support it and have the feature enabled.
Removed all legacy features from Validator types which were made obsolete with Odin 2.1.
SirenixGUIStyles.RichTextLabel now word wraps.
The overload of GUIHelper.RequestRepaint that takes an argument of how many frames it should repaint for has been deprecated.
Changed stretchWidth on the SirenixGUIStyles.MultiLineLabel style to true.
EditorTime.Time is now obsolete - use the new GUITimeHelper.DeltaTime instead.
Removed the obsoleted LinqExtensions.ToHashSet overloads entirely, as enough time has passed since they were obsoleted.
Reorganized Odin's menu items.
UnityTypeCacheUtility is now obsolete, as we no longer support versions of unity from 2018 and below.
Icons for info, error and warning messages are now much smaller, making the message boxes take up less space in the inspector.
The EditorPref class is now lazily implemented and doesn't get values from EditorPrefs until they are first requested, letting you use them in Unity object field initializers.
Added the concept of a TargetMatchCategory to the TypeSearchIndex class to distinguish which type parameters are intended to be matched to values vs matched to attributes; type matching is now more precise and handles weird edge cases far better.
GuiHelper.GetAssetThumbnail now gives more accurate thumbnail icons.
Added bounds check to StringSlice's indexer.
CustomValueDrawer now also works for drawing methods and expressions that return void; in this case, no value will be set automatically.
Fixed a bug where OdinEditorWindow's without a scroll bar would not paint the background correctly.
Fixed bug where EnumSelector.DrawEnumField didn't draw the label provided.
Fixed Button attribute's DirtyOnClick still causing scenes and assets to be marked dirty when undoable changes are made. This means undo is now disabled for changes made by button clicks when DirtyOnClick is set to false.
Fixed case where setting new targets on a property tree would prevent prefab modifications from working properly.
Fixed case where TypeExtensions.GetCastMethod would return a method with a wrong signature that could not in fact perform the requested cast. This could cause the expression system to compile invalid expressions and cause hard crashes when inadvertently invoking methods with parameters of the wrong types.
Fixed issue where InfoBoxValidator would not get a custom message if the VisibleIf parameter was not set.
Fixed issue where the ToggleGroup attribute would not respect setting CollapseOthersOnExpand to false when it has multiple members.
Fixed Odin failing to update the editors of existing PropertyEditor window instances when injecting its editors. Odin will now force update the editors of all window instances which implement the IPropertyView interface.
Fixed PropertyTree leak in the module preferences tab.
Fixed several issues where PropertyTrees was not properly disposed.
Fixed various various IMGUI layout issues and slightly improved performance of SirenixEditorGUI.BeginFadeGroup()
GUIEditorTime.DeltaTime now works correctly when used in multple different IMGUIContainers from the same window.
In cases where SirenixAssetPaths fails to locate Odin's install path, it now defaults to the default installation folder instead of project root.
InspectorTypeDrawingConfigDrawer now uses SafeGetTypes() when retrieving types from assemblies, to protect itself from corrupt loaded assemblies.
PropertyTrees now apply queued changes when disposed.
Range, MinMaxSlider, MaxValue and MinValue attribute drawers no longer immediately clamp the value to valid values when drawing; values are now only clamped to valid ranges when user input changes the values so that data does not mutate merely by inspecting it.
Reverting prefab modifications on a value now triggers OnValueChanged for that value.
All OdinSelector window instances now close immediately when the current selection changes, to prevent all strange edge cases where things change under the selector's feet.
DisableInNonPrefabs, DisableInPrefabs, DisableInPrefabInstances, DisableInPrefabAssets, HideInNonPrefabs, HideInPrefabs, HideInPrefabAssets, HideInPrefabInstances, HideInPrefabs, have all been fixed to work with prefab stages. They have also been marked obsolete in favor of the new ShowIn, HideIn, EnableIn and DisableIn attributes.
Dragging a texture asset set to be a sprite onto a PreviewField for a sprite member now accepts the drag, assigning the texture's first sprite as the value.
Fixed bug where the InspectorProperty for a method with a dot "." in its signature (such as when it had nested types as arguments) would have its name truncated to whatever came after the last dot in the name.
Fixed case where a member with a single letter name could not be targeted as a member reference in a resolved string, IE, [ShowIf("a")] wouldn't work for example.
Fixed case where drawing aliased methods (such as when other members in base types have the same name as the method) with parameters would cause exceptions to the be thrown in the ButtonParameterPropertyResolver, preventing drawing of the method/button.
Fixed case where EditorIcons textures would leak upon app domain reloads without being cleaned up.
Fixed cases where animating elements would not always be consistent with the framerate of editor windows, using the new and improved GUITimeHelper.DeltaTime utility.
Fixed collection resolvers not applying to root properties of property trees, causing an inspected list to not be drawn as a list, when for example using OdinEditorWindow.InspectObject(theList).
Fixed compiler error in EnumToggleButtonsAttributeDrawer.cs in source mode in newer versions of Unity that happened due to a name collision with StringExtensions.
Fixed error in generic type argument inferral in the GenericParameterInferenceTypeMatcher, and in TypeExtensions.TryInferGenericParameters, where they in some cases would fail to properly infer generic parameter arguments from parameter constraints which were nested two or more layers deep in other parameter constraints. This would cause an error where, for example, the type declaration `public class SomeDrawer<TList,TReference,TAsset> : where TList : IList<TReference> where TReference : AssetReferenceT<TAsset> where TAsset : Object` would fail to match to valid types such as `List<AssetReferenceT<Component>>`.
Integrated the Easy AOT feature which has been offered as an experimental testing build for a long time. This feature means Odin Serializer can function without AOT generation support in many cases where it would have failed before.
In these cases, it will now fall back to weakly typed versions of all applicable formatters and serializers.
AOT Support generation is now far more aggressive and proactive when deciding which types to generate support for. For any given type it knows it has to generate support for, it will recurse through its probable serialized members as well as serializer types referenced by all formatters for that type, and generate support for those, recursing further down as needed. IE, supporting ColorBlock will now generate also support for ColorBlock, Color and float automatically, and so on.
Type casting errors where deserialized values cannot be assigned to the expected type now log the full type name of all relevant types.
Added new "bool allowWeakFallbackFormatters" parameter to the IFormatterLocator interface. The locator is not allowed to return weakly typed formatter instances if this parameter is passed as true.
Fixed case where the DefaultSerializationBinder's type binding logic would fail to correctly resolve type names for vector arrays to multidimensional arrays of 1 dimension instead, if .NET type resolution fails, such as in the case of types having been renamed.
Fixed case where, in cases where no AOT support has been generated for serialized primitive arrays, the weak fallback formatter for primitive arrays would fail to deserialize the values properly and the array would be null after deserialization.
EditorOnlyModyConfigUtility will now not throw exceptions when drawing the editor only mode warning for SerializedX classes in an editor only mode distribution of Odin.
Fixed AOT support issue introduced during the 3.1 beta by the easy AOT feature where AOT support for a given type would often not work despite having been generated properly. This was the case for all types that had custom formatter locators, IE, arrays, basic generic collections (List<T>, Hashset<T>, etc), delegates, ISelfFormatter types and ISerializable types.