# How to remove key frames from a level sequence through blueprints?

**URL:** <https://forums.unrealengine.com/t/how-to-remove-key-frames-from-a-level-sequence-through-blueprints/480357>\
**Category:** Cinematics & Media\
**Tags:** editor-utility-widge, frames, unreal-engine, Widget, question\
**Created:** [March 15, 2021, 9:45pm UTC](https://forums.unrealengine.com/t/how-to-remove-key-frames-from-a-level-sequence-through-blueprints/480357 "2021-03-15T21:45:42Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![EvansBohl](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/evansbohl/32/1068867_2.png) [@EvansBohl](https://forums.unrealengine.com/u/EvansBohl)\
**Post date:** [March 15, 2021, 9:45pm UTC](https://forums.unrealengine.com/t/how-to-remove-key-frames-from-a-level-sequence-through-blueprints/480357/1 "2021-03-15T21:45:42Z")

</div>

I would like to randomly remove keyframes from a level sequence through editor utility widgets, is there a way to achieve such a thing?

---

<div class="post-metadata">

**Author:** ![Max.Chen](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/max.chen/32/1194502_2.png) [@Max.Chen](https://forums.unrealengine.com/u/Max.Chen)\
**Post date:** [March 17, 2021, 7:44am UTC](https://forums.unrealengine.com/t/how-to-remove-key-frames-from-a-level-sequence-through-blueprints/480357/2 "2021-03-17T07:44:15Z")

</div>

There’s a few levels to go through to get to the keys, but it’s basically like this:

 ![332740-getkeys.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/7/f/67f1a0ea76c189dec0928b90a136281eded3b18a.jpeg)

---

<div class="post-metadata">

**Author:** ![EvansBohl](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/evansbohl/32/1068867_2.png) [@EvansBohl](https://forums.unrealengine.com/u/EvansBohl)\
**Post date:** [March 17, 2021, 7:52am UTC](https://forums.unrealengine.com/t/how-to-remove-key-frames-from-a-level-sequence-through-blueprints/480357/3 "2021-03-17T07:52:53Z")

</div>

Hey thanks a lot Max for the detailed reply! I’ll try that out as soon as I can! 😃 I suppose I can edit the curves through EUW too? Also, do I have to enable sequencer scripting?

---

<div class="post-metadata">

**Author:** ![Max.Chen](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/max.chen/32/1194502_2.png) [@Max.Chen](https://forums.unrealengine.com/u/Max.Chen)\
**Post date:** [March 17, 2021, 7:55am UTC](https://forums.unrealengine.com/t/how-to-remove-key-frames-from-a-level-sequence-through-blueprints/480357/4 "2021-03-17T07:55:26Z")

</div>

Yes need to enable sequencer scripting. And this is the way to edit the curves (ie. the keys have time/value/tangents, etc)

---

<div class="post-metadata">

**Author:** ![EvansBohl](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/evansbohl/32/1068867_2.png) [@EvansBohl](https://forums.unrealengine.com/u/EvansBohl)\
**Post date:** [March 17, 2021, 7:59am UTC](https://forums.unrealengine.com/t/how-to-remove-key-frames-from-a-level-sequence-through-blueprints/480357/5 "2021-03-17T07:59:43Z")

</div>

Great! Thank you very much! I found out that when backwards solving animations using control rig, it bakes the animations with a key frame put to every frame. This gave me an idea of making a script that can transform the animation to an animation on twos removing every other frame and transforming the curves tangents. Can’t wait to try that out, thanks a lot for the helpful replies!

---

<div class="post-metadata">

**Author:** ![Entilzar](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Entilzar](https://forums.unrealengine.com/u/Entilzar)\
**Post date:** [August 22, 2024, 12:10am UTC](https://forums.unrealengine.com/t/how-to-remove-key-frames-from-a-level-sequence-through-blueprints/480357/6 "2024-08-22T00:10:03Z")

</div>

@Max.Chen Hi !  
Sorry to necro this post, but I needed to do exactly the same thing as the OP, and the solution you gave allowed me to do that (thanks !), but with some restrictions…

it works fine on small Level Sequences, but on the big ones I need to work on, I get a crash :  
`Maximum number of UObjects (###) exceeded`

Made some tests, disconnected my nodes, and actually found that just repeatedly calling the “GetKeys” node from the Movie Scene Scripting Channels was leading to the crash. I’ve tried to force Garbage Collection, to destroy to UObjects I suppose the GetKeys node has spawned, but to no avail.  
Is there a way :

- to be certain the issue is indeed the “GetKeys” node spawning UObjects ?
- to force the Editor to destroy those UObjects once I don’t need them ?

---

<div class="post-metadata">

**Author:** ![Entilzar](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Entilzar](https://forums.unrealengine.com/u/Entilzar)\
**Post date:** [August 23, 2024, 11:59am UTC](https://forums.unrealengine.com/t/how-to-remove-key-frames-from-a-level-sequence-through-blueprints/480357/7 "2024-08-23T11:59:39Z")

</div>

So, testing have shown that the GetKeys node was indeed creating UObjects.  
And to delete them, I’ve created a C++ Blueprint Function Library, so I can call ConditionalBeginDestroy() on each UObject of the Array.

Note that the script was falsely triggering the “Infinite Loop” PIE error, causing it to stop.  
To handle that, I used my C++ BFL to call GInitRunaway() to reset the infinite loop counter.

---

<div class="post-metadata">

**Author:** ![chibitotoro](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/chibitotoro/32/1224468_2.png) [@chibitotoro](https://forums.unrealengine.com/u/chibitotoro)\
**Post date:** [November 11, 2024, 12:07am UTC](https://forums.unrealengine.com/t/how-to-remove-key-frames-from-a-level-sequence-through-blueprints/480357/8 "2024-11-11T00:07:40Z")

</div>

Might be worth a try to do the removal with in the bounds of a transaction. Otherwise it might treat each remove action as part of the undo stack that might be leading to the infinite loop warnings. I actually need to try this later as well because I want to implement baking on every nth frame.
