IPO Simplification script

Hi, I was trying to cleanup my IPO curves after some GameEngine baking and I didn’t find any way to do that automatically.

Here then the IPO Simplification script:
(to run copy it to the text editor inside Blender, select the desired object, set the parameter keyFrame in the first line and press ALT+P in the text window).


keyFrame = 5

import Blender

ob = Blender.Object.GetSelected()[0]
ipo = ob.getIpo()

curves = ipo.curves

for i in curves:
    points = i.getPoints()
    for j in range(len(points)/keyFrame):
        for k in range(keyFrame-1):
            try:
                i.delBezier(j+k)
            except:
                pass

print "IPO Cleaning Done!"

I hope it helps someone.
It is not a decimator, but works fine for me.

Abraços,
Dalai

thanks for sharing

hello, i did something similar, works also for armatures:

http://blenderartists.org/forum/showthread.php?t=134911