Search Unity

Question How to get clip ease timing at runtime?

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

  1. neonblitzer

    neonblitzer

    Joined:
    Aug 5, 2013
    Posts:
    13
    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

    jonagill

    Joined:
    Oct 5, 2019
    Posts:
    12
    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
    PlayableAsset.CreatePlayable()
    override.