Search Unity

don't see binding field in custom track type?

Discussion in 'Timeline' started by halley, Apr 22, 2019.

  1. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    2,445
    I'm running through the typical tutorials for writing custom track types. There are a pair of similar examples which create "Light Control" tracks, playablebehaviors, and playableassets (clips).

    // https://blogs.unity3d.com/2018/09/05/extending-timeline-a-practical-guide/
    //


    I can Add > Light Control Track, or I can drag a Light onto the timeline and specify > Add Light Control Track.

    However, following either of these examples, I should see the track title area with a sunken drag/drop field which refers to the Light to which the given track is bound. This is not happening in 2018.3.8f1; the track simply displays the name "Light Control Track" (or "Light Control Track (1)" if I add a second one. I cannot drag a Light onto the track to establish the binding, either.

    Code (CSharp):
    1. using UnityEngine.Playables;
    2. using UnityEngine.Timeline;
    3.  
    4. [TrackClipType(typeof(LightControlClip))]
    5. [TrackBindingType(typeof(Light))]
    6. [TrackColor(0.94f, 0.98f, 0.39f)]
    7. public class LightControlTrack: TrackAsset
    8. {
    9. }
    10.  
    Code (CSharp):
    1. using System;
    2. using UnityEngine;
    3. using UnityEngine.Playables;
    4.  
    5. [Serializable]
    6. public class LightControlBehaviour: PlayableBehaviour
    7. {
    8.     //...
    9.     public override void ProcessFrame(Playable playable, FrameData info, object playerData)
    10.     {
    11.         var light = playerData as Light;
    12.         //...
    13.     }
    14. }
    15.  
    Code (CSharp):
    1. using System;
    2. using UnityEngine;
    3. using UnityEngine.Playables;
    4. using UnityEngine.Timeline;
    5.  
    6. [Serializable]
    7. public class LightControlClip: PlayableAsset, ITimelineClipAsset
    8. {
    9.     //...
    10.     public ClipCaps clipCaps { get { return ClipCaps.None; } }
    11.     public override Playable CreatePlayable (PlayableGraph graph, GameObject owner)
    12.     {
    13.         var playable = ScriptPlayable<LightControlBehaviour>.Create(graph, template);
    14.         //...
    15.         return playable;  
    16.     }
    17. }
    18.  
     
  2. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    Are you working with a timeline on a playable director, or editing a timeline directly. It won't show bindings if you are editing in 'asset mode'. Make sure you have the playable director controlling the timeline selected.
     
  3. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    2,445
    Okay, I think that makes sense. I do wish that the tutorials explained this, as neither one seems to touch upon it. Or better yet, some bit of the interface could hint that bindings aren't possible until the timeline is associated with a director.
     
  4. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    Agreed, definitely an area we could improve.