Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Timeline track names not unique ?

Discussion in 'Timeline' started by Kiupe, Sep 11, 2017.

  1. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    523
    Hi guys,

    I noticed that in one Timeline multiple tracks can have the same name. Do you confirm it is the expected behavior ?

    Thanks
     
  2. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    909
    Yes, they can have the same name.
     
  3. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    523
    Ok, so if I want to get an unique information about a track I could use the PlayableBinding.sourceObject.GetInstanceID() ?
     
  4. mathiastg

    mathiastg

    Joined:
    Jun 3, 2016
    Posts:
    4
    You could give them unique names and use that to get specific information about a track.
     
  5. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    909
    Yes, in the case of timeline, the source object is actually a reference to the track.
     
  6. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    523
    Hum, how are those IDs created ? I tried to use those IDs in order to "save" Timeline scene cross-references but when I open the project in an other computer an ID for a same Track (source object) it's not the same as on my computer. Is that normal ?

    Thanks
     
  7. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    909
    InstanceIDs can change between runs of the editor. You should use a UnityEngine.Object field directly to store the reference, instead of an int.

    Tracks are assets, so a reference to them can be stored from any scene.
     
  8. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    523
    Ho, thank for the tips !