[WIP] Odin Inspector & Serializer Looking for Feedback

We’ve built Odin Inspector to make it easy to build powerful and user-friendly editors for yourself and your entire team, making it easier for developers and designers alike to use Unity more efficiently. So, what does this mean?

Sign up for the mailing list
>> View on Asset Store <<
More Info

It means that Odin is super extendable, easily integratable and includes full source code access. Read on below to find out how Odin deals with Serialization, Input Validation, Value Dropdowns, Powerful Lists, Customizable Layouts, Color Palettes, Asset Lists and more!

We’re on a mission to build the best inspector and serializer ever for Unity, and we’re proud to soon allow you all to be able to see for yourself why we’re so hyped about this release!

Be sure to check out the to-do list at the end of this post to let us know which of the features you want the most and leave additional feedback/ideas.

Odin Inspector & Serializer has been developed by the fantastic team at Sirenix, and published by Devdog.

Sign up for the mailing list
>> View on Asset Store <<
More Info

Main Features

Serialize Anything!
A simple, straight-forward data structure is often the way best way to go, but there are times where you simply need to serialize that complex generic, polymorphic type with cyclic references. This is where our custom serialization protocol comes into play.

You can either inherit from one of our many in-built serialized classes, such as SerializedMonoBehaviour and SerializedScriptableObject, or add a few lines of code to your existing classes.

Oh, and in case you were wondering, it has:

  • Full support for polymorphism, cyclic references and null values
  • Full prefab support
  • Serialize delegates
  • Built in Binary and Json Formatters
  • High performance and close to zero garbage generation
  • Follows all Microsft’s .NET serialization standards
  • Customize serialization by creating your own type formatters and data formats
  • Supports external references to objects such as Unity objects and assets.
  • Special editor-only node format is mergeable via source control

Input Validation
Bugs are often caused when a designer doesn’t know how a component works and accidentally sets an invalid value. This causes many errors, and can waste a lot of time that might have been productive while they look it up in a manual or consult with the developer who wrote the component.

Odin lets you easily write custom validation logic to ensure only correct values are set, and lets you give sensible feedback right in the inspector. Providing informative warnings, or simply disallowing invalid values, goes a long way towards minimizing the amount of potential bugs and smoothing out your workflow.

  • Write custom input validation logic
  • Prevent invalid values from being set
  • Give designers useful feedback in the inspector
  • Provide custom conditional UI messages for any property
  • Use built-in attributes such as SceneObjectsOnly and AssetsOnly

Powerful Lists
All arrays and lists are drawn by our powerful list drawer.

  • Drag and drop, insert and delete individual items
  • Cross-list and even cross-window item dragging
  • Paging for lists with many items
  • Infinite nested list drawing
  • Fully customizable though settings and / or using attributes

Customizable Layouts
Properly ordering, labeling, hiding and grouping your properties helps the user to faster find what they are looking for.

  • Group properties into Tab Groups, Foldout Groups, Toggle Groups, Horizontal Groups, Button Groups and more
  • Hide or show or enable or disable properties based on your custom conditions
  • Mark properties readonly or disabled
  • Custom property ordering
  • Hide or rename labels entirely
  • Display custom messages based on values
  • Easily draw custom GUI before or after properties

And much much more!..

Color Palettes
Define project-based color palettes for your whole team to share, and mark relevant color properties to show a color palette right next to the color picker.

  • Works with all Unity’s Color types
  • Palettes are stored as an asset, making the entire team share the same color palettes
  • Easily create new custom color palettes

Value Dropdowns
One way of easily preventing invalid values from being set, is by providing the user with a list of valid values to choose from.

The ease of dropdown selection is no longer limited to just enums. Odin lets you create a dropdown with value of any type to choose from.

  • Create dropdowns for any type
  • Manually specify name for items that do not implement .ToString() properly

Asset Lists
Finding the right assets can sometimes be a hurdle in big projects with lots of files. The AssetList attribute replaces the default list drawer, with a toggle-list of all relevant assets relevant to your use case. The user can then toggle relevant assets in and out of your list.

  • Filter the asset list by folder location, tags, layers, name prefixes, etc…
  • Only shows assets assignable to your list type
  • Works on all asset types, including components on prefabs
  • Auto populate mode that automatically adds all relevant assets in the list
  • Easily create new assets that meet your constraints

But most importantly! Odin is fully customizable
We make it easy to configure how you want the inspector to act in your project, and trivial to create new configurations for your own custom drawer types.

  • Customize the inspector to suit your needs and preferences
  • Create integrated configurations for your own drawers

We’ve spent the last 8 months developing Odin, and after a beta test to perfect it, we’ll release it at a release-discount on the Asset Store. So be sure to check back as soon as it is released.

We’ll continually improve upon Odin, so we’re looking for feedback on which features from the To-Do List you’d like to see developed first.

To-Do List:

  • Save play mode changes
  • Delegate Drawer for any delegate type
  • Dictionary Drawer
  • Adding a static inspector
  • In-line Unity object editing (expand a Unity object into a dropdown instead of changing inspector window to view its values)
  • Object snapshots / restore feature allowing you to restore an object to previously saved states

Sign up for the mailing list
>> View on Asset Store <<
More Info

  • Your friends at Devdog and Sirenix.
11 Likes

Wow! This looks absolutely amazing!

1 Like

The first teaser video showing off just a tiny part of all the things that are made possibly by Odin is now up:

2 Likes

Hello @SuneT @jorisshh . Looks really interesting this new inspector tool, and how simplify the process of creating custom editors. At the moment I’m a solo developer and working on a project that I’d like to incorporate this sort of custom editor.
So my question: if I create a custom editor with this tool, Is there going to be a way to export the custom editor created so I can include it in a project I’m going to publish in the asset store? Obviously without including the source code of Odin Inspector.

Hello @hernanperez85 , Sirenix developer here.

You can easily do that, as your custom editor would simply be a script file that Odin detects through reflection at runtime. You may simply include all of your Odin scripts in your assets.

Odin declares its presence in a Unity project by adding a define tag to all platform targets. This means you can simply wrap your Odin-dependent scripts with “#if ODIN_INSPECTOR”, and the script will become active if Odin is in the user’s project.

1 Like

Hello @Tor_Vestergaard , that’s great!, Thank you for you quick response :slight_smile:

2 Likes

This looks awesome. One thing I usually always have to write custom editors for, is adding buttons in the inspector that runs code in my MonoBehaviours. I would LOVE if you guys added the functionality to add an attribute to a method, that could then be called via a button in your custom editor.

Examples of the stuff i usually have to write editors for myself:
Button: Die (kills the character and despawns it with death effects)
Button: DealDamage(100) (deals 100 damage to the character, which can trigger Die internally).

Already asked and was answered in this reddit thread, x-posting this info in case any forum users have similar questions:

Question
I am already in love with this extension, we’ve spent a lot of time building in-editor tools to automate our game’s maze generation, I’ve always felt the UI was clunky and crowded but have never had the time to properly address it. I’d gladly drop $ to save said time.

Is your price point per seat? While I do adore how extensible and customizable Odin seems, to what degree can I get it going “out of the box”? For example, if I just wanted to get some tab and toggle groups integrated into our editor tools and get to the fancy stuff later, could you describe how involved that would be?

Answer
You simply install Odin, and it’s present everywhere, for every class that doesn’t already have a custom editor defined. You don’t even have to inherit from a special type. This means, for example, that all lists and arrays, everywhere, even on Unity’s own engine components, get the Odin upgrade. This is, of course, all very easily configurable.

Integration is seamless. If you’ve already made custom property and decorator drawers for vanilla Unity, Odin finds and integrates these into its inspector, so nothing gets lost. Everything you’ve done to extend Unity’s editor, will extend Odin in exactly the same way.

So to answer your question, all you have to do is drop the provided .dll or Odin’s source code into your project, add the attributes to your members, and enjoy.

