Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    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:
    77
    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