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

Question Custom tool selecting TimelineClip and show it in inspector

Discussion in 'Timeline' started by NoPanDa, Mar 25, 2023.

  1. NoPanDa

    NoPanDa

    Joined:
    Jan 18, 2020
    Posts:
    10
    How can I assign a clip to show in the inspector? I can't use the normal way (Selection.activeObject) as they are not Objects. I can't find anything about this anywhere.

    I'm currently making a custom tool where I have a Graph View with nodes that each represent different playable directors. When I click one of the nodes in the graph view I would very much like it if the inspector would show a certain type of custom clip from that director.
     
  2. tsukimi

    tsukimi

    Joined:
    Dec 10, 2014
    Posts:
    80
    If you can get the clip instance, you could use the below code to select them.
    Code (CSharp):
    1. TimelineClip targetClip = ...;
    2. TimelineEditor.selectedClip = targetClip;
    3.  
    4. // selecting multiple clips:
    5. TimelineClip[] targetClips = ...;
    6. TimelineEditor.selectedClips = targetClips;
     
    Last edited: Mar 26, 2023
    NoPanDa likes this.
  3. NoPanDa

    NoPanDa

    Joined:
    Jan 18, 2020
    Posts:
    10
    Thank you so much! I got the clip reference already, so that should be easy! Will try that tomorrow :D