Search Unity

Feedback [API Need] Select Timeline Instance in Editor Window from code

Discussion in 'Timeline' started by Immu, Nov 6, 2019.

  1. Immu

    Immu

    Joined:
    Jun 18, 2013
    Posts:
    240
    Hi, I'm doing my little cutscene editor tools and I'm trying to select a timeline instance in the timeline window from code.
    I managed to setup the playable director with:
    myPlayableDirector.playableAsset = myTimelineAsset;

    then select the gameObject
    UnityEditor.Selection.activeGameObject =myPlayableDirector.gameObject;


    But what I'm missing is the selection (from code) of the timeline instance and director in the timeline editor window:
    upload_2019-11-6_11-49-10.png

    I'm on Unity 2019.2.
    I searched on the scripting API
    https://docs.unity3d.com/Packages/c.../api/UnityEditor.Timeline.TimelineEditor.html
    but didn't found anything I could use, the interesting data (like masterAsset, masterDirector) being read-only

    Anyone can help ?
    Thanks!
     
  2. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    Unfortunately there is no public API for that.
     
  3. Immu

    Immu

    Joined:
    Jun 18, 2013
    Posts:
    240
    Ow :/ Thanks for the answer.
    Is there any plan for adding such things to the API or is that more on the specter of 'probably never gonna be added because contrary to the design' ?
     
  4. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    Yes, there are plans to open up the timeline editor APIs a bit more, and some work is being done right now towards that end.

    That particular use case isn't specifically on the current plan, but it looks like something we should consider. It doesn't seem contrary to the design at all.
     
    Immu likes this.
  5. Immu

    Immu

    Joined:
    Jun 18, 2013
    Posts:
    240
    Hello : P
    Just getting on the news 1 and a half year later to see if there's any possible plan for that ^-^ ?
    My current system features many timelines instances in a same game, and if selecting is already tedious, having a huge list of timelines to select from in the timeline editor makes things even more complicated...
    I'm sure I must not be the only one to feel that opening up the API for selection might help ?
    (or maybe this has been done since and I didn't found it ?)

    (Also, if that ever gets done, I'm only planning on getting on 2019.4, not further (still on 2019.2), and I start to wonder if that even could end up in 2019.3 timeline compatible package in the end...)
     
  6. lorewap3

    lorewap3

    Joined:
    Jun 24, 2020
    Posts:
    58
    Immu, I am just now getting to where I need this functionality as well. I have a custom editor window that manages multiple timeline assets and being able to open/select them from within the window is going to save ALOT of time...

    Hopefully we can hear back on this!
     
    Immu likes this.
  7. DavidGeoffroy

    DavidGeoffroy

    Unity Technologies

    Joined:
    Sep 9, 2014
    Posts:
    542
    I believe you can use this API to achieve what you want.

    You can get the TimelineEditorWindow from this other API
     
    odaimoko likes this.
  8. Immu

    Immu

    Joined:
    Jun 18, 2013
    Posts:
    240
    Great. But reading the API again and looking at my options, I feel like it's not something available in Timeline 1.1.0, which is the highest I can access to in 2019.2 :/
    'Bit disappointed that a additional API access like that have mandatory engine core changes required :/

    Well I hope the version of Timeline I'll have access to in 2019.4 LTS will be enough.
     
  9. DavidGeoffroy

    DavidGeoffroy

    Unity Technologies

    Joined:
    Sep 9, 2014
    Posts:
    542
    The API I mentioned in the previous post is in Timeline 1.5, which is compatible with 2019.4
     
    Immu likes this.
  10. Immu

    Immu

    Joined:
    Jun 18, 2013
    Posts:
    240
    Ok great! I'll test that when I'll be finally ready to update to 2019.4, thanks :cool: