Get keyframes/timestamps from Kairos Timeline

Hi! I am new to Gamma and Kairos and want to ask how is it possible in Timeline to create something like timestamps or states (like “Beginning”, “Scene1”, “Transition”, “Scene2”…) and to get a spread of names and time values (keyframes) of these timestamps out of the Timeline (like “Beginning” 1.0, “Scene1” 3.0 etc.)? In Beta’s Timeline there were output pins like AutomataState and AutomataStateTime which did exactly this… I thought of creating a string track in Kairos Timeline - but how can I get the keyframes of this track? Thanks!


Hello @overtones,
good to see you patching along with kairos.

Let me introduce you to a very simple concept thatis at the core of kairos, that will help us out after:
every kairos node follows a programming pattern named Model-Runtime, where basically the configuration of your node (in the case of the timeline: all the tracks and keyframes) is stored inside the node as an immutable description of the program, called Model. It’s like the complete instruction for the runtime to instantiate the living node. it’s the genetic code, so to say…
in kairos you can always retrieve the Model of a node, and you can even programmatically edit it (from the patch, for example). the runtime will react to the changes and update the living node to the latest Model.

In your case you simply want to read out the keyframes of a track (of type String) named Scene.
I attach a patch where you can see how to:
1- get a Model out of the Timeline
2- retrieve the track that you are interested into
3- retrieve its keyframes and read their data
ExtractSceneTrackKeyframesUtil.vl (60.8 KB)

This is a preview of the patch and what it doews:

QUICK NOTE:
You are currently (rightly so) using a very old version of kairos, since a more recent nuget was only released as prerelease.
You can keep going with this version, keeping in mind that very soon there will be a new release, quite different (way simplified also at the model level) and that you will need to change some of these patches if you want to jump to latest version.
I don’t exclude that there will be Markers in the new timeline, so that you don’t need to workaround it using a string track.

I hope this helps

Best

2 Likes

Thank you so much @dottore for all the explanations. It works well on my side, but I’m also looking forward to the new Kairos version.
One last question: When retrieving track values, for example with SampleTrack, is it possible to get the vertical line in the Timeline Window moving to the same time position? Or is there any way to precisely set the time position of this vertical line from outside, without pressing the play button in the Timeline’s UI? It would be just very comfortable to see this vertical line in a position which corresponds to the values I am getting with SampleTrack. Many thanks!

hey,
first of all, we need to make sure you have the right setup in the patch:
are you using Compositionsampler and the kairos clock like in the timeline help patch?


if so you can control the time by operating on the Clock node (Seek operation).
In the Timeline UI you can also use the mouse on the timebar to set and scroll time. by keeping Shift pressed you also snap to time grid.
SetClockTimeViaMouseInteraction

If you have ideas for improving the experience you can describe them as issues in the repository. it’s cool to collect there all the requests ;)

cheers

Great, thank you again @dottore for your help! I used SampleTrack before which didn’t let the line move, but with Clock it works well now.