Python create sequence


trying to create a very basic python script that creates a sequencer with a destination and a name. Getting an error with the below.

LogPython: Error: AttributeError: module ‘unreal’ has no attribute ‘createNewLevelSequence’

import unreal

def mymodule():

dest = '/Game/demosequencer'

name = 'myseq'

unreal.createNewLevelSequence(dest, name)

This is how you can do it:

def create_new_level_sequence(asset_name="LevelSequenceName", destination="/Game/"):
    asset_tools = unreal.AssetToolsHelpers.get_asset_tools()
    asset_tools.create_asset(asset_name, destination, unreal.LevelSequence, unreal.LevelSequenceFactoryNew())


1 Like