How to clean f-curves that have linear lines so that the only keyframes that are kept after the cleanse are the peaks and lowest keyframes where the curve's slope changes.
What I have tried:
- The Decimate (ratio) command - after a certain percentage seems to change the keyframes interpolation to not linear and doesn't keep the peaks and valleys but tries to form an arc between the two points.
- The Clean Keyframes command - seems to remove keyframes in a constant interval betweeen keyframes but after a certain threshold it doesn't keep the peaks and valleys.
Is there a way to clean hundreds of objects that have similar animations of their location data? Attached is an image illustrating the keyframes that should not be removed.
Context: these objects are from a particle simulation that had its particles motion converted to keyframes using the script given in this answer: Convert particle system to animated meshes
