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

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 (Asset Usage Detector | Utilities Tools | Unity Asset Store) when an animator clip is referenced in a deleted Blend Tree

1 Like

Anyone knows a trick or something ?

It happens on Unity 2020.3.10

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?

1 Like

Bump, as this is still the case in the current Unity version and just bit me today.

1 Like

I filed a bug report: Unity Issue Tracker - Blend Tree data remains in the Animator Controller when the Motion property of the State is changed

1 Like

My reproducible case was fixed in Unity 2023.2.13.
I’m not sure if this fixed your issue @binster as well?