Hi I wouldn’t say I’m an expert at setting up Sequencer manually but I can manage to get something together. I’m trying to automate adding a shot into a master sequence via python. I’m not sure how to go about doing this. I see in the docs about adding a master track, but I’m not sure how unreal.MovieSceneSequence fits into this. unreal.MovieSceneSequence — Unreal Python 5.1 (Experimental) documentation
I’m a beginner when it comes to Python, but I think I can help out.
unreal.MovieSceneSequence is the base class for the unreal.LevelSequence class. So the level sequences you created in your code will share properties with unreal.MovieSceneSequence.
Using your existing code, adding a MovieSceneCinematicShotTrack and a section to that track will look something like this:
master_sequence = unreal.AssetToolsHelpers.get_asset_tools().create_asset(asset_name=master_sequence_name, package_path=path, asset_class=unreal.LevelSequence, factory=unreal.LevelSequenceFactoryNew())
shot = unreal.AssetToolsHelpers.get_asset_tools().create_asset(asset_name=shot_name, package_path=path, asset_class=unreal.LevelSequence, factory=unreal.LevelSequenceFactoryNew())
# add MovieSceneCinematicShotTrack track to your master_sequence
shotsTrack = master_sequence.add_master_track(unreal.MovieSceneCinematicShotTrack)
# add a section to the track
section = shotsTrack.add_section()
# add your shot sequence to the section
section.set_editor_property('sub_sequence', shot)
# set other properties on the section such as end frame
section.set_end_frame(50)