Linearly interpolate animation curves with the lerp() function
Using random or noise functions to create movement like camera shakes can become annoying because it’s not always easy (or feasible) to control what’s going on between key frames. In that case you can “posterize” the result using the lerp() function like this:
1 |
t%(step) ? lerp( t-(t%step), yourFunction(t-(t%step)), t+(step-(t%step)), yourFunction(t+(step-(t%step))), t) : yourFunction |
with yourFunction referencing your original random curve and step being the interval in frames in which you want to sample that curve (so 5 would sample every 5th key frame, .2 would sample 5 times in-between key frames etc…).
Dealing with Inf or -Inf pixels twostrip