Animation/Animator Problems

Hi,
New problem come with the latest version of unity in my game …

That error appear in mass when i create some new sprites animations :
“AnimationModeSnapshot.AddPropertyModification may only be called in animation mode”

And some times an other one .

And then when I modify components of a sprite with animations, all modifications are added to the animation curve even if I’m not in rec mode …
Sometimes sprites totally desapear …etc…
I’m working on unity since 4 years and never have this problem before.

Thanks for help.

(I’m also allowed to skype if anyone want to see the problem in realtime)

EDIT:: The other console bug:
NullReferenceException: Object reference not set to an instance of an object
UnityEditorInternal.AnimationRecording.Process

1 Like

HI,

Sounds like you may be doing something funky to create your animations.
Can you post a snippet of your code showing how you create the sprite animations?

1 Like

Hi,
I only create animations with with the “Animation” and “Animator” windows, nothing create with code :confused:

1 Like

Can you submit a bug report and attach an example project with the issue?

Post the bug id here and I can take a look at it.

1 Like

Huu … My project is 2Go and my network connection will takes 1week to upload it.
Thx anyway :confused:

I find a temporary solution:
make an animation then close unity and reopen before modify other components of the sprite.

SO, thinking that the editor don’t refresh correctlly and continuing rec even if rec button is off ?

1 Like

Hi,
I’m currently having the same issue. The easiest way to reproduce it would be to make a new project, download the “unity-chan” assets off of the asset store, add the prefab to the scene, preview an animation with the animation window in scene view, then add an empty game object to the root gameobject of the Unity-chan prefab.

I am uploading my current project right now, but it’s 1.5 gigs so it could take a while. Doing what Yearl did as the “quickfix” worked for me as well, but I’d rather not have to reopen the editor every time…

Edit
Upload is complete, just waiting for the email to give me anymore information you need me to post.

Edit.edit
case number (Case 711082)

1 Like

I’m running into this same issue as well. Basically, even though recording mode is off, modifications made in the scene will be added to the animation clip, and the error will appear in the console.

I’ve noticed that a script recompile will fix it for a time. My best guess is that something isn’t cleaned up when exiting animation mode, but is cleaned up when recompiling scripts.

I’ve tried explicitly calling AnimationMode.StopAnimationMode(), and even AnimationMode.EndSampling(), but neither worked to fix whatever is leaking.

1 Like

I think I have a solid repro:

  1. While working on an animation (in record mode), save the scene.
  2. Record mode should turn off automatically.
  3. Make a modification in the scene while record mode is off.
  4. That modification will be added to the animation, and a single error message will appear.
  5. Turn on record mode, save the scene. Record mode will automatically turn off. Repeat multiple times.
  6. When making a modification when record mode is off, you will see 1 error message for each time you saved the scene while in record mode.

This tells me that some event is registered when entering record mode, but when saving the scene to turn off record mode, that event is not unregistered.

1 Like

Also getting this error cropping up. In my case I was experimenting with animating uGUI elements, namely the “Anchored Position” property on a Text object. Seems to happen after multiple changes and saving scene, as detailed above.

1 Like

Yeah, I am having the same problem…Thx for the bug report, hope they fix it soon… It’s really annoying

1 Like

@jherbold
Hi would you mind submitting your repro? Unity QA: Building quality with passion
The one submitted by dmitsuki does not reproduce for us.

1 Like

@karl_jones
I have the same problem with them. Apparently, the Animation Window from Unity isn’t completely turned off when you close it. I have to restart the Unity in order to work normally when moving stuff.

However, doing animations is a pain since whenever I move sth, it will be recorded even though the Animation Window is closed. I don’t think submitting repro will help you at all. This bug is from the current Unity Editor patch. Please check and fix it! I’m pretty sure that the problem is coming from the Animation Window and its behaviour.

1 Like

Also having these issues, both the saving adjustments when recording is off and laggy adjustments while rec is on. Moving anything while rec is off is generally smooth (as is should be), but brings up that “AnimationModeSnapshot only called in anim mode.” error each move.

1 Like

Ah! Finally! Trying to find an answer to this has been painful. I stumbled upon this thread after receiving snapshot errors because I thought saving was actually helping prevent the issue (it was not).

This issue occurs even when the user is not constantly saving the scene. I asked the answer community a few weeks back (here) but got no answers or speculation.

Glad this is being looked at.

Edit: I should also mention, I believe the errors caused with the above listed bugs are also causing the undo command to not function properly. I have to look at it more though to be certain.

I was also having this problem and it seems to be caused by having the guilty Animation component linked as a reference in the inspector. Removing the public inspector reference to the Animation component and assigning it in code instead seems to prevent the errors.

1 Like

I’m not able to assign these all in code. I just don’t have that time.

This is actually extremely deprecating. I just started going back through animations and found 60 some improperly added components… I see “Play Animation” key frames added improperly the majority of the time. There are quite literally over 1,200 components in our software. Of each some have several animations. This was a 6 month deadline and I find out that all the states on these objects could be incorrect a two weeks from completion.

After I turn off record and switch to another (not even a child) object it should not be adding key frames to an animation on a separate object that is no longer selected.

Needless to say I am very disappointed with Unity. I don’t understand how an error like this could have been published.

Actually, after working for a while the issue popped up again so the inspector was not the cause. Relaunching Unity fixes it for me but I haven’t been able to reproduce the problem yet.

1 Like

The issue appears to be when the animation tab is docked. Having it as a separate window isn’t yielding the same complications.

Easy replication steps.

  1. Dock animation tab.
  2. Select object with animation.
  3. Select Inspector
  4. Select different animated object.
  5. Select animation tab.

Notice how now the object that was just selected shows missing animations.
Also if record was previously active before switching to Inspector actions may be recorded to the previous object (still not 100% on replicating recorded actions).

@HalversonS I tried your steps but it is not reproducing for me.

1 Like

Are you using animator or animation? If using animation, does anything appear incorrect?
I get it to occur even with a fresh launch.
My Animation tab is docked next to my inspector tab.

Try selecting the first object after clicking on the docked animation tab. After selecting it and seeing it’s key frames appear then select inspector with the same object selected. Select a new object. Select the docked animation tab.

Do you see anything yellow? Both objects must have animations.
Checked for Updates… Unity says I have latest version.