Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

New in 2019.1 - Marker Customization

Discussion in 'Timeline' started by julienb, Dec 7, 2018.

  1. Midiphony-panda


    Feb 10, 2020
    The order of the markers on a Timeline track is not the chronological order on the Timeline, but the historic order of markers addition/deletion when editing the track.

    For example on this track :

    When enumerating the markers of the TrackAsset via GetMarker(int id), I'm not necessarily getting the markers 1, 2, 3 and finally 4. If the user created the markers in the order 2, 4, 3, 1, this is the order in which I will get the markers.

    From the Mixer pointer view, this can be error-prone, as I might not respect the markers order on the UI when going from one point to another (the red crosses here).

    I'm wondering if the Signals implementation suffer from the same issue (but we're not using them).

    EDIT : to solve this issue, I just sort the list of markers by time before giving it to my mixer.
    It would be nice if the markers were already sorted by time on the TimelineAsset/TrackAsset, by default.

    Attached Files:

    Last edited: Jan 10, 2022
  2. Midiphony-panda


    Feb 10, 2020
    A custom track isn't compiled if it contains markers but no clips.

    This is the (internal) code from TrackAsset.cs, apparently used for knowing if a track should or should not be compiled :
    Code (CSharp):
    2.         internal bool IsCompilable()
    3.         {
    4.             bool isContainer = typeof(GroupTrack).IsAssignableFrom(GetType());
    6.             if (isContainer)
    7.                 return false;
    9.             var ret = !mutedInHierarchy && (CanCreateTrackMixer() || CanCompileNotifications());
    10.             if (!ret)
    11.             {
    12.                 foreach (var t in GetChildTracks())
    13.                 {
    14.                     if (t.IsCompilable())
    15.                         return true;
    16.                 }
    17.             }
    19.             return ret;
    20.         }
    22.         /// <summary>
    23.         /// Whether the track can create a mixer for its own contents.
    24.         /// </summary>
    25.         /// <returns>Returns true if the track's mixer should be included in the playable graph.</returns>
    26.         /// <remarks>A return value of true does not guarantee that the mixer will be included in the playable graph. GroupTracks and muted tracks are never included in the graph</remarks>
    27.         /// <remarks>A return value of false does not guarantee that the mixer will not be included in the playable graph. If a child track returns true for CanCreateTrackMixer, the parent track will generate the mixer but its own playables will not be included.</remarks>
    28.         /// <remarks>Override this method to change the conditions for a track to be included in the playable graph.</remarks>
    29.         public virtual bool CanCreateTrackMixer()
    30.         {
    31.             return CanCompileClips();
    32.         }

    I guess I should override the CanCreateTrackMixer method from my custom track implementation, to force the creation of the mixer if needed ?

    EDIT : overriding the CanCreateTrackMixer method on my custom TrackAsset solved my issue
    (track was not compiled if it contained markers and no clips)
    Last edited: Jan 11, 2022
  3. chichichap


    May 28, 2017
    It's barely distinguishable with the new UI.

    Attached Files:

  4. Hazneliel


    Nov 14, 2013
    Hello, I'm wondering if you were able to change the color of your icons without having to define an image for each of them in the stylesheet.
  5. hamza_unity995


    Apr 19, 2022
    I wanted to share this:
    • "Editor/Stylesheets/Extensions/common.uss" works if it's under Packages
    • background-image: url does not seem to work
    • background-image: resource does not work if files are under "Packages/*Resources"
    • background-image: resource works if files are under "Assets/*Editor Default Resources"
    jdmatwork likes this.