Level / Master Sequence in Unreal Engine

Published on

How to work with Level Sequencer with C++ in Unreal Engine?

Platforma

Sequencer, is a powerful cinematic tool used for creating, editing, and controlling complex cinematic sequences, cutscenes, and interactive storytelling experiences within a game or interactive project. It allows to create Level Sequence (single file) as well as Master Sequence that is a Sequence containing Level Sequence(s).

Level Sequences serve several purposes:

  1. Cinematic Storytelling: Level Sequences are primarily used for creating cinematic sequences and cutscenes within a game. They allow developers to craft visually engaging storytelling moments, including camera animations, character animations, and scripted events.
  2. Animation Control: They enable the precise control of animations, both for characters and objects. Animations can be keyframed and synchronized to the timeline, offering fine-grained control over character movements, facial expressions, and other animations.
  3. Camera Work: Level Sequences provide tools for crafting dynamic camera movements and shots. Cinematographers can set up camera angles, field of view, focus, and depth of field to create cinematic visuals.
  4. Audio Integration: Audio cues and soundtracks can be integrated into Level Sequences to synchronize sound effects and music with the on-screen action.
  5. Real-time Interaction: Level Sequences can also be used for real-time interaction and gameplay sequences, allowing developers to create dynamic events that respond to player actions.
  6. Non-linear Storytelling: They enable non-linear storytelling by branching sequences based on conditions or player choices, making them versatile for creating interactive narratives.
  7. Editing Environment: Unreal Engine Sequencer provides a user-friendly timeline-based editing environment with features like keyframing, blending, and visual effects, making it suitable for artists, designers, and animators.
  8. Performance Capture: Level Sequences can be used in conjunction with performance capture technologies, such as motion capture and facial animation systems, to create lifelike character animations.

Overall, Level Sequences are essential for creating engaging cinematic and storytelling experiences in Unreal Engine, bridging the gap between gameplay and narrative elements in interactive projects.

  • Prefix for Level Sequence asset files: LS_

Load Level Sequence (Helper function)

/**
 * <mark>Load Level Sequence</mark>
 *
 * @param LevelSequencePath	The path of the level sequence asset: "/Game/Folder/MyLevelSequence"
 * @param bOutSuccess	If the action was a success or not
 * @param OutInfoMsg	Error message in a case of bOutSuccess == false
 * @return The loaded ULevelSequence*
 */
