Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Bug Adding new animation clip to Legacy animation system gives error.

Discussion in 'Animation' started by jo82, Jul 2, 2023.

  1. jo82

    jo82

    Joined:
    Dec 3, 2015
    Posts:
    43
    Look I'm working with Unity 2022.3.2f1 with the legacy animation system and so far it has always been reliable to me until just recently when I tried to add a new animation to my character that has already 857 animation clips to it. (Yeah that's a lot). So adding a new clip makes it 858 and it gives me this error --> Assertion failed on expression: 'm_UsedFileIDs.count(fileID) == 0'...

    I just hope this can get fixed because legacy suits me well and I tried the mecanim stuff and it's a hassle to me.

    So is there really a limit to add animation clips with legacy?

    Thank you very much.
     
    Unifikation likes this.
  2. jo82

    jo82

    Joined:
    Dec 3, 2015
    Posts:
    43
    I tried the same with 2022.3.4f1, 2021.3.20f1 and 2020.3.48f1 and it's all the same.

    I get this trying to add a new animation clip...

    Assertion failed on expression: 'm_UsedFileIDs.count(fileID) == 0'
    UnityEngine.GUIUtility: ProcessEvent (int,intptr,bool&)
     
    Last edited: Jul 2, 2023
  3. jo82

    jo82

    Joined:
    Dec 3, 2015
    Posts:
    43
    So yeah,...

    The workaround is to enter your gameobject Import Settings by clicking "select" go under the "Animation" tab (like you always do when you want to add a new animation under legacy)

    Add two animations (if you want to only add 1 and I'll explain under) than click "apply"

    Then you select the same game object in the hierarchy and manually add an element to your animation list...
    Then search for the animation you want to add in your project window and manually drag it to the element slot you've just created.

    The reason I need to add one additional animation is because It throws this 'm_UsedFileIDs.count(fileID) == 0' error after clicking "apply" and that first animation created is worthless because it seems to take the properties of an already existing animation. There's a conflict that happened somewhere at my 857 animation and I don't know why but it will always replace the first animation (worthless one) when I drag it to the element slot.

    I used to click apply in the animation tab and I didn't have to manually create a new element to my gameObject's animation list after. It would automatically create it.

    When you know your animations are correctly added you can go back in the animation tab and delete the first animation you made (worthless one) ...I let it named "Take 001".

    Hope this can get fixed tho,

    Thanks
     
    Last edited: Jul 7, 2023
  4. jo82

    jo82

    Joined:
    Dec 3, 2015
    Posts:
    43
    Weird, I haven't switched unity version and I'm not getting that Assertion failed error anymore but when I create a new animation clip I still have to manually create a new element to my animation component in the inspector and drag that new animation.
     
  5. jo82

    jo82

    Joined:
    Dec 3, 2015
    Posts:
    43
    The way I worked around this issue explained above worked until I updated my project to 2022.3.6f1.

    With 2022.3.6f1 when I create a new animation clip and click Apply I get these errors:

    InvalidOperationException: Stack empty.
    EndLayoutGroup: BeginLayoutGroup must be called first.
    Assertion failed on expression: 'm_UsedFileIDs.count(fileID) == 0'

    ...in the project window I'll find the new animation clips by their names but then when I click on them the inspector window gives me the wrong animations.

    Looks like I'll have to keep adding my new animations with 2022.3.5f1 if I want to upgrade my projects to a new LTS version.
     
    Last edited: Aug 4, 2023
  6. Lorin_Atzberger

    Lorin_Atzberger

    Joined:
    Dec 11, 2013
    Posts:
    118
    I have this happening on the latest 2021 LTS too. The meta files end up with multiple animations that share the same fileId for some reason.
     
    jo82 likes this.
  7. jo82

    jo82

    Joined:
    Dec 3, 2015
    Posts:
    43
    Exactly. Thanks for reporting.