How do you create a subscene in sequencer with Python?

I have seen examples in the code provided by the engine.
here: \Engine\Plugins\MovieScene\SequencerScripting\Content\Python

I cannot find an example anywhere online on how to add a subscene track.
Not a master shot with sub shots - I know how to do that.
I am specifically looking for how to add a subsequence to an existing sequence.


#editor-scripting

I discovered the answer seconds after posting this:

# add a subscene
# add a subscene
master_track = level_sequence.add_master_track(unreal.MovieSceneSubTrack)
sublevel = unreal.load_asset("/Game/path/to/another/sequence" )
subsequence_section = master_track.add_section()
subsequence_section.set_sequence(sublevel)
unreal.LevelSequenceEditorBlueprintLibrary.refresh_current_level_sequence()
1 Like

Good afternoon my friend,
I had a same problem like you ,
I used your code into my UE5.1,
though it can create a new sub track into my sequence,
my sub sequence still not export into the master sequence,
just like the picture,
hope that you can help me agin!
Best wishes!

thanks a lot
I have find the reason why I can not input that
because it need to set the range of the sub sequence
so,I think it need to supply something into your code just like this :

# add a subscene
# add a subscene
master_track = level_sequence.add_master_track(unreal.MovieSceneSubTrack)
sublevel = unreal.load_asset("/Game/path/to/another/sequence" )
subsequence_section = master_track.add_section()
subsequence_section.set_sequence(sublevel)
subsequence_section.set_range(start_frame,end_frame)
unreal.LevelSequenceEditorBlueprintLibrary.refresh_current_level_sequence()
1 Like

Thanks, that worked for me!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.