Is it possible to generate a new timeline and populate it with tracks/behaviors through script?
The use-case which is driving this question is we have about 50 short timelines we are creating. They have 1 looping animation, 1 track for blinking (custom), and 1 track for lip sync data (custom extension on Rogo LipSync I put together).
It would be fantastic if we could batch process these in a script which loops through all the assets and assembles each timeline. The ability to use code/editor tooling to create these would be very powerful.
Hellow,
I’m trying to generate timelines through script to avoid some user interactions on the scene.
The generation is working well, the created timeline has the same look as when I create it manually, and the preview works fine, but when I hit play, all my generated tracks disappear in the timeline and nothing is played after (but the length is kept, check the screenshot : ).
Here is a part of my code :
Exactly. The tracks and clips are (hidden) sub assets of the timeline asset. The timeline needs to exist in the asset database before the tracks are added.
I do the same as you do, but I have already created a Timeline where I want to add new tracks and clips on runtime. This works great and I can also bind the tracks to the game objects to animate. The tracks are saved correctly. But the bindings are not saved. Does anyone know how to also save the bindings?
That is a bit trickier. Timeline is an asset, so changes to it will be saved, but the bindings are saved in the playable director, which as part of the scene, gets reverted when play mode is exited.
The user can do it by copying the values of the playable director in playmode, then pasting them in one in edit mode.There are some solutions to automate that out there, one of which exists in Cinemachine.
Go to Package Manger window and select the Timeline and Playables package to see the link to proper docs for the package you are using. That link takes me to 2017 docs before they took the API out and made it separate…
I have related issue :- I am making a game which uses timeline sequence video every time new level loads. And for every level we are making assetbundle , now as these timeline sequences uses common animation , in each level, assetbundle for every level is including common animations in it. is there any way that common animations should not go in assetbundle as it increases the size of assetbundle.