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

Saving Animation Controller randomly alterates the file

Discussion in 'Animation' started by ReaktorDave, May 2, 2017.

  1. ReaktorDave

    ReaktorDave

    Joined:
    May 8, 2014
    Posts:
    139
    Whenever I do a small change on an Animation Controller or just save it because I want to be sure, the diff looks like this:

    [-] m_Controller: {fileID: 0}
    [+] m_Controller: {fileID: 9100000}
    ...
    [-] m_Controller: {fileID: 0}
    [+] m_Controller: {fileID: 9100000}
    ...
    [-] m_Controller: {fileID: 0}
    [+] m_Controller: {fileID: 9100000}
    ...

    Now after comitting and saving the Animator again, it changes back to fileID: 0. I don't know what m_Controller: {fileID: ....} means. What do you think causes this?

    I also asked this question over here: http://answers.unity3d.com/question...-the.html?childToView=1347975#comment-1347975
     
    Alluysl likes this.
  2. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    970
    Bump. We've been getting this for ages too. I have tried to create a repro but have not managed to find a workflow that consistent does this, it just happens sometimes. It's always the m_Controller field of the animator parameters and dirtying the animator and re-saving always clears it back to 0. @Mecanim-Dev any ideas?

    It's a bit of a pain in terms of version control.
     
    Last edited: Jul 7, 2017
  3. ReaktorDave

    ReaktorDave

    Joined:
    May 8, 2014
    Posts:
    139
    Yes, this is a pain when working with version control.
     
  4. paradizIsCool

    paradizIsCool

    Joined:
    Jul 10, 2014
    Posts:
    178
    Bump.
    Moreover value for fileId seems to be 9100000 for everybody... looks strange
     
  5. ReaktorDave

    ReaktorDave

    Joined:
    May 8, 2014
    Posts:
    139
    UnityDevs?
     
  6. derdimi

    derdimi

    Joined:
    Mar 6, 2017
    Posts:
    33
  7. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    970
    If I remember correctly from last time I looked at the IDs, it’s a reference to the controller itself, hence why it is always the same.

    And, yeah, bump!
     
  8. KrcKung

    KrcKung

    Joined:
    Jul 18, 2017
    Posts:
    56
    And I tot I'm the only one have such problem. Having the same issue as well. It driving me crazy.
     
  9. monsterbluesHome

    monsterbluesHome

    Joined:
    Oct 8, 2017
    Posts:
    4
    This has been happening since Unity 4. It's not very damaging, but it's really annoying and the cause of many merge conflicts.
     
  10. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    970
    I have been trying to reliably repro this for literally years, to no avail. It just happens sometimes. I've even tried manually dirtying the controllers at different times, to no avail.

    @Mecanim-Dev any comments? This has now been the case for an unacceptably long time.
     
  11. Ash_Bash

    Ash_Bash

    Joined:
    Nov 8, 2016
    Posts:
    2
    Bumping this one also. It's such a pain trying to do anything meaningful with source control if after each save of the project, some files change some of the time, but pretty much always with benign changes toggling between 9100000 and 0.
     
  12. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    970
    What version of Unity is that on? I haven't seen that in a while, although I also haven't noticed any patch notes mentioning a fix for it either...
     
  13. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    1,296
    There is still zero informations after ~4 years? :(
     
  14. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,555
    Have you submitted a bug report?
     
  15. agate-pris

    agate-pris

    Joined:
    Sep 19, 2018
    Posts:
    5
    Bump. I'm in trouble too.
     
  16. ReaktorDave

    ReaktorDave

    Joined:
    May 8, 2014
    Posts:
    139
    I never submitted a big report because it was on a production project and I never had enough time to come up with a repro-case. All I know from my experience and the experience shared by others in this thread is at some point your animation controller asset starts doing this.
     
  17. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    970
    It has been more or less impossible to *reliably* reproduce, I have been trying for years. The only thing that seems consistent is something marking the asset dirty while in play mode.
     
    NicodemoGallegos likes this.
  18. mentia_lin

    mentia_lin

    Joined:
    Oct 20, 2018
    Posts:
    3
    Same here in Unity 2021 LTS, so annoying, if I re-order the parameters and save, the
    m_Controller: {fileID: xxx}
    for all the parameters change to 9100000, then if I re-order the layers and save, the
    m_Controller: {fileID: xxx}
    for all the parameters change back to 0.
     
  19. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    970
    Unfortunately all we've ended up doing is keeping an eye on it when committing. On our latest project it has been less of a problem because we have well established animators that do not get edited very much. Generally speaking, when those properties are set, I instruct whoever is doing the editing to mark the animator dirty again and resave.
     
    NicodemoGallegos likes this.
  20. Deepscorn

    Deepscorn

    Joined:
    Aug 13, 2015
    Posts:
    25
    I've got 9100000 changed to 0, 100 % repro, when saving by code. Maybe in your case, some postprocessing exists?

    Code:

    Code (CSharp):
    1.         [MenuItem("Assets/Migrate animator")]
    2.         static void MigrateBattleAnimator()
    3.         {
    4.             foreach (var selectedObj in Selection.objects)
    5.             {
    6.                 var animator = selectedObj as AnimatorController;
    7.                 if (animator == null) continue;
    8.                 animator.parameters = new AnimatorControllerParameter[]
    9.                 {
    10.                     new AnimatorControllerParameter()
    11.                     {
    12.                         name = "MoveLeft",
    13.                         type = AnimatorControllerParameterType.Trigger
    14.                     }
    15.                 };
    16.                 EditorUtility.SetDirty(animator);
    17.                 AssetDatabase.SaveAssetIfDirty(animator);
    18.             }
    19.         }
    20.  
    Unity 2021.3.15f1
     
  21. Deepscorn

    Deepscorn

    Joined:
    Aug 13, 2015
    Posts:
    25
    What I see in version control system:
     

    Attached Files:

  22. detzt

    detzt

    Joined:
    Oct 6, 2018
    Posts:
    19
    Based on the reordering mentioned by mentia_in, I managed to create a reliably reproducible example that I submitted in a bug report (IN-67711).
     
    MWZ_HG and Qriva like this.
  23. detzt

    detzt

    Joined:
    Oct 6, 2018
    Posts:
    19