Search Unity

Custom Playable Track UI

Discussion in 'Timeline' started by james7132, Aug 9, 2017.

  1. james7132

    james7132

    Joined:
    Mar 6, 2015
    Posts:
    166
    Right now I see TrackColorAttribute as a way to alter small parts of how clips are displayed in tracks on Timeline. Is it possible to have color dynamically changed based on values for the provided clip? Even better, is there a way to inject custom GUI code for clips/tracks? Similar to that of a CustomPropertyDrawer or CustomEditor?
     
  2. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    No, it's not possible right now but it's something we are looking at for future versions.
     
  3. WikkidEdd1

    WikkidEdd1

    Joined:
    Nov 17, 2015
    Posts:
    10
    I was looking in to this just now. Internally there is some attributes and classes for making custom drawers for tracks and track inspectors, but unfortunately they are all private.

    It is possible to make them public by modifying the assembly here "C:\Program Files\Unity 2017.1\Editor\Data\UnityExtensions\Unity\Timeline\Editor\UnityEditor.Timeline.dll" using ILSpy and Reflexil and make the appropriate classes public. I've just done this for testing purposed to see what would be doable if/when they become available.

    The relevant classes are:
    CustomTrackDrawer
    TrackDrawer
    TrackAssetInspector

    You can look at ActivationTrackInspector in the assembly as an example of how to use them.
     
  4. WikkidEdd1

    WikkidEdd1

    Joined:
    Nov 17, 2015
    Posts:
    10
    Just a follow up to this. I'm working on a solution to the lack of event track. I've figured out a way of creating a single timeline track which can house lots of different clip types. The nice thing about that is you don't end up with loads of track types in the add track menu. Plus you only need to write the clip and behaviour part of a playable so that brings it from 4 files per playable to 2 which is good.

    On top of that I've created a custom event track UI. It's not the pretiest yet, but just wanted to test out my idea.

    upload_2017-8-11_17-56-49.png
     
  5. andybak

    andybak

    Joined:
    Jan 14, 2017
    Posts:
    569
    Hi. I've just hit this problem. I want an extra input on my custom track. Can you share how you managed to customize the UI?