UFUNCTION(BlueprintCallable, Category = "<a href="https://www.youtube.com/watch?v=ms-EuSgWEiA" target="_blank">Add Remove Actor From Level Sequence</a>")
<strong>static ULevelSequence* LoadLevelSequence(FString LevelSequencePath, bool& bOutSuccess, FString& OutInfoMsg);</strong>

Add / Remove Possessable Actors In Level Sequence

The code below adds already existing Actor type of component in the scene into defined Level Sequence. If the actor is not placed in the scene, use Add Spawnable Actors In Level Sequence process istead. It's very similar function that differs especially in linking at asset by it's name instead of pointing at the actor itself.

Get Actor Guid From Level Sequence

/**
 * <mark>Get actor guid from level sequence</mark>
 *
 * @param Actor		The actor to get from the level sequence
 * @param LevelSequencePath		The path of the level sequence asset: "/Game/Folder/MyLevelSequence"
 * @param bOutSuccess	If the action was a success or not
 * @param OutInfoMsg	More information about the action's result
 *
 * @return The guid of the actor in the level sequence
 */
UFUNCTION(BlueprintCallable, Category = "<a href="https://www.youtube.com/watch?v=ms-EuSgWEiA" target="_blank">Add Remove Actor From Level Sequence</a>")
<strong>static FGuid GetActorGuidFromLevelSequence(AActor* Actor, FString LevelSequencePath, bool& bOutSuccess, FString& OutInfoMsg);</strong>

Add an actor into a level sequence

/**
 * <mark>Add an actor into a level sequence</mark>
 *
 * @param Actor		The actor to add in the level sequence
 * @param LevelSequencePath		The path of the level sequence asset: "/Game/Folder/MyLevelSequence"
 * @param bOutSuccess	If the action was a success or not
 * @param OutInfoMsg	More information about the action's result
 * 
 * @return The guid of the actor in the level sequence
 */
UFUNCTION(BlueprintCallable, Category = "<a href="https://www.youtube.com/watch?v=ms-EuSgWEiA" target="_blank">Add Remove Actor From Level Sequence</a>")
<strong>static FGuid AddActorIntoLevelSequence(AActor* Actor, FString LevelSequencePath, bool& bOutSuccess, FString& OutInfoMsg);</strong>

Remove an actor from a level sequence

/**
 * <mark>Remove an actor from a level sequence</mark>
 *
 * @param Actor		The actor to remove from the level sequence
 * @param LevelSequencePath		The path of the level sequence asset: "/Game/Folder/MyLevelSequence"
 * @param OutInfoMsg	More information about the action's result
 * @param return If the action was a success or not
 */
UFUNCTION(BlueprintCallable, Category = "<a href="https://www.youtube.com/watch?v=ms-EuSgWEiA" target="_blank">Add Remove Actor From Level Sequence</a>")
<strong>static bool RemoveActorFromLevelSequence(AActor* Actor, FString LevelSequencePath, FString& OutInfoMsg);</strong>

Add / Remove Spawnable Actors In Level Sequence

The code below allows to place any Spawnable (not present in the level yet) Actor type of asset from Content Drawer to Level Sequence as well as Level Outliner (level).

As Spawnable, there's possible to have any number of instances of the same actor in the Level Sequence.

Get spawnable guid from level sequence based on its name

/**
 * Get spawnable guid from level sequence based on its name
 *
 * @param SpawnableName		The name of the spawnable once in the sequencer (used to identify it)
 * @param LevelSequencePath		The path of the level sequence asset: "/Game/Folder/MyLevelSequence"
 * @param bOutSuccess	If the action was a success or not
 * @param OutInfoMsg	More information about the action's result
 *
 * @return The guid of the spawnable in the level sequence
 */
UFUNCTION(BlueprintCallable, Category = "<a href="https://www.youtube.com/watch?v=3xuwSeyc0Fk" target="_blank">Add Remove Spawnable From Level Sequence</a>")
<strong>static FGuid GetSpawnableGuidFromLevelSequence(FString SpawnableName, FString LevelSequencePath, bool& bOutSuccess, FString& OutInfoMsg);</strong>

Add a spawnable into a level sequence

/**
 * <mark>Add a spawnable into a level sequence</mark>
 *
 * @param SpawnableName		The name of the spawnable once in the sequencer (used to identify it)
 * @param AssetPath		The path of the asset to spawn in the level sequence: "/Game/Folder/MyStaticMesh"
 * @param LevelSequencePath		The path of the level sequence asset: "/Game/Folder/MyLevelSequence"
 * @param bOutSuccess	If the action was a success or not
 * @param OutInfoMsg	More information about the action's result
 * 
 * @return The guid of the actor in the level sequence
 */
UFUNCTION(BlueprintCallable, Category = "<a href="https://www.youtube.com/watch?v=3xuwSeyc0Fk" target="_blank">Add Remove Spawnable From Level Sequence</a>")
<strong>static FGuid AddSpawnableIntoLevelSequence(FString SpawnableName, FString AssetPath, FString LevelSequencePath, bool& bOutSuccess, FString& OutInfoMsg);</strong>

Note, that each instance need to have an unique SpawnableName for option to be placed into a Level Sequence.

Remove a spawnable from a level sequence

/**
 * <mark>Remove a spawnable from a level sequence</mark>
 *
 * @param SpawnableName		The name of the spawnable in the sequencer (used to identify it)
 * @param LevelSequencePath		The path of the level sequence asset: "/Game/Folder/MyLevelSequence"
 * @param bOutSuccess	If the action was a success or not
 * @param OutInfoMsg	More information about the action's result
 * @param return	If the action was a success or not
 */
UFUNCTION(BlueprintCallable, Category = "<a href="https://www.youtube.com/watch?v=3xuwSeyc0Fk" target="_blank">Add Remove Spawnable From Level Sequence</a>")
<strong>static bool RemoveSpawnableFromLevelSequence(FString SpawnableName, FString LevelSequencePath, FString& OutInfoMsg);</strong>

Add Animation In Level Sequence

/**
 * Add an animation to an actor in a level sequence
 *
 * @param Actor		The actor in the level sequence
 * @param LevelSequencePath		The path of the level sequence asset: "/Game/Folder/MyLevelSequence"
 * @param AnimationPath		The path of the animation to assign to the actor: "/Game/Folder/MyAnimation"
 * @param StartFrame	Start frame of the animation section in the level sequence
 * @param EndFrame	End frame of the animation section in the level sequence
 * @param OutInfoMsg	More information about the action's result
 * @param return	If the action was a success or not
 */
UFUNCTION(BlueprintCallable, Category = "<a href="https://www.youtube.com/watch?v=OSwqooOwTls" target="_blank">Add Animation In Level Sequence</a>")
<strong>static bool AddAnimationInLevelSequence(AActor* Actor, FString LevelSequencePath, FString AnimationPath, int StartFrame, int EndFrame, FString& OutInfoMsg);</strong>

Add / Remove Camera Cut Track In Level Sequence

Get a camera cut track from a level sequence

/**
 * <mark>Get a camera cut track from a level sequence</mark>
 *
 * @param LevelSequencePath		The path of the level sequence asset: "/Game/Folder/MyLevelSequence"
 * @param bOutSuccess			If the action was a success or not
 * @param OutInfoMsg		More information about the action's result
 * 
 * @return The camera cut track
 */
UFUNCTION(BlueprintCallable, Category = "<a href="https://www.youtube.com/watch?v=UUeFLChFT_U" target="_blank">Add Remove Camera Cut Track From Level Sequence</a>")
<strong>static class UMovieSceneCameraCutTrack* GetCameraCutTrackFromLevelSequence(FString LevelSequencePath, bool& bOutSuccess, FString& OutInfoMsg);</strong>

Add a camera cut track to a level sequence

/**
 * <mark>Add a camera cut track to a level sequence</mark>
 *
 * @param LevelSequencePath		The path of the level sequence asset: "/Game/Folder/MyLevelSequence"
 * @param bOutSuccess			If the action was a success or not
 * @param OutInfoMsg		More information about the action's result
 * 
 * @return The camera cut track
 */
UFUNCTION(BlueprintCallable, Category = "<a href="https://www.youtube.com/watch?v=UUeFLChFT_U" target="_blank">Add Remove Camera Cut Track From Level Sequence</a>")
<strong>static class UMovieSceneCameraCutTrack* AddCameraCutTrackInLevelSequence(FString LevelSequencePath, bool& bOutSuccess, FString& OutInfoMsg);</strong>

Remove a camera cut track from a level sequence

	/**
 * <mark>Remove a camera cut track from a level sequence</mark>
 *
 * @param LevelSequencePath		The path of the level sequence asset: "/Game/Folder/MyLevelSequence"
 * @param OutInfoMsg		More information about the action's result
 * @param return	If the action was a success or not
 */
UFUNCTION(BlueprintCallable, Category = "<a href="https://www.youtube.com/watch?v=UUeFLChFT_U" target="_blank">Add Remove Camera Cut Track From Level Sequence</a>")
<strong>static bool RemoveCameraCutTrackFromLevelSequence(FString LevelSequencePath, FString& OutInfoMsg);</strong>

Link a camera to a camera cut track in a level sequence

/**
 * <mark>Link a camera to a camera cut track in a level sequence</mark>
 *
 * @param LevelSequencePath		The path of the level sequence asset: "/Game/Folder/MyLevelSequence"
 * @param CameraActor	The camera actor to link to the track
 * @param StartFrame	Start frame of the camera section in the level sequence
 * @param EndFrame	End frame of the camera section in the level sequence
 * @param OutInfoMsg	More information about the action's result
 * @param return	If the action was a success or not
 */
UFUNCTION(BlueprintCallable, Category = "<a href="https://www.youtube.com/watch?v=UUeFLChFT_U" target="_blank">Add Remove Camera Cut Track From Level Sequence</a>")
<strong>static bool LinkCameraToCameraCutTrack(FString LevelSequencePath, class ACameraActor* CameraActor, int StartFrame, int EndFrame, FString& OutInfoMsg);</strong>

Add / Remove Folder(s) In Level Sequence

Get a folder from a level sequence

/**
 * <mark>Get a folder from a level sequence</mark>
 *
 * @param LevelSequencePath		The path of the level sequence asset: "/Game/Folder/MyLevelSequence"
 * @param FolderName	The name of the folder
 * @param bOutSuccess	If the action was a success or not
 * @param OutInfoMsg	More information about the action's result
 * 
 * @return The folder
 */
UFUNCTION(BlueprintCallable, Category = "<a href="https://www.youtube.com/watch?v=dSwrrDCihyw" target="_blank">Add Remove Folder From Level Sequence</a>")
<strong>static class UMovieSceneFolder* GetFolderFromLevelSequence(FString LevelSequencePath, FString FolderName, bool& bOutSuccess, FString& OutInfoMsg);</strong>

Add a folder to a level sequence

/**
* <mark>Add a folder to a level sequence</mark>
 *
 * @param LevelSequencePath	The path of the level sequence asset: "/Game/Folder/MyLevelSequence"
 * @param FolderName	The name of the folder
 * @param bOutSuccess	If the action was a success or not
 * @param OutInfoMsg	More information about the action's result
 * 
 * @return The folder
 */
UFUNCTION(BlueprintCallable, Category = "<a href="https://www.youtube.com/watch?v=dSwrrDCihyw" target="_blank">Add Remove Folder From Level Sequence</a>")
<strong>static class UMovieSceneFolder* AddFolderInLevelSequence(FString LevelSequencePath, FString FolderName, bool& bOutSuccess, FString& OutInfoMsg);</strong>

Remove a folder from a level sequence

/**
 * <mark>Remove a folder from a level sequence</mark>
 *
 * @param LevelSequencePath		The path of the level sequence asset: "/Game/Folder/MyLevelSequence"
 * @param FolderName	The name of the folder
 * @param bOutSuccess	If the action was a success or not
 * @param OutInfoMsg	More information about the action's result
 */
UFUNCTION(BlueprintCallable, Category = "<a href="https://www.youtube.com/watch?v=dSwrrDCihyw" target="_blank">Add Remove Folder From Level Sequence</a>")
<strong>static void RemoveFolderFromLevelSequence(FString LevelSequencePath, FString FolderName, bool& bOutSuccess, FString& OutInfoMsg);</strong>

Move an actor in a folder in a level sequence

/**
 * <mark>Move an actor in a folder in a level sequence</mark>
 *
 * @param LevelSequencePath		The path of the level sequence asset: "/Game/Folder/MyLevelSequence"
 * @param FolderName	The name of the folder
 * @param Actor		The actor to move into the folder
 * @param bOutSuccess	If the action was a success or not
 * @param OutInfoMsg	More information about the action's result
 */
UFUNCTION(BlueprintCallable, Category = "<a href="https://www.youtube.com/watch?v=dSwrrDCihyw" target="_blank">Add Remove Folder From Level Sequence</a>")
<strong>static void MoveActorInFolderInLevelSequence(FString LevelSequencePath, FString FolderName, AActor* Actor, bool& bOutSuccess, FString& OutInfoMsg);</strong>

Move an actor out of a folder in a level sequence

/**
 * <mark>Move an actor out of a folder in a level sequence</mark>
 *
 * @param LevelSequencePath		The path of the level sequence asset: "/Game/Folder/MyLevelSequence"
 * @param FolderName	The name of the folder
 * @param Actor		The actor to move out of the folder
 * @param bOutSuccess	If the action was a success or not
 * @param OutInfoMsg	More information about the action's result
 */
UFUNCTION(BlueprintCallable, Category = "<a href="https://www.youtube.com/watch?v=dSwrrDCihyw" target="_blank">Add Remove Folder From Level Sequence</a>")
<strong>static void MoveActorOutOfFolderInLevelSequence(FString LevelSequencePath, FString FolderName, AActor* Actor, bool& bOutSuccess, FString& OutInfoMsg);</strong>

Add / Remove Shot(s) In Level Sequence

Get a shot track from a level sequence

/**
 * <mark>Get a shot track from a level sequence</mark>
 *
 * @param LevelSequencePath	The path of the level sequence asset: "/Game/Folder/MyLevelSequence"
 * @param bOutSuccess	If the action was a success or not
 * @param OutInfoMsg	More information about the action's result
 *
 * @return The shot track
 */
UFUNCTION(BlueprintCallable, Category = "<a href="https://www.youtube.com/watch?v=aGOJoMptzrA" target="_blank">Shot Track in Level Sequence</a>")
<strong>static class UMovieSceneCinematicShotTrack* GetShotTrackFromLevelSequence(FString LevelSequencePath, bool& bOutSuccess, FString& OutInfoMsg);</strong>

Add a shot track to a level sequence

/**
 * <mark>Add a shot track to a level sequence</mark>
 *
 * @param LevelSequencePath		The path of the level sequence asset: "/Game/Folder/MyLevelSequence"
 * @param bOutSuccess	If the action was a success or not
 * @param OutInfoMsg	More information about the action's result
 *
 * @return The shot track
 */
UFUNCTION(BlueprintCallable, Category = "<a href="https://www.youtube.com/watch?v=aGOJoMptzrA" target="_blank">Shot Track in Level Sequence</a>")
<strong>static class UMovieSceneCinematicShotTrack* AddShotTrackInLevelSequence(FString LevelSequencePath, bool& bOutSuccess, FString& OutInfoMsg);</strong>

Remove a shot track from a level sequence

/**
 * <mark>Remove a shot track from a level sequence</mark>
 *
 * @param LevelSequencePath		The path of the level sequence asset: "/Game/Folder/MyLevelSequence"
 * @param bOutSuccess			If the action was a success or not
 * @param OutInfoMsg		More information about the action's result
 */
UFUNCTION(BlueprintCallable, Category = "<a href="https://www.youtube.com/watch?v=aGOJoMptzrA" target="_blank">Shot Track in Level Sequence</a>")
<strong>static void RemoveShotTrackFromLevelSequence(FString LevelSequencePath, bool& bOutSuccess, FString& OutInfoMsg);</strong>

Link a level sequence to a shot track in a level sequence

/**
 * <mark>Link a level sequence to a shot track in a level sequence</mark>
 *
 * @param LevelSequencePath	The path of the level sequence asset: "/Game/Folder/MyLevelSequence"
 * @param Shot	The level sequence to link to the track as a shot
 * @param StartFrame	Start frame of the shot section in the level sequence
 * @param EndFrame	End frame of the shot section in the level sequence
 * @param bOutSuccess	If the action was a success or not
 * @param OutInfoMsg	More information about the action's result
 */
UFUNCTION(BlueprintCallable, Category = "<a href="https://www.youtube.com/watch?v=aGOJoMptzrA" target="_blank">Shot Track in Level Sequence</a>")
<strong>static void LinkShotToShotTrack(FString LevelSequencePath, class ULevelSequence* Shot, int StartFrame, int EndFrame, bool& bOutSuccess, FString& OutInfoMsg);</strong>

Add / Remove Subsequence In Level Sequence

Get a subsequence track from a level sequence

/**
 * <mark>Get a subsequence track from a level sequence</mark>
 *
 * @param LevelSequencePath	The path of the level sequence asset: "/Game/Folder/MyLevelSequence"
 * @param bOutSuccess	If the action was a success or not
 * @param OutInfoMsg	More information about the action's result
 *
 * @return The subsequence track
 */
UFUNCTION(BlueprintCallable, Category = "<a href="https://www.youtube.com/watch?v=YFtd8F1ahtI" target="_blank">Subsequence In Level Sequence</a>")
<strong>static class UMovieSceneSubTrack* GetSubsequenceTrackFromLevelSequence(FString LevelSequencePath, bool& bOutSuccess, FString& OutInfoMsg);</strong>

Add a subsequence track to a level sequence

/**
 * <mark>Add a subsequence track to a level sequence</mark>
 *
 * @param LevelSequencePath		The path of the level sequence asset: "/Game/Folder/MyLevelSequence"
 * @param bOutSuccess			If the action was a success or not
 * @param OutInfoMsg		More information about the action's result
 *
 * @return The subsequence track
 */
UFUNCTION(BlueprintCallable, Category = "<a href="https://www.youtube.com/watch?v=YFtd8F1ahtI" target="_blank">Subsequence In Level Sequence</a>")
<strong>static class UMovieSceneSubTrack* AddSubsequenceTrackInLevelSequence(FString LevelSequencePath, bool& bOutSuccess, FString& OutInfoMsg);</strong>

Remove a subsequence track from a level sequence

/**
 * <mark>Remove a subsequence track from a level sequence</mark>
 *
 * @param LevelSequencePath		The path of the level sequence asset: "/Game/Folder/MyLevelSequence"
 * @param bOutSuccess			If the action was a success or not
 * @param OutInfoMsg		More information about the action's result
 */
UFUNCTION(BlueprintCallable, Category = "<a href="https://www.youtube.com/watch?v=YFtd8F1ahtI" target="_blank">Subsequence In Level Sequence</a>")
<strong>static void RemoveSubsequenceTrackFromLevelSequence(FString LevelSequencePath, bool& bOutSuccess, FString& OutInfoMsg);</strong>

Remove a subsequence track from a level sequence

/**
 * <mark>Link a level sequence to a subsequence track in a level sequence</mark>
 *
 * @param LevelSequencePath	The path of the level sequence asset: "/Game/Folder/MyLevelSequence"
 * @param Subsequence	The level sequence to link to the track as a subsequence
 * @param StartFrame	Start frame of the subsequence section in the level sequence
 * @param EndFrame	End frame of the subsequence section in the level sequence
 * @param bOutSuccess	If the action was a success or not
 * @param OutInfoMsg	More information about the action's result
 */
UFUNCTION(BlueprintCallable, Category = "<a href="https://www.youtube.com/watch?v=YFtd8F1ahtI" target="_blank">Subsequence In Level Sequence</a>")
<strong>static void LinkSequenceToSubsequenceTrack(FString LevelSequencePath, ULevelSequence* Sequence, int StartFrame, int EndFrame, bool& bOutSuccess, FString& OutInfoMsg);</strong>

Add / Remove Level Visibility Track In Level Sequence

Get a level visibility track from a level sequence

/**
 * <mark>Get a level visibility track from a level sequence</mark>
 *
 * @param LevelSequencePath		The path of the level sequence asset: "/Game/Folder/MyLevelSequence"
 * @param bOutSuccess	If the action was a success or not
 * @param OutInfoMsg	More information about the action's result
 *
 * @return The level visibility track
 */
UFUNCTION(BlueprintCallable, Category = "<a href="https://www.youtube.com/watch?v=sZX98hpPIp8" target="_blank">Level Visibility Track In Level Sequence</a>")
<strong>static class UMovieSceneLevelVisibilityTrack* GetLevelVisibilityTrackFromLevelSequence(FString LevelSequencePath, bool& bOutSuccess, FString& OutInfoMsg);</strong>

Add a level visibility track to a level sequence

/**
 * <mark>Add a level visibility track to a level sequence</mark>
 *
 * @param LevelSequencePath		The path of the level sequence asset: "/Game/Folder/MyLevelSequence"
 * @param bOutSuccess	If the action was a success or not
 * @param OutInfoMsg	More information about the action's result
 *
 * @return The level visibility track
 */
UFUNCTION(BlueprintCallable, Category = "<a href="https://www.youtube.com/watch?v=sZX98hpPIp8" target="_blank">Level Visibility Track In Level Sequence</a>")
<strong>static class UMovieSceneLevelVisibilityTrack* AddLevelVisibilityTrackInLevelSequence(FString LevelSequencePath, bool& bOutSuccess, FString& OutInfoMsg);</strong>

Remove a level visibility track from a level sequence

/**
 * <mark>Remove a level visibility track from a level sequence</mark>
 *
 * @param LevelSequencePath		The path of the level sequence asset: "/Game/Folder/MyLevelSequence"
 * @param bOutSuccess	If the action was a success or not
 * @param OutInfoMsg	More information about the action's result
 */
UFUNCTION(BlueprintCallable, Category = "<a href="https://www.youtube.com/watch?v=sZX98hpPIp8" target="_blank">Level Visibility Track In Level Sequence</a>")
<strong>static void RemoveLevelVisibilityTrackFromLevelSequence(FString LevelSequencePath, bool& bOutSuccess, FString& OutInfoMsg);</strong>

Link a level sequence to a level visibility track in a level sequence

/**
 * <mark>Link a level sequence to a level visibility track in a level sequence</mark>
 *
 * @param LevelSequencePath	The path of the level sequence asset: "/Game/Folder/MyLevelSequence"
 * @param LevelName	The name of the level affected by the section
 * @param LevelVisibility	If true, the level will be set to visible
 * @param StartFrame	Start frame of the level visibility section in the level sequence
 * @param EndFrame	End frame of the level visibility section in the level sequence
 * @param bOutSuccess	If the action was a success or not
 * @param OutInfoMsg		More information about the action's result
 */
UFUNCTION(BlueprintCallable, Category = "<a href="https://www.youtube.com/watch?v=sZX98hpPIp8" target="_blank">Level Visibility Track In Level Sequence</a>")
<strong>static void AddSectionToLevelVisibilityTrack(FString LevelSequencePath, FString LevelName, bool LevelVisibility, int StartFrame, int EndFrame, bool& bOutSuccess, FString& OutInfoMsg);</strong>

Add / Remove Transform Track In Level Sequence

Get the transform track from an actor in a level sequence

/**
 * <mark>Get the transform track from an actor in a level sequence</mark>
 *
 * @param LevelSequencePath		The path of the level sequence asset: "/Game/Folder/MyLevelSequence"
 * @param Actor					The actor in the level sequence
 * @param bOutSuccess			If the action was a success or not
 * @param OutInfoMsg		More information about the action's result
 *
 * @return The transform track
 */
UFUNCTION(BlueprintCallable, Category = "<a href="https://www.youtube.com/watch?v=3CaYk5OyWVo" target="_blank">Transform Track In Level Sequence</a>")
<strong>static class UMovieScene3DTransformTrack* GetTransformTrackFromActorInLevelSequence(FString LevelSequencePath, AActor* Actor, bool& bOutSuccess, FString& OutInfoMsg);</strong>

Add a transform track to an actor in a level sequence

/**
 * <mark>Add a transform track to an actor in a level sequence</mark>
 *
 * @param LevelSequencePath		The path of the level sequence asset: "/Game/Folder/MyLevelSequence"
 * @param Actor		The actor in the level sequence
 * @param bOutSuccess	If the action was a success or not
 * @param OutInfoMsg	More information about the action's result
 *
 * @return The transform track
 */
UFUNCTION(BlueprintCallable, Category = "<a href="https://www.youtube.com/watch?v=3CaYk5OyWVo" target="_blank">Transform Track In Level Sequence</a>")
<strong>static class UMovieScene3DTransformTrack* AddTransformTrackToActorInLevelSequence(FString LevelSequencePath, AActor* Actor, bool& bOutSuccess, FString& OutInfoMsg);</strong>

Remove a transform track from an actor in a level sequence

/**
 * <mark>Remove a transform track from an actor in a level sequence</mark>
 *
 * @param LevelSequencePath		The path of the level sequence asset: "/Game/Folder/MyLevelSequence"
 * @param Actor		The actor in the level sequence
 * @param bOutSuccess	If the action was a success or not
 * @param OutInfoMsg	More information about the action's result
 */
UFUNCTION(BlueprintCallable, Category = "<a href="https://www.youtube.com/watch?v=3CaYk5OyWVo" target="_blank">Transform Track In Level Sequence</a>")
<strong>static void RemoveTransformTrackFromActorInLevelSequence(FString LevelSequencePath, AActor* Actor, bool& bOutSuccess, FString& OutInfoMsg);</strong>

Get the transform section from an actor in a level sequence

/**
 * <mark>Get the transform section from an actor in a level sequence</mark>
 *
 * @param LevelSequencePath		The path of the level sequence asset: "/Game/Folder/MyLevelSequence"
 * @param Actor		The actor in the level sequence
 * @param SectionIndex	Index of the section
 * @param bOutSuccess	If the action was a success or not
 * @param OutInfoMsg	More information about the action's result
 *
 * @return The transform section
 */
UFUNCTION(BlueprintCallable, Category = "<a href="https://www.youtube.com/watch?v=3CaYk5OyWVo" target="_blank">Transform Track In Level Sequence</a>")
<strong>static class UMovieScene3DTransformSection* GetTransformSectionFromActorInLevelSequence(FString LevelSequencePath, AActor* Actor, int SectionIndex, bool& bOutSuccess, FString& OutInfoMsg);</strong>

Add a transform section to an actor in a level sequence

#include "Evaluation/Blending/MovieSceneBlendType.h" // MovieScene
/**
 * <mark>Add a transform section to an actor in a level sequence</mark>
 *
 * @param LevelSequencePath		The path of the level sequence asset: "/Game/Folder/MyLevelSequence"
 * @param Actor		The actor in the level sequence
 * @param StartFrame	Start frame of the section
 * @param EndFrame	End frame of the section
 * @param BlendType	Blend type of the section
 * @param bOutSuccess	If the action was a success or not
 * @param OutInfoMsg	More information about the action's result
 *
 * @return The transform section
 */
UFUNCTION(BlueprintCallable, Category = "<a href="https://www.youtube.com/watch?v=3CaYk5OyWVo" target="_blank">Transform Track In Level Sequence</a>")
<strong>static class UMovieScene3DTransformSection* AddTransformSectionToActorInLevelSequence(FString LevelSequencePath, AActor* Actor, int StartFrame, int EndFrame, EMovieSceneBlendType BlendType, bool& bOutSuccess, FString& OutInfoMsg);</strong>

Remove a transform section from an actor in a level sequence

/**
 * <mark>Remove a transform section from an actor in a level sequence</mark>
 *
 * @param LevelSequencePath		The path of the level sequence asset: "/Game/Folder/MyLevelSequence"
 * @param Actor		The actor in the level sequence
 * @param SectionIndex	Index of the section
 * @param bOutSuccess	If the action was a success or not
 * @param OutInfoMsg	More information about the action's result
 */
UFUNCTION(BlueprintCallable, Category = "<a href="https://www.youtube.com/watch?v=3CaYk5OyWVo" target="_blank">Transform Track In Level Sequence</a>")
<strong>static void RemoveTransformSectionFromActorInLevelSequence(FString LevelSequencePath, AActor* Actor, int SectionIndex, bool& bOutSuccess, FString& OutInfoMsg);</strong>

Add / Remove Keyframe to / from transform section In Level Sequence

Add a keyframe to a transform section in a level sequence

/**
 * <mark>Add a keyframe to a transform section in a level sequence</mark>
 *
 * @param LevelSequencePath		The path of the level sequence asset: "/Game/Folder/MyLevelSequence"
 * @param Actor					The actor in the level sequence
 * @param SectionIndex			Index of the section
 * @param Frame					Frame number
 * @param Transform				Value to apply to the keys
 * @param KeyInterpolation		Interpolation of the keys: 0=Cubic, 1=Linear, 2=Constant
 * @param bOutSuccess			If the action was a success or not
 * @param OutInfoMsg		More information about the action's result
 */
UFUNCTION(BlueprintCallable, Category = "<a href="https://www.youtube.com/watch?v=bGyvVrySP00" target="_blank">Alex Quevillon - Add Transform Keyframe In Level Sequence</a>")
<strong>static void AddTransformKeyframe(FString LevelSequencePath, AActor* Actor, int SectionIndex, int Frame, FTransform Transform, int KeyInterpolation, bool& bOutSuccess, FString& OutInfoMsg);</strong>

Remove a keyframe from a transform section in a level sequence

/**
 * <mark>Remove a keyframe from a transform section in a level sequence</mark>
 *
 * @param LevelSequencePath		The path of the level sequence asset: "/Game/Folder/MyLevelSequence"
 * @param Actor					The actor in the level sequence
 * @param SectionIndex			Index of the section
 * @param Frame					Frame number
 * @param bOutSuccess			If the action was a success or not
 * @param OutInfoMsg		More information about the action's result
 */
UFUNCTION(BlueprintCallable, Category = "<a href="https://www.youtube.com/watch?v=bGyvVrySP00" target="_blank">Alex Quevillon - Add Transform Keyframe In Level Sequence</a>")
<strong>static void RemoveTransformKeyframe(FString LevelSequencePath, AActor* Actor, int SectionIndex, int Frame, bool& bOutSuccess, FString& OutInfoMsg);</strong>

Add a keyframe to a double channel in a level sequence

/**
 * <mark>Add a keyframe to a double channel in a level sequence</mark>
 *
 * @param Section				Section to modify
 * @param ChannelIndex			Index of the channel
 * @param Frame					Frame number
 * @param Value					Value to apply to the keyframe
 * @param KeyInterpolation		Interpolation of the keys: 0=Cubic, 1=Linear, 2=Constant
 * @param bOutSuccess			If the action was a success or not
 * @param OutInfoMsg		More information about the action's result
 */
UFUNCTION(BlueprintCallable, Category = "<a href="https://www.youtube.com/watch?v=bGyvVrySP00" target="_blank">Alex Quevillon - Add Transform Keyframe In Level Sequence</a>")
<strong>static void AddKeyframeToDoubleChannel(UMovieSceneSection* Section, int ChannelIndex, int Frame, double Value, int KeyInterpolation, bool& bOutSuccess, FString& OutInfoMsg);</strong>

Remove a keyframe from a double channel in a level sequence

/**
 * <mark>Remove a keyframe from a double channel in a level sequence</mark>
 *
 * @param Section				Section to modify
 * @param ChannelIndex			Index of the channel
 * @param Frame					Frame number
 * @param bOutSuccess			If the action was a success or not
 * @param OutInfoMsg		More information about the action's result
 */
UFUNCTION(BlueprintCallable, Category = "Alex Quevillon - Add Transform Keyframe In Level Sequence")
<strong>static void RemoveKeyframeFromDoubleChannel(UMovieSceneSection* Section, int ChannelIndex, int Frame, bool& bOutSuccess, FString& OutInfoMsg);</strong>

Modify a keyframe interpolation in a transform section in a level sequence

#include "Curves/RealCurve.h" // Engine
/**
 * <mark>Modify a keyframe interpolation in a transform section in a level sequence</mark>
 *
 * @param LevelSequencePath		The path of the level sequence asset: "/Game/Folder/MyLevelSequence"
 * @param Actor					The actor in the level sequence
 * @param SectionIndex			Index of the section in the transform track
 * @param ChannelIndex			Index of the channel in the section
 * @param Frame					Frame number
 * @param Value					Value to apply to the key
 * @param InterpMode			Interpolation of the key: 0=Cubic, 1=Linear, 2=Constant
 * @param TangentMode			Tangents of the key: 0=Auto, 1=User, 2=Break
 * @param ArriveTangent			Arrive tangent of the key
 * @param LeaveTangent			Leave tangent of the key
 * @param bOutSuccess			If the action was a success or not
 * @param OutInfoMsg			More information about the action's result
 */
UFUNCTION(BlueprintCallable, Category = "<a href="https://www.youtube.com/watch?v=kFMR3KzUDgE" target="_blank">Alex Quevillon - Set Keyframe Interpolation In Level Sequence</a>")
<strong>static void SetKeyframeInterpolationInTransformTrack(FString LevelSequencePath, AActor* Actor, int SectionIndex, int ChannelIndex, int Frame, double Value, ERichCurveInterpMode InterpMode, ERichCurveTangentMode TangentMode, float ArriveTangent, float LeaveTangent, bool& bOutSuccess, FString& OutInfoMsg);</strong>

Visibility Keyframe In Level Sequence with C++

Add a keyframe to a Visibility track

#include "Kismet/BlueprintFunctionLibrary.h" // Engine
/**
 * <mark>Add a keyframe to a Visibility track in a level sequence</mark>
 *
 * @param LevelSequencePath		The path of the level sequence asset: "/Game/Folder/MyLevelSequence"
 * @param Actor					The actor in the level sequence
 * @param Frame					Frame number
 * @param Visibility			Value to apply to the key
 * @param bOutSuccess			If the action was a success or not
 * @param OutInfoMsg		More information about the action's result
 */
UFUNCTION(BlueprintCallable, Category = "<a href="https://www.youtube.com/watch?v=RIfkPfqdwhQ" target="_blank">Alex Quevillon - Visibility Keyframe In Level Sequence</a>")
<strong>static void AddVisibilityKeyframe(FString LevelSequencePath, AActor* Actor, int Frame, bool Visibility, bool& bOutSuccess, FString& OutInfoMsg);</strong>

Remove a keyframe from a Visibility track in a level sequence

#include "Kismet/BlueprintFunctionLibrary.h" // Engine
/**
 * <mark>Remove a keyframe from a Visibility track in a level sequence</mark>
 *
 * @param LevelSequencePath		The path of the level sequence asset: "/Game/Folder/MyLevelSequence"
 * @param Actor					The actor in the level sequence
 * @param Frame					Frame number
 * @param bOutSuccess			If the action was a success or not
 * @param OutInfoMsg		More information about the action's result
 */
UFUNCTION(BlueprintCallable, Category = "<a href="https://www.youtube.com/watch?v=RIfkPfqdwhQ" target="_blank">Alex Quevillon - Visibility Keyframe In Level Sequence</a>")
<strong>static void RemoveVisibilityKeyframe(FString LevelSequencePath, AActor* Actor, int Frame, bool& bOutSuccess, FString& OutInfoMsg);</strong>

Add Material Parameter Collection Keyframe In Level Sequence

The code below allows to modify material of any linked Mesh or Actor.

#include "Kismet/BlueprintFunctionLibrary.h" // Engine
/**
	 * <mark>Add a keyframe to a Mpc float or color section in a level sequence</mark>
	 *
	 * @param LevelSequence		The level sequence asset
	 * @param Frame				Frame number
	 * @param Collection		Material parameter collection asset
	 * @param Parameter			Name of the material parameter
	 * @param FloatValue		Value to apply to the float parameter
	 * @param ColorValue		Value to apply to the color parameter
	 * @param bColor			If true, apply ColorValue, else apply FloatValue
	 * @param bOutSuccess		If the action was a success or not
	 * @param OutInfoMsg		More information about the action's result
	 */
UFUNCTION(BlueprintCallable, Category = "<a href="https://www.youtube.com/watch?v=mk2mExL8sP4" target="_blank">Alex Quevillon -  Add Material Parameter Collection Keyframe In Level Sequence</a>")
<strong>static void AddMpcKeyframe(class ULevelSequence* LevelSequence, class UMaterialParameterCollection* Collection, int Frame, FString Parameter, float FloatValue, FLinearColor ColorValue, bool bColor, bool& bOutSuccess, FString& OutInfoMsg);</strong>

Add BP Variables Keyframe In Level Sequence

The code below allows to add and update the value of Blueprint variables (exposed to cinematics) for any linked Blueprint Actor in the Level Sequence.

#include "Kismet/BlueprintFunctionLibrary.h" // Engine
/**
 * <mark>Add a keyframe to a few BP actor variables in a level sequence</mark>
 *
 * @param LevelSequence			The level sequence asset
 * @param Actor					The actor in the level sequence
 * @param Frame					Frame number
 * @param bOutSuccess			If the action was a success or not
 * @param OutInfoMsg			More information about the action's result
 */
UFUNCTION(BlueprintCallable, Category = "<a href="https://www.youtube.com/watch?v=60MnwoznEJs" target="_blank">Alex Quevillon -  Add Material Parameter Collection Keyframe In Level Sequence</a>")
<strong>static void AddBpVariableKeyframe(class ULevelSequence* LevelSequence, AActor* Actor, int Frame, bool& bOutSuccess, FString& OutInfoMsg);</strong>

Start the Render of a Level Sequence

#include "Kismet/BlueprintFunctionLibrary.h" // Engine
/**
 * <mark>Start a render process</mark>
 *
 * @param LevelSequence			The level sequence asset to render
 * @param OutputDirectory		Where to save the output: "C:/Temp/MyRenderFolder"
 * @param bRenderAsMovie		If true, will render a movie. Otherwise, will render individual frames
 * @param bOutSuccess			If the action was a success or not
 * @param OutInfoMsg			More information about the action's result
 */
UFUNCTION(BlueprintCallable, Category = "<a href="https://www.youtube.com/watch?v=mTKZosgBXAk" target="_blank">Alex Quevillon -  Start the Render of a Level Sequence</a>")
<strong>static void StartLevelSequenceRender(class ULevelSequence* LevelSequence, FString OutputDirectory, bool bRenderAsMovie, bool& bOutSuccess, FString& OutInfoMsg);</strong>
Vrealmatic consulting

Anything unclear?

Let us know!

Contact Us