TeamSirenix / odin-serializer

Fast, robust, powerful and extendible .NET serializer built for Unity
http://www.odininspector.com
Apache License 2.0
1.69k stars 193 forks source link

I'm getting exceptions every time i rename any SerializedScriptableObject #60

Closed Hitomilras closed 8 months ago

Hitomilras commented 1 year ago

Today some strange bug appear in Unity Editor related to Odin Serializer. Every time I rename ANY "serialized scriptable object" I getting 2 exceptions. But, reimport \ reserialization works ok, changing any variables works ok.

Tried full reimport, tried to close\open unity3d, tried to restart PC, but it's still hapenning. I'm using last versions of Odin 3.1.13, Odin validator are also 3.1.13 and used in project.

Errors:

First one:

ArgumentNullException: Value cannot be null. Parameter name: unityObject Sirenix.Serialization.UnitySerializationUtility.SerializeUnityObject (UnityEngine.Object unityObject, Sirenix.Serialization.SerializationData& data, System.Boolean serializeUnityFields, Sirenix.Serialization.SerializationContext context) (at C:/Sirenix/OdinSerializer/OdinSerializer/Unity Integration/UnitySerializationUtility.cs:592) Sirenix.OdinInspector.SerializedScriptableObject.UnityEngine.ISerializationCallbackReceiver.OnBeforeSerialize () (at C:/Sirenix/OdinSerializer/OdinSerializer/Unity Integration/SerializedUnityObjects/SerializedScriptableObject.cs:42) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

Second one:

ArgumentNullException: Value cannot be null. Parameter name: unityObject Sirenix.Serialization.UnitySerializationUtility.DeserializeUnityObject (UnityEngine.Object unityObject, Sirenix.Serialization.SerializationData& data, Sirenix.Serialization.DeserializationContext context, System.Boolean isPrefabData, System.Collections.Generic.List`1[T] prefabInstanceUnityObjects) (at C:/Sirenix/OdinSerializer/OdinSerializer/Unity Integration/UnitySerializationUtility.cs:1371) Sirenix.Serialization.UnitySerializationUtility.DeserializeUnityObject (UnityEngine.Object unityObject, Sirenix.Serialization.SerializationData& data, Sirenix.Serialization.DeserializationContext context) (at C:/Sirenix/OdinSerializer/OdinSerializer/Unity Integration/UnitySerializationUtility.cs:1360) Sirenix.OdinInspector.SerializedScriptableObject.UnityEngine.ISerializationCallbackReceiver.OnAfterDeserialize () (at C:/Sirenix/OdinSerializer/OdinSerializer/Unity Integration/SerializedUnityObjects/SerializedScriptableObject.cs:35) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

Hitomilras commented 1 year ago

Bump. It's stopping project, just a blocker from sirenix, guys, please, help.

TorVestergaard commented 8 months ago

Fixed by commit 8b774c26d30b0119224deab59e6858d7b5b50e51 - sorry it took a while to get it into the open source repo from Odin Inspector's internal variant!