Hello, everyone!
To save everyone time and convenience, I’ve split this post up into sections.
The Long & Short Of My Question:
Given an unreal.LevelSequence
object in Python, how can I retrieve that sequence’s Director Blueprint?
The Technical Goal:
I want to programmatically add custom Events to the Director BP of a Level Sequence that, when called, will begin playing another Level Sequence, assigned in the Python script.
The Technical Context:
I am writing an Unreal Editor Utility Widget that targets external data files representing a graph with nodes and links between them, then invokes an UE5 Python script to parse those data files, and from them automatically generate Level Sequences that recreates that node by linking them with Trigger Event keys.
The Full Context:
I am building a cinematic dialogue system, with an end result looking something like how story-heavy games like Life is Strange or Telltale’s Walking Dead presents conversations.
For constructing them, I have an external tool that I use for designing complex dialogue trees using a graph. In Unreal, I represent these dialogue trees through a series of Level Sequences, combining dialogue audio, character animation, and cinematic camera framing.
As you can imagine, creating and wiring up all of these Level Sequences by hand can be pretty grueling. Any given conversation can have dozens of individual Sequences, all connected and branching off in different ways.
And more importantly, connected and branching in ways I already put together once in the external graph tool.
As such, I am writing a UE5 Python script that will parse the dialogue graph as exported from the external tool, and then will create and wire up the Level Sequences to recreate that graph. I already have all of the links built logically in Python, and I already have the Level Sequences being made, the audio tracks being added, and the Event track being added. Similarly, I am able to add the Event Trigger key on the Event Track.
All that I’m missing is the actual event that calls the linked sequences. And for that, so far as I know, I need to be able to access the Level Sequence’s Director Blueprint. But after several hours of Googling and scouring the UE5 Python documentation, I have been unable to find a way to get the Director BP.
Once I have access to the BP, I’ve found how to add the nodes I need.
Similarly, I know that the BP is stored somewhere within the Level Sequence’s asset. If I export the Level Sequence to a T3D text file and open it up, it is stored as a subobject inside the Level Sequence. I just don’t know how to access it.
Can this be done through UE5 Python? Or am I going to have to find some alternative way to finish linking my Level Sequences together programmatically?
Thanks in advance, everyone.