Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on Thursday, June 8, for a Q&A with Unity's Content Pipeline group here on the forum, and on the Unity Discord, and discuss topics around Content Build, Import Workflows, Asset Database, and Addressables!
    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:
    25
    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