Fix prefab instance modifications for Odin-serialized AnimationCurves and Gradients. Old title: Odin is very slow (upto 1 second response time) I had to stop using it for list of struct (code attached)

Issue #102 resolved
mike diskett created an issue

I have attached the relevant class (currently set to not use odin, just remove the editor to use odin).

I have some lists of structs set up as tabs, and some horizontal groups the structs contain Animation Curves and colorGradients

On my 3.5Ghz SkyLake i7 it can take a large chunk of a second to respond, the designers preferred I remove odin and just use unity default, just to get the speed back..

We only have 4 or 5 items in each list

Comments (3)

  1. Tor Esa Vestergaard
    • changed status to open

    I've been spending a lot of time today on investigating this. I did find a few errors with AnimationCurves and Gradients which were being serialized by Unity on prefab instances. These would cause error spam in the console log, and thus slow down the editor drastically. Those errors should now be resolved, at least.

    There are even more issues with AnimationCurves and Gradients if they are being serialized by Odin, and are on prefab instances. The values are never quite set right, and new prefab modifications are registered for animation curves every single GUI frame.

    This is because of the, quite frankly, messed up way in which Unity has implemented these - pretending they are "atomic" values in the inspector, without actually implementing any equality operations or atomicity in the code classes themselves, which leaves Odin with having to deal with these sorts of crazy cases on its own.

    We'll be looking into fixing those cases as well, but it's a very tricky problem to solve in a consistent and thorough manner that breaks nothing else while still allowing Unity's oddities like AnimationCurve to work.

  2. Tor Esa Vestergaard

    This issue has now been resolved, and will make it into the next patch of Odin.

    To facilitate this fix, the concept of enforced (and extendable) type atomicity has been introduced to Odin's property system - AnimationCurves and Gradients are now marked as atomic, and largely act like primitive types in terms of the property system.

  3. Log in to comment