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.