Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

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:
    150
    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,035
    Unfortunately there is no public API for that.
     
  3. Immu

    Immu

    Joined:
    Jun 18, 2013
    Posts:
    150
    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,035
    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.