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

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

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

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

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

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!

@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 ?

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.

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.