And if you want to integrate Odin Inspector into your own custom editors, it’s literally a matter of two lines of code to draw a property tree for any set of objects: 1) Create property tree, 2) draw property tree. And that’s for any object type at all, not just Unity objects.

Edit: I might add, if you already have some very involved custom editor code, and you can’t simply switch over to a different drawing system at all, we do provide a vast public API of GUI utility methods to make drawing something that’s ordered and looks nice far easier than it is with Unity’s very rudimentary API, and you can use those utilities wherever you want.

Edit 2: And sorry, I just noticed you asked; yes, the price point is per seat.

3 Likes

This is already in the Inspector; there are even special group types for dealing with and arranging buttons in nice ways.

@murkantilism Cheers, thanks for the x-post!

1 Like

Possibly the most important feature I’m looking for is this:

Can I select a bunch of assets, drag and drop them into an array, and they don’t fill the array in a batshit insane order like they do in the standard Unity inspectors?

Looks cool. Does it work with scriptableobject where the name of the file might not necessarily match class name? etc…

In case you’re curious, it’s not batshit insane or completely random. It’s the order in which the elements were imported into Unity. So if you have sprites 1 to 100, if you were to import them all one by one in the correct order, then a drag and drop into an inspector array should yield a nice sorted result.

The solution to get it auto-sorting in alphabetic or alphanumeric order is pretty simple, so I’d imagine it could be added to Odin easily if not already there. But they might have the same thought process as Unity; not all users want it sorted by name but by other metrics. If you offer one sorting behavior you’ll have to offer all common sorting behaviors, otherwise you’re bound to make some folks unhappy. That’s why Unity went with the obscure and largely useless default sorting behavior.

1 Like

Right now, they’d just be inserted into the list in the same order as Unity usually does it. However, we could easily add a configuration option for different ways of sorting them before insertion. It wouldn’t be hard at all to add a few “right click list → sort → by name/import date/type/whatever” commands. I’ll add this to the list of minor UX additions to sort out. It should definitely be in before release.

( And if it wasn’t in by then, it would be fairly trivial for you to add it yourself. These days we don’t really touch Odin’s core code except when we find bugs to fix, we just extend it in the same way any user would. )

It doesn’t, sadly, as we do still operate through custom editors that live in Unity’s own inspector window. If Unity can’t make sense of the asset type, then Unity doesn’t even know to create our editor to inspect it. If you have your own window, though, it would be trivial to make Odin draw the asset with a few lines of code; Odin will handle it just fine. The only issue is on Unity’s side, and we can’t do much about that, unless we want to make our entirely own inspector window and trying to subsume Unity’s, which would be quite a messy solution, and wouldn’t be a very clean integration into Unity.

Random thought, why Odin? Devs are a fan of Norse mythology?

2 Likes

As Sirenix is a danish company, we are indeed fans of Norse mythology! That’s not the only reason the name fits, though; Odin is a god often associated with knowledge, magic, insight and wisdom. He gave one of his eyes to drink of the waters of wisdom from Mimir’s Well. He spies the world through his ravens, Huginn and Muninn. Odin sees and knows all.

The Odin Inspector is all about introspection and reflection, knowledge about things and what they consist of and how to change those things. So you see, the Odin Inspector’s job is basically to see and know all, and to convey this information to you.

That’s maybe overthinking it, but these thoughts did cross our mind and were factors when we settled on the name. Mostly we kind of just like it, though.

2 Likes

Next teaser is up - this time showing exactly how the Odin Asset List feature makes it easier to find the right asset in big projects with lots of files.

The AssetList attribute replaces the default list drawer, with a toggle-list of all relevant assets relevant to your use case. The user can then toggle relevant assets in and out of your list.

  • Filter the asset list by folder location, tags, layers, name prefixes, etc…
  • Only shows assets assignable to your list type
  • Works on all asset types, including components on prefabs
  • Auto populate mode that automatically adds all relevant assets in the list
  • Easily create new assets that meet your constraints
1 Like

