Possible to read Sequencer track data?

Let’s say I’m adding fog actor to Sequencer’s shot. I’m adding keyframes for its params (like distance, density, color)>
Is it possible to read value of keyframes from Sequencer asset, so I could use in scripts?

You could do it in c++. For example, if you have the asset, ie. the FStringAssetReference, you can call TryLoad() to get the ULevelSequence and then get the UMovieScene. From there, you’ll have access to the tracks, the sections for each of the tracks, and ultimately the keyframes on the sections. You’ll need to dig through MovieScene.h to get all the relevant bits.

Hi Max, related question… What does MovieScene->FindTrack expect as parameters? I have:

FGuid Guid;
	FName name = "table";
	LevelSequence->MovieScene->FindTrack(Guid, name);

but it will not compile. Thanks!

I used another FindTrack() in my code. This function is just quick test, but you should get idea how to fetch tracks :slight_smile:

.h

UFUNCTION(BlueprintPure, Meta = (DisplayName = "Get Sequencer Track", Keywords = "sequencer track"))
		static TArray<UMovieSceneTrack*> GetSequencerTrack(const class ULevelSequence* Asset, TSubclassOf<UMovieSceneTrack> TrackClass);

.cpp

TArray<UMovieSceneTrack*> USequenceBlender::GetSequencerTrack(const class ULevelSequence* Asset, TSubclassOf<UMovieSceneTrack> TrackClass)
{
	TArray<UMovieSceneTrack*> tracks;

	if (Asset) 
	{
		UMovieScene* movie = Asset->GetMovieScene();
		for (int i = 0; i < movie->GetPossessableCount(); i++)
		{
			const FGuid& guid = movie->GetPossessable(i).GetGuid();
			UMovieSceneTrack* track = movie->FindTrack(TrackClass, guid, NAME_None);
			if (track != nullptr)
				tracks.Add(track);
		}
	}
	return tracks;
}

Of course maybe need to identify track in different way.
If you’re looking for property of Expotential Fog component, you would rather write your own FindTrack() which checks PropertyName of MovieScenePropertyTrack (this would be equal to “FogHeightFalloff”).