# Python get sequence for bake it.

**URL:** <https://forums.unrealengine.com/t/python-get-sequence-for-bake-it/1864901>\
**Category:** Programming & Scripting\
**Tags:** Python, bake, unreal-engine, sequence, question\
**Created:** [May 20, 2024, 2:56pm UTC](https://forums.unrealengine.com/t/python-get-sequence-for-bake-it/1864901 "2024-05-20T14:56:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![TondaDevelper](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TondaDevelper](https://forums.unrealengine.com/u/TondaDevelper)\
**Post date:** [May 20, 2024, 2:56pm UTC](https://forums.unrealengine.com/t/python-get-sequence-for-bake-it/1864901/1 "2024-05-20T14:56:50Z")

</div>

I am creating a tool to automate the bake animation sequence in the level sequencer. I am using the function `unreal.SequencerTools.export_anim_sequence(unreal.EditorLevelLibrary.get_editor_world(), sequencer, animSeq_copy, export_settings, animation_bindings[0], False)`. I have a problem with the output `animSeq_copy`, where the resulting sequence should be stored. I have tried two approaches:

1. Create a new sequence and assign it using the following code:

```auto
asset_tools = unreal.AssetToolsHelpers.get_asset_tools()
factory = unreal.AnimSequenceFactory()
folder = "/Game/Animation/Seq/"
animSeq = asset_tools.create_asset("NewSequence", folder, unreal.AnimSequence, factory)

```

But this returns an error saying it cannot read the `skeletonhierarchy`.  
2. Try to get the animation from the track, but after I get the section, I don’t know which property contains the `anim_sequence`.

Thank you for your help.

---

<div class="post-metadata">

**Author:** ![JAY.PERSY](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JAY.PERSY](https://forums.unrealengine.com/u/JAY.PERSY)\
**Post date:** [June 23, 2024, 8:19pm UTC](https://forums.unrealengine.com/t/python-get-sequence-for-bake-it/1864901/2 "2024-06-23T20:19:06Z")

</div>

Hello Fellow UE5 enthusiasts,  
I get the same error, Does anyone have solution for export/bake sequence animation? Please share the solution.

Best Regards
