Search Unity

Blending at runtime different animation clips ? (like the timeline animation track does)

Discussion in 'Animation' started by Roy-Massaad1, Aug 27, 2017.

  1. Roy-Massaad1

    Roy-Massaad1

    Joined:
    Jun 30, 2015
    Posts:
    16
    Hi

    Is there a way to blend by script at runtime different animationclips for the same state in a state machine ?

    Directly related to that, is there a way to know what is the current animation frame/matrix an animator is currently playing so i can use that for mixing?

    Im interested in this type of blending to recreate the default animation track of the timeline that takes as track binding an animator, and as clip input different animation clips and then mixes them for the final animation

    I want to recreate this functionality so i can add more features to it in a new playable track.

    so far i did get the boilerplate code ready for data/clip/mixer/track extension scripts the timeline needs
    i also figured out how to use the AnimatorOverrideController & RuntimeAnimatorController

    But how to mix them together before weighting them and outputting them still is unclear
     
  2. Roy-Massaad1

    Roy-Massaad1

    Joined:
    Jun 30, 2015
    Posts:
    16
    i found a couple of interesting classes, but as of yet not sure if they are the ones

    AnimationState
    https://docs.unity3d.com/ScriptReference/AnimationState.html

    this class exposes blending functions, great, but it seems to only work with the legacy animation system and not the animator with state machines

    If that is the case, is there a way to transform/change/port legacy animation into the animator system ?

    second thing i found interesting was this

    SampleAnimation
    https://docs.unity3d.com/ScriptReference/AnimationClip.SampleAnimation.html
    it works on the animation clip itself, i still need to test it to understand it further and see if it fits the needs of the timeline animator extension playable track puzzle in the first post