Script to write the visualLocRots of an animation into a new one?

Hi there, well, you can see my question in the title.
My problem is, i used an IK contraint for a walk animation, but for a game which doesnt support the IK contraint, so I need the visual LocRots.
But how to bake them? Is there a script?