Search Unity

API support for track-level animation

Discussion in 'Timeline' started by taylank, Mar 8, 2019.

  1. taylank

    taylank

    Joined:
    Nov 3, 2012
    Posts:
    182
    I just saw this in 2019 beta release notes. Can someone explain to me what it means? I can't find any information on it. What does this allow me to do that I can't do in 2018.3?
     
  2. sebastienlh

    sebastienlh

    Unity Technologies

    Joined:
    Sep 22, 2017
    Posts:
    40
    I agree that the wording is a bit cryptic at this point, so let me try to explain:

    First of all, what we mean by "track-level animation" is actually the animation of the properties of a PlayableAsset attached on a TrackAsset (which is most likely going to be some sort of mixer, but it doesn't have to). So, instead of animating objects in the scene, think of it as animating the Track itself.

    Second, we wrote "API support" because in the 2019.1 release, there is no UI to back this feature. It is possible to experiment with the feature through the new Curves APIs on TrackAsset; but it would require some work on your part. Basically, you would have to create Curves (our curves are currently stored as an AnimationClip) on your track asset and programatically add keys to animate your PlayableAsset.

    It was added to 2019.1 as a ground work for future features and for the more adventurous users who are willing to get their hands dirty. Coming in 2019.2, there will be UI to edit these animations and it will be trivial to use.

    Hopefully, I've clarified things a bit.




    Here's the parts of the API that should be the most relevant to users:

    TrackAsset.curves
    https://docs.unity3d.com/Packages/c...t.html#UnityEngine_Timeline_TrackAsset_curves

    TrackAsset.hasCurves
    https://docs.unity3d.com/Packages/c...tml#UnityEngine_Timeline_TrackAsset_hasCurves

    TrackAsset.CreateCurves()
    https://docs.unity3d.com/Packages/c...meline_TrackAsset_CreateCurves_System_String_
     
  3. taylank

    taylank

    Joined:
    Nov 3, 2012
    Posts:
    182
    Thank you for the info. Let me see if I'm understanding this right: does this mean I can do something like have a track that instantiates an object midway through the graph execution (like a custom Control track), and animate the transform or other exposed properties of that track via Curves?
     
  4. sebastienlh

    sebastienlh

    Unity Technologies

    Joined:
    Sep 22, 2017
    Posts:
    40
    Yes, that's correct. You would have to move the animation code to the mixer in that case, but it would definitely be possible.
     
    taylank likes this.