And that method is throwing the exeption because clip is treated as null, although debugger shows that it is not, it is a get only property and there are no more usages of that clip.
delete authoring components and add them again, delete the clip from the list and set it again
make duplicates of clip and reference them
change clipβs animation type to legacy/humanoid/generic
check if == operator is overloaded for animation clip (it is not)
use lock object for this baker
update editor to latest 6.0 LTS version
Rider is configured to debug mode
When debugging that line (clip == null) I canβt go inside the operator== overload method like in other checks. When I step over I immediately go to the catch block, if I step into I get to the line that throws, as shown above.
Of course, that did not help. I would appreciate help, thanks in advance
AnimationClip inherits from UnityEngine.Motion which itself inherits from UnityEngine.Object, which has the overloaded lifetime operators. It seems likely that the Animation Clip is destroyed, but I donβt know why it would be. Itβs also weird that when debugging Rider shows (bool) false at the comparison.
Try to find the earliest place where clip == null is true. Is this the case at the start of the Bake method? If so, about the only thing I can think of right now is to see if using a backing field may fix the issue (unlikely but you never know).
If clip is not null at the start of Bake the clip gets destroyed at some point during the Bake method. In that case step through the code to see where it happens.
PS: please post code as text enclosed in code tags. Screenshots cannot be quoted, edited, searched, and sometimes are hard to read (here, each shot has a different text size).
Sometimes where are scenarios when people use βis nullβ comparison, instead of ==, but this is not the case here, == should work just fine. And yes, the strangest thing is that in debugger variable is neither null nor missing reference exception.
Thats the interesting part, its never null in other places, even if I check right before the AnimationUtility line. And its not null when debugging it, which is also never the case normally. (question style suggestion noted)
If something odd like this happens, I tend to restart editor and IDE (if not restarting the system) just to be sure itβs not some sort of lingering issue.
So the problem was caused by not having set curves in animation clip, however, I still donβt understand the issue there GetValueOrDefault returns default EditorCurveBinding without throwing, and then code executes according to the screenshots above, with falling into false if statement.
Hi, denissmirnovdeveloper. It would be great to take a closer look into this. Could you report a bug via the Bug Reporter (βHelp β Report a Bugβ¦β in the Unity Editor)? Make sure to attach your project so it would be easier to reproduce this. Cheers.