*=-1 flips it yes, just like the above code I posted. But the curve is offset, its no longer in the same time range it once was. This was also for a script I was trying to make work doing something a bit more complex.
The curve editor actually supports doing this without any script in case you're interested: * Select all keyframes that you want to invert the value for * In the second "Stats" input field type "*=-1" and hit enter * values for all selected keyframes should be inversed This also works for adding (+=) subtracting (-=) and…