I have a couple of inspector extensions. will be interesting to see what you came up wth

Any chance of support for 64-bit [flags] enums?

How does this compare to Full Inspector?

There is support for 64-bit flags enums, yes, though currently you do need to make it backed by an ulong to get the full range.

As for how we compare to Full Inspector: at release, we won’t have all the features it does. We will have some features it doesn’t: faster and more robust serialization that doesn’t have nearly the same performance impact as Full Inspector’s does, a broader selection of attributes and features to tweak the inspector appearance with, greater ease of extendability, not needing to inherit from a specific base class to get the inspector, being able to apply the inspector to many Unity types as well and so on.

Odin is designed to work well with enterprise-level workflows that make heavy use of source control and require tight performance and very reliable serialization. Most importantly, perhaps, it’s painstakingly designed to be able to drop into huge, complex projects that have already customized their editor greatly, provide an inspector upgrade across the board, and still work without any issues, and without breaking anything, incorporating all the same customizations into its own inspector.

Over time, we’ll add more features. We’ve concentrated most of our efforts so far on building an array of very solid and highly extendable core systems. Given this, once we’ve released, adding more features as we go along will be fairly easy.

1 Like

For 64-bit Flags enums, I’d have this…

[Flags]
enum Flags : ulong
{
None = 0,
Flag01 = 1uL << 0,
Flag02 = 1uL << 1,
Flag03 = 1uL << 2,
Flag04 = 1uL << 3,
Flag05 = 1uL << 4,
Flag06 = 1uL << 5, Flag07 = 1uL << 6, Flag08 = 1uL << 7, Flag09 = 1uL << 8, Flag10 = 1uL << 9,
Flag11 = 1uL << 10, Flag12 = 1uL << 11, Flag13 = 1uL << 12, Flag14 = 1uL << 13, Flag15 = 1uL << 14,
Flag16 = 1uL << 15, Flag17 = 1uL << 16, Flag18 = 1uL << 17, Flag19 = 1uL << 18, Flag20 = 1uL << 19,
Flag21 = 1uL << 20, Flag22 = 1uL << 21, Flag23 = 1uL << 22, Flag24 = 1uL << 23, Flag25 = 1uL << 24,
Flag26 = 1uL << 25, Flag27 = 1uL << 26, Flag28 = 1uL << 27, Flag29 = 1uL << 28, Flag30 = 1uL << 29,
Flag31 = 1uL << 30, Flag32 = 1uL << 31, Flag33 = 1uL << 32, Flag34 = 1uL << 33, Flag35 = 1uL << 34,
Flag36 = 1uL << 35, Flag37 = 1uL << 36, Flag38 = 1uL << 37, Flag39 = 1uL << 38, Flag40 = 1uL << 39,
Flag41 = 1uL << 40, Flag42 = 1uL << 41, Flag43 = 1uL << 42, Flag44 = 1uL << 43, Flag45 = 1uL << 44,
Flag46 = 1uL << 45, Flag47 = 1uL << 46, Flag48 = 1uL << 47, Flag49 = 1uL << 48, Flag50 = 1uL << 49,
Flag51 = 1uL << 50, Flag52 = 1uL << 51, Flag53 = 1uL << 52, Flag54 = 1uL << 53, Flag55 = 1uL << 54,
Flag56 = 1uL << 55, Flag57 = 1uL << 56, Flag58 = 1uL << 57, Flag59 = 1uL << 58, Flag60 = 1uL << 59,
Flag61 = 1uL << 60, Flag62 = 1uL << 61, Flag63 = 1uL << 62, Flag64 = 1uL << 63
}

…and declared like this:

Flags myFlags = Flags.Flag01 | Flags.Flag32 | Flags.Flag64;

How would that appear in the inspector…drop down with 65 multi-selectable check boxes (I hope)?

In the enum, I might also have Flag05thruFlag08 = Flags.Flag05 | Flags.Flag06 | Flags.Flag07 | Flags.Flag08 as shortcut to setting those flags together.