Skip to content
Ciwb

Share

Cutscenes in Unreal

For Unreal Engine 5, Export Cutscene writes a Python script, build_cutscene.py, that builds a Level Sequence with the film's cameras, the camera cuts between them and the sound. The scene itself comes in through Unreal's own glTF import.

What you need

  • The Python Editor Script Plugin (Edit > Plugins). Restart the editor after turning it on.
  • Interchange glTF import, which is on by default in Unreal 5.

Set it up

  1. In Ciwb, choose File > Export > Export Cutscene…, pick Unreal and export into a folder.
  2. In Unreal, make a folder /Game/Cutscenes/Name (named like the cutscene) in the Content Browser, open a level and choose File > Import Into Level…. Pick Name.glb and import into that folder. Unreal places the scene in the level and makes a Level Sequence of its animation.
  3. Choose Tools > Execute Python Script… and pick build_cutscene.py from the export folder. Or type py "C:/path/to/build_cutscene.py" in the console.
  4. Open /Game/Cutscenes/Name/Name_Cutscene and press Play in Sequencer.

What it builds

In /Game/Cutscenes/Name/:

  • the film's sound as a Sound Wave,
  • Name_Cutscene, a Level Sequence at the film's frame rate with:
    • a Cine Camera for each shot camera, its position and rotation keyed on every frame, and its focal length keyed when the zoom changes,
    • a Camera Cuts track that cuts to each camera at its shot times,
    • an Audio track with the sound,
    • a Subsequence track playing the animation sequence from step 2, if it is in the same folder, so the characters move in step with the cameras.

Running the script again rebuilds Name_Cutscene. Play it in game with a Level Sequence Actor or the Create Level Sequence Player node.

Lenses

The JSON gives each camera's focal length for a sensor 24 mm high. The script sets each Cine Camera's filmback to 24 mm high and 16:9 wide, so the framing matches Ciwb's.

Good to know

  • Unreal uses centimetres and +Z up. The script converts the JSON's metres and +Y up the way the glTF importer converts the scene. If your project imports glTF with a different scale or rotation, change the to_ue function at the top of the script to match.
  • The script reads the JSON next to itself. To point it somewhere else, set JSON_PATH at the top. DESTINATION sets the content folder.
  • Everything the script does is plain editor Python, so it is easy to extend: add your own tracks, spawn the game's characters, or bind events to the markers in the JSON.