Search Unity

Bug Blend Trees are not removed in animator controller asset file after delete it in Animation window

Discussion in 'Animation' started by Guitoon, Aug 25, 2021.

  1. Guitoon

    Guitoon

    Joined:
    May 1, 2019
    Posts:
    6
    1. What happened

    Blend Trees created in an animator controller are still serialized even after deletion in the Animator window.
    This happens for blend trees created in blend trees.


    2. How can we reproduce it

    - Create an animator
    - Create a blend tree in it and name it
    - Delete it, Save Project and watch in file

    You can try this with Blend Trees created in an other Blend Tree

    Is it normal to not delete them ?
    If an AnimatorControllerOverride references this AnimatorController, his serialization is not refreshed properly too

    PS : They're still found too in some tools like Asset Usage Detector (https://assetstore.unity.com/packages/tools/utilities/asset-usage-detector-112837) when an animator clip is referenced in a deleted Blend Tree
     
    detzt likes this.
  2. Guitoon

    Guitoon

    Joined:
    May 1, 2019
    Posts:
    6
    Anyone knows a trick or something ?

    It happens on Unity 2020.3.10
     
  3. binster

    binster

    Joined:
    Oct 16, 2012
    Posts:
    13
    Just to echo what you're seeing :

    I am currently suffering from an assert when applying an animator override controller at runtime with the error message :

    "Assertion failed on expression: 'index < m_FloatCount' / UnityEngine.StackTraceUtility:ExtractStackTrace()"


    I've traced the issue down to the fact that there is a blendtree that is referencing a float parameter that I have subsequently deleted. The blendtree is also 'deleted' but looking through the animator controller file in a text editor reveals there are about three or four blendtrees that have not been deleted, but are not visible in the animator editor window.

    I tried hacking them out of the file but got a hard Unity Crash on boot. So my solution currently is to re-add the property that I deleted and the assert is gone.

    Would love someone from Unity to take note of this. Guess I should submit a bug report, eh?
     
    Guitoon likes this.
  4. detzt

    detzt

    Joined:
    Oct 6, 2018
    Posts:
    21
    Bump, as this is still the case in the current Unity version and just bit me today.
     
    Guitoon likes this.
  5. detzt

    detzt

    Joined:
    Oct 6, 2018
    Posts:
    21
  6. detzt

    detzt

    Joined:
    Oct 6, 2018
    Posts:
    21
    My reproducible case was fixed in Unity 2023.2.13.
    I'm not sure if this fixed your issue @binster as well?