# Ipo Simplification for GE and other

Most of you have probably had this happen to you, you have a nifty physics sim that you want in an animation, but when you bake it it creates millions of points.
here’s an example:

ugh, horrible right? I’ve had blendfiles be a full gig before!
well, we could reduce to just these points:

and if we used these control points:

we’d get a nearly identicle line:

so, I’m hopefully going to make a script to do this, but I’ll need help.

Here’s what I’ve got figured out:
the points we need to keep are at the ‘peaks’, these can be found by checking if both the point before and after are above, or if both are below.
We also need a point at the very start, and one at the end.

and that’s all I have math and knowledge to figure out. So, you experienced python users, I need alittle help figuring out how to take those points, and curve-fit them to the complex mash that it starts out as. There’s got to be a simple way… The best I could come up with is guess-and-check, and that’d be horribly slow. We sould at least strive for an educated guess.

so, please post here if you’ve got ideas or want to help. As I said, I don’t mind coding it all, I just don’t have the math for it…

I am no programmer but here is a crazy solution for you to dwell over:

generate a mesh based on the x and y coordinates of the IPO curve. (just bunch of dots connected with lines)
use the build-in decimator tool to eleminate extraneous points, decimator should keep the peaks intact.
read the x and y cords of the new mesh and replace the IPO with this data.

set interpolation mode to linear
do it for every IPO channel.

Let me know if my crazy idea works.

this is by far the easiest method i can think of, using virtually no math, all other method seems to require lots of math or trial and error.

I’ve got some patches for blender that do this for the most part. There are still the occasional cases that it doesn’t handle yet, but it mostly does the job. You can find these patches in the patch tracker.

Aligorith

Good luck with that, but I do have to point something out. Most baked physics I have worked with operate with that same principle. Maya, for example, does the exact same thing; keyframes are baked at each frame. If you do manage to get that to work, that would be a HUGE deal, not only for Blender but also for other apps as well I think.

i writte a script remove keys at same altitude (if 3 or more keys at same high, the middles will delete). i think about a real ipo cleaner, but… no much

is a great idea. somebody sayme al algorythm for this? i can try!

1. select max and min pints (of a curve)
2. select inversion (inflexion) points (puntos de inflexion en español)
3. re-write the curve, add control points (bezier) in 1) and 2), but make extreme control points of bezier… how?? <-- here need help

bye