Script: Delete Flat Keys
When you’re working with animation you eventually end up with a lot of extra keys, by that I mean flat keys, keys we don’t need.
See the image below, I’ve marked the flat keys with red dots:
With the script you just select all of the objects that you want to clean the keyframes on, then you define the angle threshold, and the script will go through and delete all of the keys with a lower angle threshold than defined.
When run on the example above, we end up with this: