Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Inconsistent Timeline AnimationOutput blending behavior (Edit Mode T-pose)

Discussion in 'Timeline' started by zander_m, Feb 22, 2019.

  1. zander_m

    zander_m

    Joined:
    Feb 7, 2019
    Posts:
    15
    I'm noticing a difference in the blending behavior and resulting playable graph between play and preview mode when using an animation track to play a clip with ease in/out on a humanoid rig.
    TimelineSetup.png

    In edit/preview mode, this setup produces the following playable graph:
    EditModePlayableGraph.png

    The upper Animation Clip leaf node is the looping "run" animation we've placed on the timeline, the lower Animation Clip leaf is a "HumanoidDefault" clip (t-pose) that has been automatically inserted (presumably by the timeline editor/playable director?). When the "ease out" part of the clip is played or scrubbed over, the "run" animation is blended with this "HumanoidDefault" clip via adjusting weights on the Animation Mixer.

    In play mode, we end up with a playable graph that looks like this:
    PlayModePlayableGraph.png

    The "HumanoidDefault" clip is no longer automatically inserted, and the related Animation Offset and Animation Mixer nodes are also missing. Now when the "ease out" part of the timeline clip is played or scrubbed, we can see the weight on the Animation Output node itself being changed. This results in our timeline clip being blended with whatever other Animation Outputs are targeting our output Animator (in our case, a default/empty runtime animation controller). The result is a strange "dampened" version of our animation as the weight of the graph's Animation Output node approaches 0.


    I'm trying to understand the expected behavior of the Timeline when blending multiple Animation Outputs targeting the same Animator. From my understanding, some of this behavior is intended to allow blending from a Timeline's Animation Output with that of the target Animator's default Animation Controller. But blending a the Animation Track with a "HumanoidDefault" pose vs. blending the Animation Output by setting it's weight, often produces extremely different results.

    What I'm ultimately trying to accomplish is a timeline clip representing a section of animation that is driven by an Animator Controller. This needs to exist on/alongside a default Animation track targeting the same Animator. Currently my setup relies on the way the Timeline is adjusting the weight of the Animation Output in play mode and the way these outputs are blended behind the scenes (by the Animator itself?). This approach unfortunately does not preview properly outside play mode because of the blending differences.
     
    cdnDave likes this.
  2. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    Let me try and help with an explanation of how/why, and see if that helps:

    The animator has an internal stack of AnimationOutputs. The AnimatorController is always the base layer. And timeline places an output on top of the stack when it plays. The animator starts at the top and evaluates each output. Timeline promotes the clip weights up to the output, so you can ease in/out between timeline and the animator controller. With this you can blend one timeline to the other as well, since the most recently played timeline is on top of the stack.

    The humanoid default track (i.e. output) is because the controller doesn't have a preview and does not evaluate when the editor is not in playmode, it is intentionally skipped. The humanoid output provides a fixed pose to blend to and from when not in playmode. Otherwise, scrubbing timeline where there is no weight provides the last known pose (a bug you can see in early versions of Timeline).

    The humanoid default track isn't applied in playmode, because the animator controller, physics, and all other systems that can effect the position/pose of the object are running.

    That means that you can't actually preview the controller with timeline in non-Playmode. That's something that we would like to address in the future.
     
    makaolachsiungca and zander_m like this.