Accessing TrackAsset.CreateDefaultClip() from the same object with a Monobehaviour script

Hi! Is there a way to access the creation of a default clip of a particular TrackAsset through a Monobehaviour script

I have a Monobehaviour script that has an Editor Button and it’s attached to an object that has a timeline. On Click, I would like to create as many default clips in the timeline as there are elements in the Monobehaviour array.

Can you please tell me what I’m missing? I can’t seem to be able to find where to get the reference to trackasset through the playable director component. Here’s a picture to clear things up.

Would it be through GetGenericBinding()? If so, how does that work?

Thanks!

From the playableDirector you can cast the playableAsset field to a TimelineAsset.

From the timeline asset, you can iterate over the tracks using GetOutputTracks().

1 Like

Hey man, thank you so much! It worked! Have a good day!