Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Resolved Animation Clip import flags constantly reset

Discussion in 'Animation' started by Chris_Payne_QS, Sep 18, 2020.

  1. Chris_Payne_QS

    Chris_Payne_QS

    Joined:
    Jul 16, 2016
    Posts:
    84
    For some reason in my project every time I set any animation to Loop on the import settings, the Loop flag is cleared as soon as I Apply the change. I have tried enabling the flag in the .meta file, it is still cleared as soon as the editor reads the file.

    I thought this was a bug in 2019.4.9 because I recently updated from 2019.4.0, but if I create a fresh project and use the same data, everything works correctly. So it's something unique to my project, but not the animation data itself.

    I suspected Perforce version control integration so I tried disabling that. No joy, even after restarting Unity.

    I AM able to duplicate the anim and set THAT to loop, but that's destructive.
    I AM able to change the model scale and other import settings, it seems to be only the per-Animation-Clip import settings that get reset.
     
  2. Nathanieljla

    Nathanieljla

    Joined:
    Apr 18, 2014
    Posts:
    97
    If you look back at the meta file is it being reset to read-only?
     
  3. Chris_Payne_QS

    Chris_Payne_QS

    Joined:
    Jul 16, 2016
    Posts:
    84
    Yes, the meta file is re-saved as soon as it is imported.
     
  4. Nathanieljla

    Nathanieljla

    Joined:
    Apr 18, 2014
    Posts:
    97
    Is this happening for all files in your project, or just the one file? Can you duplicate the file so that the duplicate is not included as part of perforce and see if it has the same issue? I realize you said you disabled perforce, but it sure does seem suspect.
     
  5. Chris_Payne_QS

    Chris_Payne_QS

    Joined:
    Jul 16, 2016
    Posts:
    84
    Solved!
    A while back I wrote a script to auto-rename the first anim clip to match the container anim file so that the anim picker was usable (we're exporting anims individually), and then I forgot all about it. It seems that AssetPostprocessor::OnPreprocessAnimation() completely overrides any editor changes though. I'll have to try a different callback...
     
  6. Nathanieljla

    Nathanieljla

    Joined:
    Apr 18, 2014
    Posts:
    97
    Ah. Good to know.