When using TimelineAsset.CreatePlayable() to make a PlayableGraph PlayableGraph.GetResolver() is always null; how do we create a resolver for it?

I got to the bottom of this.

As it turns out, you can trivially create an IExposedPropertyTable as essentially a wrapper over a dictionary and pass that to PlayableGraph.SetResolver().

However, the behaviour of the ControlTrack asset when creating the playable(s) in inserts into the PlayableGraph is to initialise all the ExposedReference values once on creation and they are not resolved again.

For my use case of wanting to create a PlayableGraph containing a Timeline not owned by a PlayableDirector but to copy all the bindings from a PlayableDirector then you need to:

  1. ensure that all the ExposedReference values from the PlaybleDirector are in the your custom IExposedPropertyTable
  2. and that you have assigned it to the PlayableGraph you’re creating the timeline in before you pass it TimelineAsset.CreatePlayable()

The code I have is a bit large for posting inline, so I’ve made a .unitypackage of a test scene and the proof of concept code I used to achieve it - will post it in the reply to this…

I hope it helps someone else because it took me waaaay too long to work all this out!! :exploding_head: :sob:

Also, as I mentioned in this post Simple suggestion to prevent performance issues caused by Timeline / PlayableDirector

this whole thing would have been avoidable there was the option to prevent PlaybleDirector from automatically destroying its PlayableGraph on Stop()/Disable()/Timeline End
(e.g. Preserve & Reuse PlayableGraph :white_check_mark: )