AudioTrack not removed from meta when deleted?

Hopefully will get around to submitting a bug report.
But recently found a hard to track asset duplication issue using Addressables.
At some point:

  • A timeline had an AudioTrack that referenced an AudioClip

  • Later the AudioTrack was deleted and the AudioClip made addressable

  • The Timeline asset still contains a AudioTrack in the asset meta and a reference to the clip

  • Only way to delete the AudioClip reference was to delete the meta defining the track.

Timeline before manually deleting meta:
6991826--825767--timeline.png

Have to manually delete the meta
6991826--825770--ref.png

I hope this isn't by design?
Not even a re-import/re-serialize could remove it. It's as if the AudioTrack was a subasset and just remains forever.

Which also raises the question. Is this the case for any Timeline track?

Maybe some utility is needed: "Remove Unused Tracks" which searches the sub assets and deletes ones that aren't directly referenced by the Timeline

The tracks are sub-assets. There's no real way around it with ScriptableObjects, they need to belong to an asset file on-disk.

But removing tracks is supposed to remove them from the asset.

Without knowing what manipulations led to this, it's a bit hard to fix it automatically. We could do a check in OnValidate to check that there are no unreferenced tracks, but that would kill edition performance for anyone that has a large-ish Timeline.

Similarly with a warning in the Inspector.

But we could probably add a button in the Timeline Inspector that does a wide sweep of tracks and clips, and compares the list of sub-assets to validate that they are all referenced.

1 Like

A button would be great as a fallback. Ideally though, sub assets get deleted when deleting in the timeline window.

I'll submit a bug tomorrow

[quote=“CDF”, post:3, topic: 834943]
Ideally though, sub assets get deleted when deleting in the timeline window
[/quote]

Agreed.

If it happens again, and you manage to detect it early enough, please report anything you remember about what you were doing when it happened.

Do you have scripts that copy tracks, or tracks that refer to other tracks?

It’s really interesting that deleting the .meta is what cleared your track.

Please send us the original (broken) files if you still have them in source control when you report the bug.

Unfortunately I can't reproduce in an empty project :(. Will need to spend some more time figuring out exactly the setup needed to reproduce.

I'll report back once I'm able to

[quote=“CDF”, post:5, topic: 834943]
I’ll report back once I’m able to
[/quote]

Thank you for taking the time to chase this down.