Search Unity

  1. New Unity Live Help updates. Check them out here!

    Dismiss Notice

Blending of AnimationClipPlayables missing keys

Discussion in 'Timeline' started by kogtech7, Feb 24, 2020.

  1. kogtech7

    kogtech7

    Joined:
    Jul 31, 2017
    Posts:
    10
    I have a character animated in Timeline by blending between AnimationClipPlayables. At a given time, the sum weight of two ClipPlayables is 1, and the weight of every other playable in the mixer is 0.

    But if Clip A keys transforms X, Y, and Z on the character and Clip B keys X and Y only, the status of Z is in limbo. There are a few logical outcomes on Unity's end:
    • Clip B uses the the character's default transform for Z
    • Clip B uses the the animator's state to calculate Z
    • Clip B is pass-through, giving Clip A an effective weight of 1 on Z (normalization approach)
    • Clip B is pass-through, forcing Clip A to blend with (0, 0, 0) because the sum weight affecting Z is < 1
    Right now, I'm getting the last behavior — but I want anything except that. Is this the intended behavior? I'm porting an older, state-playing animation library to Timeline and editing every animation clip to have every transform keyed is not ideal.
     
  2. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,194
    Your observation is correct. This is a limitation of the animation system. If you key one channel of a position, it applies all three, assuming 0 for unkeyed channels.
     
    kogtech7 likes this.
  3. kogtech7

    kogtech7

    Joined:
    Jul 31, 2017
    Posts:
    10
    Thanks for the confirmation!
     
  4. kogtech7

    kogtech7

    Joined:
    Jul 31, 2017
    Posts:
    10
    Apologies - I should have clarified. I am not referring to individual transform components, but to entire transforms.

    So if Clip A keys the lips and jaw, and Clip B keys only the lips; the jaw breaks as Clip A transitions to Clip B. This happens because the default rotation of my model's jaw is not (0, 0, 0).
     
  5. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,194
    Ok, that is a different situation, but the value being blended for the jaw is likely still 0. If I'm not mistaken, humanoid uses a default pose, which is not necessarily the default pose of the object.

    Generic should be using the default value of the object.
     
  6. KognitoAK

    KognitoAK

    Joined:
    Mar 5, 2020
    Posts:
    2
    Figured out the issue.

    My animator had a Runtime Animator Controller attached to it. I use it to get data about the clips, then create custom Playable Graphs that take control instead. But it turns out the Controller was still exerting influence by playing the default state. The effect was not visible until this "mixing keyed and unkeyed transforms" case, so I never took note.

    Nulling out the controller at the start of Playmode fixed everything, including problems I thought were unrelated!
     
    seant_unity likes this.
unityunity