Odin Inspector Version 3.1.6

Odin Inspector

Additions

  • Added ToValidatorSeverity() extention to the InfoMessageType enum.

Fixes

  • SceneValidator fixes as well as all meta-data now works properly.
  • Fixed an issue in Odin's SceneReference equality operator.
  • Fixed case where Odin's UndoTracker would throw errors when animating values on a material. This is because apparently animating a value will sometimes generate bad Undo post process modification events with invalid data in them. Guard clauses have now been added to protect against this case.

Odin Validator

Additions

  • Issue messages in the Odin Validator window, is now cursor-selectable.

Changes

  • RuleConfig now works with IValidator's instead of Validators.

Fixes

  • Fixed a bug where sometimes changes made to a value while executing a fix would not be applied correctly.
  • Fixed issue introduced in 3.1.5 where Sirenix.OdinValidator.Editor.dll have wrong import settings.
  • OnPlay validation hook no longer runs when entering playmode through the Unity TestRunner.
  • Right clicking a folder in the project browser to create validators no longer defaults to the parent folder.

Odin Serializer

No changes were made to Odin Serializer in this version.


Odin Inspector Version 3.1.5

Odin Inspector

Additions

  • Added OnlyChangeValueOnConfirm parameter to ValueDropdown, which will make sure the value only changes when the dropdown actually confirms the value change, rather than every time a new potential value is selected in the dropdown. This is useful for those cases where a value dropdown is used for changing values which have complicated on value changed or property setter setups where actual value changes must be kept to a minimum.
  • Added OdinDefineSymbols.cs for determining which type of Odin is installed during runtime.

Changes

  • Removed Odin compatibility layers as Unity versions prior to 2019 are no longer supported.

Fixes

  • Fixed error where ConvertUtility would not properly convert GameObject instances into interface types by getting components of that interface. As drag and drop zones now used ConvertUtility, this bug prevented dragging of game objects onto interface members.
  • Further improved the way the license management API makes web requests to the licensing server to ensure that web requests are always tracked and disposed correctly in all cases. This should fix the remaining rare error messages some people were getting about native arrays in web requests not being disposed properly and leaking memory.
  • SirenixGUIStyles.WhiteLabel is now white in all GUIStyle modes.

Odin Validator

Additions

  • Added installation step to Odin Validator that ensures the correct version of Odin Inspector is installed.

Changes

  • Severity for warnings and errors in the the shader compiler validator can now be configured individually.
  • The validator setting "Open component in inspector and close others" is now false by default.

Fixes

  • Fixed an issue where Odin Validator would not detect errors visible in the inspector when selecting scriptable objects and other assets.
  • Method paramaters no longer get validated by Odin Validator.

Odin Serializer

Additions

  • Added VectorInt formatters to serializer assembly instead of keeping them as standalone scripts in the Odin Inspector distribution.

Changes

  • Improved logging of type resolution and casting errors during deserialization; these logs should now give far better type names for everything. Most had already been improved, but Easy AOT versions, IE, the new AnySerializer, did not have the logging improvements.

Fixes

  • Fixed case where the AOT support generation would accidentally generate support for types that it was not allowed to generate support for.

Odin Inspector Version 3.1.4

Odin Inspector

Fixes

  • 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.

Odin Validator

Fixes

  • 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 Serializer

No changes were made to Odin Serializer in this version.


Odin Inspector Version 3.1.3

Odin Inspector

Optimizations

  • 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.

Additions

  • 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.

Changes

  • DragAndDropUtilities now uses ConvertUtility to attempt to coerce dragged object values into values compatible with targeted drop zones.

Fixes

  • 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.

Odin Validator

Additions

  • 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.

Odin Serializer

Fixes

  • 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

Odin Inspector

Fixes

  • 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.

Odin Validator

Improvements

  • Improved validator window layout when it has a narrow window size.

Fixes

  • Validation events occuring occurring while entering playmode, where background validation has not yet gotten the signal to be turned off, are now ignored.

Odin Serializer

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!



High performance



Bulk fixing



Right Click > Validate This



Seamless scene switching



Profiles



Additions since beta release 3.1.0.19

  • 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.

    Assets > Odin Validator > Filter > Toggle Filter Drawing

    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 3.1.0.19

  • Fixed issue where changes made to asset filters would not always be instantly applied.

Changes since beta release 3.1.0.19

  • 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.

Odin Inspector

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.


ShowIn

