How to reset timeline clip values?

Hi, I am making a movie-like application in VR and I want to load the assets in memory as the timeline goes on. In order to do this I want to duplicate the final timeline, clear its references and re-fill them at runtime(I know it is a bit tricky but I dont want the designers to worry about changing the workflow they are used to). Now, the issue is that I cannot find a nice way to access the clip references (i.e. the animation clip) and clear them. Any clue on how to do this?

TLDR: I want to duplicate a timeline clip by clip without all their references

The tracks can be accessed using TimelineAsset.GetOutputTracks(). The clips of a track can be accessed using TrackAsset.GetClips().

A timeline clip has a reference to the PlayableAsset, which needs to be cast as the correct type. For example, to remove the animation clip: ((AnimationPlayableAsset) timelineClip.asset).clip = null.

And as far as duplicating a timeline, the best way to do that is using AssetDatabase to copy the entire asset. A timeline is a collection of assets in a single file, so just copying a TimelineAsset will not copy the tracks and clips, and you will end up with two timelines referencing the same tracks and clips, and edits to one will affect the other. Using the AssetDatabase will copy all relevant pieces and update their references.

@seant_unity Thank you for the answer.

I am aware I can access the clip and cast it to clear its references, but it requires that every time I create a new asset type I have to add some logic to clear that specific type, wich I am trying to avoid. I realize I did not explain myself very well, I’m sorry for that. In any case, if you have any idea on how to achieve this without having to add code every time a new asset is created it would be very much appreciated.

With the timeline duplication I am doing that with asset database as you pointed out.