Track cannot be loaded

I load scene by AssetBundle, the Console Window show many warning log
I click the log then Inspector show that’s some track log
And i also find some tracks can’t be loaded

Are all the tracks that aren’t loading custom tracks?

Unity track also cannt be loaded. Just like the Animaiton Track in the sc.
case1: Load scene bundle, load scene, load prefab and timeline bundle then instantiate, track cannt be loaded.
case2: Load scene bundle, load prefab and timeline bundle then instantiate, its ok. Then load scene, also work.
The scene bundle dependencies : prefab and timeline bundle

This is test project, version (2018.4.5f1)
case1:

  1. Open scene(Start) then play
  2. KeyDown.Alpha1, the scene(TestA) loaded
  3. Then KeyDown.A, load and inst prefab, the timeline on the prefab is broken, track cannt be loaded
    case2:
  4. Open scene(Start) then play
  5. KeyDown.Alpha2, the scene(TestB) loaded
  6. Then KeyDown.A, load and inst prefab, the timeline on the prefab is work

4929332–477983–Asset Temp.7z (2.64 MB)

Try placing the timeline in the same asset bundle as the prefab.

I find the reason.
Switch Inspector to DebugMode, I find the PlayableDirector have some sceneBinding don’t belong to it ref TimelineAsset.
So when i build the scene AssetBundle, the manifest has a FAKE dependencies
Its a bug?I test on 2018.4.8f1 and 2019.2.3f1
Do you have some way to fix this ?
I have a code fix all scene and prefab PlayableDirector, remove FAKE sceneBinding.
But i need to this every time beforce Build Project. I have too much prefab (nested) and scene.

What do you mean by fake? The playable director references the tracks (which are hidden sub assets of the timeline), and should pull the timeline asset into the same bundle. The timeline asset is actually a collection of assets, and the dependencies should be properly included. There could be a bug there, but nothing that I’m aware of in 2018.4.

If the timeline is getting pulled to multiple bundles, then the assets could be getting distributed among multiple bundles, which is what I suspect is happening. That would explain the timeline being partially loaded (the image you sent has missing anim clips as well, which strongly suggests that).

If you used multiple timelines on a single director, then the playable director doesn’t clear references to the previous timelines tracks. So clearing those is important (this is a known issue that hopefully we have a solution for soon). These can be ‘fake’ references, and we don’t clear them, because binding multiple timelines to a single playable director is useful in some scenarios - but we should update the UI to make it clear that is happening. It didn’t appear to be the case in your sample though.

So, I’d suggest either

  1. Make sure the timeline is assigned to the same bundle as the prefab.
  2. If you want the timeline in a separate bundle, don’t include the playable director in the prefab, and instantiate it at runtime.

My FAKE mean:
The playable director references the tracks dont’ remove pre TimelineAssets’ track when replace a new TimelineAsset.
Material have same problem, also include some m_SavedProperties and don’t belong to bind shader.
So i will find some disturbing info when check bundle on the AssetBundle Browser.
Thanks for your help.

  1. Make sure the timeline is assigned to the same bundle as the prefab.

– Can i load timeline assetbundle and then load playable director assetbundle?

I believe that will work.

:face_with_spiral_eyes:
a : AssetBundle.LoadFromFile() to load Timeline assetbundle ----------- assetBundleT
b : AssetBundle.LoadFromFile() to load PlayableDirector assetbundle - assetBundleP
c : assetBundleP.LoadAsset() to load PlayableDirector prefab ------------ pd
d : assetBundleT.LoadAsset() to load Timeline.playable -------------------- asset

a → b → d → c : asset.outputTrackCount == 4
a → b → c → d : asset.outputTrackCount == 0

why should i load dependency asset manually ?

a → b → c → d : asset.outputTrackCount == 0

That is curious… Are you assigning the timeline asset manually after it is loaded?

You probably shouldn’t, unless it is referenced by multiple scenes/assets.

Emm…
Or do I need to clear references to previous timeline tracks, even if the timeline assetbundle is loaded first ???

that’s my test code and inspector

5368017--543078--PrefabInspect.png 5368017--543081--TestCode.png

It appears that only the timeline asset itself is loaded, and none of the tracks. Tracks, PlayableAssets, AnimationClips are all sub-assets inside the playable file. How did you create the asset bundle?

but a → b → d → c goes right

and my build code
5371905--543696--buildcode.png

Can you see what is getting packed in each bundle? Is the timeline asset itself getting packed inside the playable director?

i dont know how to see that …

5375913--544329--playabledirector.png 5375913--544332--testtimeline.png

or need the whole project ?

It makes sense that a->b->d->c works then, and that is the appropriate way to do it. Load the asset before the object that links to it.

In the case of a->b->c->d, after ‘c’, check if playableDirector.playableAsset is set. That would be the timeline asset. It should be null. If it isn’t, then that might mean an empty timeline asset is getting loaded, or it is getting split between the two bundles.

I suspect there is a bug here, I’m just not sure where. Feel free to open a bug and attach it, and our QA team will have a look. Timeline and Assetbundles are complicated because a timeline is a collection of assets in a single file, and it is possible to accidentally split those assets over multiple bundles - which breaks links between them (e.g. timeline asset to tracks, tracks to clip playable assets, clips to animation clips…). I’m guessing that a->b->c->d is causing a timeline asset with broken links to get loaded.

thanks.
emm…
does “open a bug and attach it” means post a new thread in forums

Load your repro project in the editor. Then under the Help menu, select ‘Report a Bug…’.