# Create New LevelSequence with Python?

**URL:** <https://forums.unrealengine.com/t/create-new-levelsequence-with-python/130678>\
**Category:** Editor Scripting\
**Tags:** unreal-engine\
**Created:** [September 4, 2019, 5:59pm UTC](https://forums.unrealengine.com/t/create-new-levelsequence-with-python/130678 "2019-09-04T17:59:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bmag\_aszxursddfe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@bmag\_aszxursddfe](https://forums.unrealengine.com/u/bmag_aszxursddfe)\
**Post date:** [September 4, 2019, 5:59pm UTC](https://forums.unrealengine.com/t/create-new-levelsequence-with-python/130678/1 "2019-09-04T17:59:23Z")

</div>

How do you create a new level sequence with Python? I can’t find this anywhere. I am developing an engine workflow for a previs company and I’m trying to automate the process of exporting animation from maya and importing it into a new level/levelSequence. I found the necessary code for creating the level and importing animation assets and loading animation to a level sequence, but i can’t find the commands needed to create a level sequence or duplicate an existing template sequence.  
thanks.

---

<div class="post-metadata">

**Author:** ![bmag\_aszxursddfe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@bmag\_aszxursddfe](https://forums.unrealengine.com/u/bmag_aszxursddfe)\
**Post date:** [September 12, 2019, 6:32pm UTC](https://forums.unrealengine.com/t/create-new-levelsequence-with-python/130678/2 "2019-09-12T18:32:57Z")

</div>

I finally found the answer. I’ll include it here if anyone else is looking for the same thing.  
I don’t understand why the python scripting is so convoluted. Why can’t there be simple wrappers for all this stuff, like unreal.createThisAssetType(path, name)?

def createNewLevelSequence(dest, name):

asset\_tools.create\_asset( asset\_name = name, package\_path = dest, asset\_class = unreal.LevelSequence, factory=unreal.LevelSequenceFactoryNew)

---

<div class="post-metadata">

**Author:** ![Jadedghost2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jadedghost2](https://forums.unrealengine.com/u/Jadedghost2)\
**Post date:** [February 27, 2020, 8:12pm UTC](https://forums.unrealengine.com/t/create-new-levelsequence-with-python/130678/3 "2020-02-27T20:12:21Z")

</div>

Hey There,

Any chance you could share the base code of just creating a timeline and adding an actor? I’ve been trying to accomplish the same with for my current team but as someone with very little programming background its proving a bit more difficult.

Cheers!

---

<div class="post-metadata">

**Author:** ![LiangRayCong](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/liangraycong/32/88719_2.png) [@LiangRayCong](https://forums.unrealengine.com/u/LiangRayCong)\
**Post date:** [December 20, 2021, 6:36am UTC](https://forums.unrealengine.com/t/create-new-levelsequence-with-python/130678/4 "2021-12-20T06:36:56Z")

</div>

> [@bmag\_aszxursddfe](#):
>
> def createNewLevelSequence(dest, name):
> 
> asset\_tools.create\_asset(asset\_name = name, package\_path = dest, asset\_class = unreal.LevelSequence, factory=unreal.LevelSequenceFactoryNew)

hello ,  
I also have this question now,  
could you solve your question ?  
I had tried your the way of your answer ,  
but it is not right ,  
hope that you can tell more detailed for me ,  
thanks a lot!

---

<div class="post-metadata">

**Author:** ![IlyaEfanov](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@IlyaEfanov](https://forums.unrealengine.com/u/IlyaEfanov)\
**Post date:** [November 19, 2022, 1:22pm UTC](https://forums.unrealengine.com/t/create-new-levelsequence-with-python/130678/5 "2022-11-19T13:22:13Z")

</div>

```auto
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())

```

References  
# [Python Scripting in Sequencer in Unreal Engine | Unreal Engine 5.0 Documentation](https://docs.unrealengine.com/5.0/en-US/python-scripting-in-sequencer-in-unreal-engine/)  
# [Create a new level sequence and set its framerate in Python | Unreal engine Code Snippet](https://dev.epicgames.com/community/snippets/Jv/create-a-new-level-sequence-and-set-its-framerate-in-python)