Which prefab kinds to show a value in.

HideIn

Which prefab kinds to hide a value in.

DisableIn

Which prefab kinds to disable a value in.

EnableIn

Which prefab kinds to enable a value in.

RequiredIn

Which prefab kinds to require a value in.

DisallowModificationsIn

Which prefab kinds to disallow making modifications to this value in.

using UnityEngine;
using Sirenix.OdinInspector;

// 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
{
	[SceneObjectsOnly]
	[RequiredIn(PrefabKind.InstanceInScene)]
	public Interactable Target;

	[DisallowModificationsIn(PrefabKind.PrefabInstance)]
	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.



Optimizations

  • 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.

Additions

  • 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.

Changes

  • 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.

Fixes

  • 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>>`.

Odin Serializer

Features

  • 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.

Changes

  • 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.

Fixes

  • 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.

Odin Inspector Version 3.1.0.19

Beta Release

There will be duplicate patch notes here, as the 3.1.1.0 patch notes represent the full delta from version 3.0.13. Hence, there is a bit of overlap with the 3.1.0.x beta patches.


Odin Validator

  • Opening prefabs from validator issues now always open the stage for the outer most prefab instance, instead of the nearest prefab instance.
  • Validation Profiles can now have icons, which can be changed while having the profile asset selected.
  • Fixed error log that would occur when toggling visibility of gameobjects.

Odin Inspector

  • Added value drawer for SdfIconType.
  • Sdf Icon Overview can now also function as a Icon Selector. (SdfIconSelector)
  • Fixed beta issue where all Odin Inspector and Odin Validator's precompiled assemblies would be compiled against .NET Framework 4.8 instead of .NET Framework 4.7.1, causing issues with VS Code's intellisense and compiler errors when trying to manually build solutions or projects referencing the .dll's via for example MSBuild. All assemblies are now built targeting .NET Framework 4.7.1.
  • SdfIconType.None now draws nothing instead of 123
  • Fixed case introduced during the beta where Odin would incorrectly draw members in Odin-serialized Unity objects as if the roots were always serialized by Odin, and never Unity. This did not change the actual serialization behaviour, only the display of it.
  • Value on ValueValidator is now browsable and will show up in Visual Studio's intellisense

Odin Inspector Version 3.1.0.18

Beta Release

There will be duplicate patch notes here, as the 3.1.1.0 patch notes represent the full delta from version 3.0.13. Hence, there is a bit of overlap with the 3.1.0.x beta patches.


Odin Validator

  • Validator settings are now serialized in your project and shared with your team. They can also be overriden with local machine settings as needed.
  • Fixed a bug where profiles and other serialized validator settings would be overriden when the project is imported for the first time.
  • Fixed an issue with ValidationSession.CurrentWarningCount.

Odin Inspector

  • Added reference to Sirenix.OdinInspector.Attributes to the Sirenix.Utilities assembly definition in the source distribution of Odin, fixing compiler errors introduced to the source build by the addition of SdfIcons to the Sirenix.Utilities assembly.
  • Added more menu item shortcuts to Odin Serialization preferences.
  • Fixed a bug where the SdfIcon texture is unable to be loaded during InitializeOnLoad first time the project is loaded. Unity is still unable to load it, but uses of API SdfIcon api is resiliant to it not working during that time, and SdfIcon will fix itself later when the AssetDatabase works again.
  • Fixed various ImGUI layout issues and slightly improoved performance of SirenixEditorGUI.BeginFadeGroup()
  • GUIEditorTime.DeltaTime's now work correctly when used in multple different IMGUIContainers from the same window.
  • Odin ProjectSetting utilities intoruced in the beta is now moved to the Sirenix.OdinInspector.Internal namespace.

Odin Inspector Version 3.1.0.17

Beta Release

There will be duplicate patch notes here, as the 3.1.1.0 patch notes represent the full delta from version 3.0.13. Hence, there is a bit of overlap with the 3.1.0.x beta patches.


Odin Validator

Features and additions

  • Added new Getting Started window. The Odin Validator tutorials linked in the new window are not ready yet, but will be online soon.
  • Added setup wizard in the Odin Validator section of the new Getting Started, which will guide you through initial setup of Odin Validator and offer to migrate settings from the old version of the Validator if you have it installed.
  • Added "Configure" context menu to the scene validation widget.
  • Added right click context to No Empty Strings rule.
  • Added right click context to Reference Required By Default rule.
  • Added right click context to Scene Not In Build Settings rule.
  • Added ability to ignore certain shader assets in Shader Compile Error rule.
  • Added DynamicObjectAddress.GetAllExistingAddresssesForAssetGuid()
  • Added FindAllComponentsInSceneOfType<T> and FindComponentInSceneOfType<T> to SceneValidators.
  • Added 'Ignore shader compile errors' > 'For me only' and 'For everyone' to Shader Compile Error rule's right click context.
  • Added 'ignore this component type' to duplicate component rule's right click menu.
  • Added result.AddError("error message").WithModifyRuleDataContextClick(..) which makes it easy to modify rule settings when right clicking issues that come from rules.
  • Added support for validators to implement the IDefineGenericMenuItems interface. Menu items added by a validator will appear in both the inspector and in the validator window.
  • Attributes can now be applied to meta data entries for issues. result.AddError("...").WithMetaData("Name", 10f, new RangeAttribute(0, 20), new InfoBoxAttribute("Hello"));
  • Changed how enabling and disabling live validation works in the Validator Window.
  • Cleaned up the ValidationSession API, and added validationSession.CurrentWarningCount, validationSession.CurrentErrorCount and validationSession.CurrentValidCount() as well as GetCurrentResults(applyFilters) ;
  • Creating a profile in the validator window, now pings the asset it creates.
  • Double clicking issues from prefab assets now opens the prefab stage and locates the issue in there.
  • Missing shader issues on materials are now fixable.
  • Restructured validation config and added many new options in validation config for specifying when to automatically validate certain objects.
  • this.ValueEntry.SmartValue can now be accessed through this.Value in AttribtueValidators, RootObjectValidators and ValueValidators.
  • Validator now captures all console errors and warnings logged during asset load events performed during validation.
  • You can now more easily add buttons to issues. Example: result.AddError("").WithButton("Name", () => { Debug.Log("Button was clicked"); })
  • Added right click > 'See Rule Settings' to huge transforms.

Changes

  • The way in which features are added to error messages has been changed from parameters on a single create call to a fluent builder pattern. IE, result.AddError().WithFix(..).WithMetaData("name", value)
  • Validator feedback button was moved from being an overlay button, to be part left icon menu.
  • Column header labels are now left aligned.
  • Duplicate component rule message now includes the name of the duplicate component.
  • Duplicate Component rule right context is now 'Ignore this component' > 'For Me Only' and 'For everyone'.
  • Huge Transform Position rule right click context is now 'Open rule settings' > 'For Me Only' and 'For everyone'.
  • Improved validation count per second in progress bars.
  • Renamed PersistentValidationResult to PersistentValidationResultBatch, and added a new version of PersistentValidationResult which is a simple data-only class that only ever represents a single result, not potentially a collection of them. Also changed the ValidateEverythingEnumerator APIs and added ValidateEverythingEnumeratorBatched.
  • Renamed ValidationSessionProfile to ValidationProfile, ISessionConfigData to IValidationProfile, GlobalSessionConfigData to MainValidationProfile and LocalSessionConfigData to MainLocalValidationProfile.
  • ResultItem.WithContextClick can now be called multiple times to add multiple right click options instead of just one.
  • Root Object Validator templates are now non-generic.
  • RuleConfig.GetRuleDataWrapper now keeps and reuses the RuleDataWrapper object.
  • SceneView is no longer accessible as a parameter through the delegate passed to result.AddError().WithOnSceneGUI() to be consistent with the non editor version accessed through ISelfValidator. You can still access it though SceneView.currentDrawingSceneView.
  • When a gameobject is deleted, only the scene it came from will be revalidated, if the setting for it is enabled.

Fixes

  • Fixed case where fixes for sub-validation results would not be persisted.
  • Fixed case where prefabs assets would not be pinged in the project browser on double click.
  • Fixed issue data would not always get updated after revalidation.
  • Fixed issue where some objects would not get removed from the validator window when deleted from Unity.
  • Multiple Audio Listeners validator now only looks through active gameobjects.
  • Search and filters are now properly handled for validators that output multiple results.
  • Validator no longer revalidates entire prefabs when revalidation of a component inside a prefab is triggered.
  • When switching to a scene the validate has already validated, it will no longer re-validate that entire scene.
  • Fixed case where rebuilding of persisted validation result items was broken in cases where not all data items had references to persist.

Odin Inspector

Additions

  • Added a new Getting Started window and removed the old one.
  • Added builder pattern to ResultItem for both Validator and ISelfValidator, IE, result.AddError(foo).WithFix(bar).WithMetaData(baz). These replace the now-removed AddX overloads that took fix and metadata arguments.
  • Added DisableIn attribute.
  • Added EnableIn attribute.
  • Added HideIn attribute.
  • 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 OnContextClick and OnSceneGUI delegates to ResultItems for both Validator and ISelfValidator, which is what is added to ValidationResult instances via result.AddError() etc. OnContextClick is invoked to help build a right-click context menu for that validation result item when it is right clicked in the inspector or in the Validator window, and OnSceneGUI lets you draw to a scene view when the result item is selected in the validator window if you have Odin Validator installed. Use the new builder pattern methods WithContextClick and WithSceneGUI to set these on your results, IE, result.AddError(error).WithContextClick(foo).WithSceneGUI(bar).
  • Added PrefabKind enum to OdinInspector.Attributes.dll and OdinPrefabUtility.GetPrefabKind(obj).
  • Added ShowIn attribute, which lets you specify in which kinds of prefabs a thing should be shown.
  • Added TextureUtilities.ResizeByBlit() that can resize a texture regardless of its readOnly state.
  • The root object of a property tree can now be accessed from Odin's attribute expressions as a named argument. [InfoBox("@$root.name")] will print the name of the component if a component is inspected.
  • Added DisallowModificationsIn attribute.
  • Added RequiredIn attribute.

Changes

  • Icons for info, error and warning messages are now much smaller, making the message boxes take up less space in the inspector.
  • Made the icons of warnings and errors and info smaller, which means smaller info boxes in the inspector.
  • Moved SdfIcons to the Sirenix.Utilities.Editor assembly.
  • Moved SdfIconType to the correct assembly, Sirenix.OdinInspector.Attributes.
  • Removed Fix<T> generic variant; there's now just Fix. The usage API is the same, though, so this should have little impact for anyone.
  • Removed overloads for ValidationResult and SelfValidationResult that took fix and metadata arguments; use the builder pattern that replaces it instead, IE, result.AddError(foo).WithFix(bar).WithMetaData(baz).
  • Removed the Validator.OnSceneGuiSelected virtual method. Use the OnSceneGUI delegate on individual result items instead, ideally using the builder pattern via result.AddError("Error").WithSceneGUI()
  • Reorganized Odin's menu items.

Fixes

  • 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, has all been fixed to work with stages. But they have also been marked obsolete in favor of the new attributes.
  • Fixed bug where SdfIcons didn't work during initialization of Unity.
  • Fixed PropertyTree leak in the module preferences tab.
  • Fixed compiler error in EnumToggleButtonsAttributeDrawer.cs in source mode in newer versions of Unity that happened due to a name collision with StringExtensions.
  • 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 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 issue where InfoBoxValidator would not get a custom message if the VisibleIf parameter was not set.
  • Reference Required By Default now correctly handles Unity-null objects.
  • In cases where SirenixAssetPaths fails to locate it self, it now defaults to the default installation folder instead of project root.
  • 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>>`.

Odin Serializer

Changes

  • Type casting errors where deserialized values cannot be assigned to the expected type now log the full type name of all relevant types.

Fixes

  • 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.

Odin Inspector Version 3.1.0.13

Beta Release

There will be duplicate patch notes here, as the 3.1.1.0 patch notes represent the full delta from version 3.0.13. Hence, there is a bit of overlap with the 3.1.0.x beta patches.


Odin Validator

  • Fixed various layout issues.
  • ValidationSessionAsset has been renamed to ValidationSessionProfile

Odin Inspector

  • Fixed various layout issues.
  • Fixed cases where animating elements would not always be consistent with the framerate of editor windows.
  • EditorTime.Time is now obsolete - use the new GUITimeHelper.RepaintDeltaTime or GUITimeHelper.LayoutDeltaTime instead.
  • UnityTypeCacheUtility is now obsolete as we no longer support versions of unity from 2018 and below.

Odin Inspector Version 3.1.0.12

Beta Release

There will be duplicate patch notes here, as the 3.1.1.0 patch notes represent the full delta from version 3.0.13. Hence, there is a bit of overlap with the 3.1.0.x beta patches.


Odin Validator

Additions

  • Added ValidationReport class, which provides an API for generating json and HTML reports for validation session results. UI buttons to create these reports will be added later.
  • Added Unity Event Validator.
  • Added info below the execute fix button when there is no fix to draw.
  • Added MaterialValidator and improved material and shader validation.
  • Added No Empty Strings rule.
  • Finally added Reference Required By Default rule.
  • RequireComponent now offers to automatically add the missing component, either on the prefab root, or the gameobject itself.

Fixes

  • Fixed a bug where issues would not always disappear when an object was deleted.
  • Fixed bug where validation couldn't be enabled or disabled.
  • Fixed case where changing asset filters would not immidiatly be applied.
  • Fixed case where fixes to missing mesh renders would not always work.
  • Fixed case where ObjectAddress would locate the wrong object in a scene after hierarchy changes had been made after a scan finished. This would manifest as the wrong objects being selected on clicking issue entries in the issue overview.
  • Fixed issue where Odin Validator in source mode would have an ambiguous type reference compiler error between UnityEditor.SerializationUtility and Sirenix.Serialization.SerializationUtility in GlobalSessionConfigData.cs.

Changes

  • Made several major and minor changes and improvements to the validator window UI to improve UX.
  • Embedded shaders and materials into source code.
  • Issues will now more quickly disappear when a scene object is deleted.
  • The plus button under the rules tab in the Odin Validator window now only offers to create rules and not validators, to avoid confusion between the two concepts.

Odin Inspector

Additions

  • Added ImGUITimeHelper.
  • Added OdinEditorResources to Sirenix.OdinInspector.Editor which contains logos of Odin and other things.
  • Added PropertyTree.SerializationBackend property, which controls 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.
  • Made RequiredInPrefabInstances & RequiredInPrefabAssets fixable.

Fixes

  • 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 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 issue where the UndoTracker would start mixing up which objects were in which undo groups when a lot of undoing and redoing was done, which would cause it to start sending wrong undo and redo events for the wrong objects sometimes.

Changes

  • Removed the obsoleted LinqExtensions.ToHashSet overloads entirely, as enough time has passed since they were obsoleted.
  • Better Require Component error messages.

Odin Serializer

Fixes

  • 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.

Odin Inspector Version 3.1.0.11

Beta Release

There will be duplicate patch notes here, as the 3.1.1.0 patch notes represent the full delta from version 3.0.13. Hence, there is a bit of overlap with the 3.1.0.x beta patches.


Odin Validator

Additions

  • 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 ValidatorSeverity overload to ValidationResults, which registers an error or warning depending on the severity, and doesn't do anything if the severity is set to ignore.
  • Added MeshRendererValidator rule that detects missing materials, broken materials, and prefab modifications in mesh renderers.
  • Right clicking issues from scenes now presents a "Ping scene asset" option.
  • Added Debug mode in validator settings to hunt down bugs during bulk fixing and show additional information in issue info.

Fixes

  • Validation rules will now deserialize with default values for new fields that were added after the rule was last changed and saved.
  • Fixed Validator about page not rendering the Odin Validator logo.
  • Prevented "FormatException: Unrecognized Guid format" errors from occuring when assets was removed outside of Unity.
  • Fixed error where validators for SceneAsset and SceneValidators would come in conflict and wipe out each other's validation results in the validation overview whenever they were revalidated, such as when visible issues were being continuously validated.
  • Fixed layout error logs that would occur when running many fixes that added/removed components. There is a separate issue where layout errors still occur after running some kinds of fixes; we are still working on resolving those, but this should take care of most of them.

Odin Inspector

Fixes

  • 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.

Odin Serializer

Features

  • 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. This is a very large change to make which required major reworks and additions to the serializer, hence why it has been in testing for so long. As it has been reported stable and functioning, we've finally chosen to add it.

Fixes

  • EditorOnlyModyConfigUtility will now not throw exceptions when drawing the editor only mode warning for SerializedX classes in an editor only mode distribution of Odin.

Odin Inspector Version 3.1.0.10

Beta Release

There will be duplicate patch notes here, as the 3.1.1.0 patch notes represent the full delta from version 3.0.13. Hence, there is a bit of overlap with the 3.1.0.x beta patches.


Odin Validator

As this was the first public release of the new Odin Validator, there are no patch notes for this version.

Odin Inspector

Optimizations

  • Added lazy fetching of PrefabUtility.GetPropertyModifications for a PropertyTree's PrefabModificationHandler, so it is only fetched when it is requested on any given frame, as fetching it is very slow. More optimizations are coming to this, such that fetched modifications are only updated when they actually change, instead of every frame they are actually requested, which is still the case even with this change.
  • 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 properly when PropertyTree instances are cached and reused.
  • Drastically increased performance of validation and project scanning over prior versions of Odin. Changes made are too numerous to list exhaustively, and cover the entire codebase. We have seen 10-100x improvements in scan time, though scans of very large projects can still take a while. In most of our test cases, Unity's asset and scene loading accounts for the majority of the validation scan time.
  • EditorOnlyModeConfig now has far less of an impact on startup time. Where before it could take seconds, it will now in most cases take <3 milliseconds to initialize.

Additions

  • Added SdfIcons to Odin, a new class for drawing icons in the editor. These are a set of icons which are drawn using signed distance fields, meaning they scale to being drawn precisely at any resolution. Long term, these will replace the EditorIcons class. The SdfIcons class includes the entirety of the Bootstrap icon library. You can search and preview available icons using the new Tools > Odin Inspector > SDF Icon Overview window.
  • Added PlaceholderLabel attribute, which draws a placeholder label inside a text field while the text field is empty.
  • Added three new attributes: RequiredInPrefabAssets, DisallowPrefabModifications and RequiredInPrefabInstances.
  • Added EnumTypeUtilities and cleaned up EnumSelector.
  • 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.
  • Added MessagBox overload in SirenixEditorGUI that takes a GuiStyle.
  • Added MiniLabelCentered to SirenixGUIStyles.
  • Added PropertyTree.EnableLeakDetection setting.
  • Added RecordUndoForChanges 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 UnityTypeCacheUtility.GetTypesWithAttribute proxy methods.
  • Added various OdinMenuTree colors to SirenixGuiStyles.
  • Added EditorPref<T> with subtypes EditorPrefBool, EditorPrefString, EditorPrefFloat, EditorPrefInt and EditorPrefEnum<T> as a convenient utility wrapper for values stored in editor prefs.
  • Added ProjectSetting<T> with subtypes ProjectSettingBool, ProjectSettingString, ProjectSettingFloat, ProjectSettingInt and ProjectSettingEnum<T> as a convenient utility for a value which can either be stored serialized in a project asset, or overwritten on a local machine basis by being stored in editor prefs. As such, this enables having settings values which can be adjusted in a project but also controlled on a per-machine basis with local user overrides for improved collaboration possibilities. Also added ProjectSettingKeyAttribute, and ProjectSettingsGlobalConfig<T> as a new GlobalConfig type which supports storing ProjectSetting values via ProjectSettingKey attributes set on the settings members.
  • Added .Slice() extension method to strings which is the same as .Slice(0).
  • Added TrimStart(), TrimEnd() and Trim() to StringSlice.

Improvements

  • GuiHelper.GetAssetThumbnail now gives more accurate thumbnail icons.

Fixes

  • 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 case where setting new targets on a property tree would prevent prefab modifications from working properly.
  • Fixed issue where the ToggleGroup attribute would not respect setting CollapseOthersOnExpand to false when it has multiple members.
  • Fixed several issues where PropertyTrees was not properly disposed.
  • InspectorTypeDrawingConfigDrawer now uses SafeGetTypes() when retrieving types from assemblies, to protect itself from corrupt loaded assemblies.
  • PropertyTree's now ApplyChanges 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.
  • Fixed multiple cases where TypeSearchIndex would incorrectly match many different types in ways that would later be filtered away. Type matching is now more precise to begin with, without need for further filtering.

Changes

  • Type matching for all drawers, validators, resolvers and processors has been changed to allow for polymorphic matching on non-generic targets. IE, public class UnityObjectDrawer : OdinValueDrawer<UnityEngine.Object> will now in fact match on and draw all UnityEngine.Object instances without needing to be generic and using generic constraints to match on those types instead.
  • TypeSearchIndex's match search API now requires you to pass in TargetMatchCategory values for each match target, both when indexing types and when matching them, in order to more precisely distinguish between which things to match as values and as attributes.
  • 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
  • All debug symbol files for Odin's assemblies are now marked portable for better cross platform and cross Unity version compatibility.
  • Removed all deprecated features from Odin Validators.
  • Removed obsolete OpenGlobalConfigWindow.
  • SirenixGUIStyles.RichTextLabel now word wraps.
  • The overload of GUIHelper.RequestRepaint that takes an argument of how many frames it should repaint has been deprecated.