Search Unity

Getting the hash of the current blend tree motion

Discussion in 'Animation' started by Rinen7, Feb 5, 2020.

  1. Rinen7

    Rinen7

    Joined:
    Feb 3, 2020
    Posts:
    2
    Hi there, I am trying to get the hash of the currently playing blend tree motion during runtime.

    It appears that animator.GetCurrentAnimatorStateInfo(0).fullPathHash returns the hash of the blend tree state itself and does not take the currently playing blend tree child motion into account.

    Is there any workaround for this?
     
  2. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    There isn't because the Blend Tree could be blending between multiple animations so there is no hash that would actually make sense there. What are you actually trying to achieve?
     
  3. Rinen7

    Rinen7

    Joined:
    Feb 3, 2020
    Posts:
    2
    Good point. I've developed a tool that overrides animation state data during runtime and was wondering if it could support blend trees as well. As my tool currently uses fullPathHash to tell apart which animation state is currently playing, I was hoping there was a similar way to tell apart which blend tree motion is playing so I could override that motion data as well.