Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on Thursday, June 8, for a Q&A with Unity's Content Pipeline group here on the forum, and on the Unity Discord, and discuss topics around Content Build, Import Workflows, Asset Database, and Addressables!
    Dismiss Notice

Question How to get clip ease timing at runtime?

Discussion in 'Timeline' started by neonblitzer, Mar 25, 2023.

  1. neonblitzer


    Aug 5, 2013
    How could I access the TimelineClip's easeIn or easeOut durations in PlayableBehaviour.ProcessFrame (either in a track mixer or in the behaviour representing the clip)? I can get the current input weight from Playable.GetInputWeight but I'd like to find out whether the easing of the input playable is currently in the rising or falling phase.
  2. jonagill


    Oct 5, 2019
    I haven't found a good way to get access clip info directly from PlayableBehaviour, but you can pass a clip reference (or valid data) down from a custom Track, into your custom PlayableAsset, and from there into your PlayableBehaviour.

    You can drop something like the following into your `TrackAsset.CreateTrackMixer()` override:

    Code (CSharp):
    1.             var clips = GetClips();
    2.             foreach ( var clip in clips )
    3.             {
    4.                 if ( clip.asset is MyAssetType myAsset)
    5.                 {
    6.                     myAsset.Clip= clip;
    7.                 }
    8.             }
    You can then pass the clip reference to your PlayableBehaviour in your