Search Unity

Question Access Master Timeline from nested

Discussion in 'Timeline' started by AdriaMartinC, Jan 13, 2023.

  1. AdriaMartinC

    AdriaMartinC

    Joined:
    Jan 9, 2019
    Posts:
    2
    Hi!
    I have a Master Timeline with a nested timeline

    upload_2023-1-13_11-8-52.png

    I need to access the master timeline time from the SortingLayerGroupBehaviour inside the nested.

    upload_2023-1-13_11-9-22.png

    I can't find how to do it. Any help?
    Thanks.
     
  2. akent99

    akent99

    Joined:
    Jan 14, 2018
    Posts:
    588
    How are you "nesting" the timeline? Using the Unity Sequences package with an Editorial track referencing another timeline? If so, what version of Sequences? And do you want the parent timeline or parent clip? (Or do you mean track grouping in the same timeline?) I assume you want to access it from a C# script?
     
  3. akent99

    akent99

    Joined:
    Jan 14, 2018
    Posts:
    588
    Oh, the reason I was asking about the version of Sequences, is I have some code at https://github.com/alankent/Ordinar...rdinary Cartoon Maker/Scripts/SequencesApi.cs that might be interesting to browse through if using the 2.0 version of the API. It changed since 1.1 and is changing more in the future, but it hides a few things I found I needed access too (more was available in 1.0/1.1) - so had to use C# Reflection to grab the contents out of some structures.
     
  4. AdriaMartinC

    AdriaMartinC

    Joined:
    Jan 9, 2019
    Posts:
    2
    I'm not using the Sequences package
     
  5. akent99

    akent99

    Joined:
    Jan 14, 2018
    Posts:
    588
    How are you "nesting" timelines? My understanding is timelines don't have references to parent timelines - the timeline itself is an asset on disk. The bindings in the scene associate game objects in the scene with the timeline. With Sequences (which I understand you do not use), there is a hierarchy of Timelines but it maintains a hierarchy of game objects in the scene hierarchy referencing them as well, so I often use the scene hierarchy to find the relevant game object and then find the timeline linked from that game object.

    Bottom line, Timeline I don't think has what you need built in. My guess is you will need to find something about how you are "nesting" timelines that understands parentage. (I have no experience with the sorting group layer you mention sorry. I had just been programming with the Sequences package which supports nested timelines. But it sounds not relevant.)