Shape keys with math animation?

As an exercise, I wrote a program that generates the data for a 3D sin wave and changes it over time so I get a circle of flowing waves. The point of the exercise is to read in data and convert it for use by Blender.

Then I wrote some Python code to read it in and create a mesh that displays the sin wave in Blender. The changes over time are also read in and saved as shape keys.

What I want to do is transition from key to key to key to get a smooth motion of the sin wave. But in playing with the keyframes, I’m not sure how this would happen since the relative keys all relate to the basis, and not to other keys.

Perhaps this is not the best way to do it. Any ideas?

If I understand what you’re attempting: The most common way to do this is to use a series of f-curves that modulate the value for each shape in a regular fashion such that the series of shapes is animated in a fluid fashion. The waveform most often used is, appropriately enough, a basic sine curve, although some situations also call for a sawtooth (triangle) curve. The curves are set for each shape so that the preceding shape falls in value as the next in the series rises, with a 50% value crossover point. Peak amplitude of the curve(s) is typically 1.0, with the period of the aggregate curves determining the speed with which the animated shapes change, and thus the speed of the traveling wave when animated.

A standing wave uses similar wave forms but is set up so that the shapes oscillate between peaks rather than moving in a train.

If you want a transition from key to key to key to get a smooth transition you could try absolute shape keys instead of relative keys. Another possibility would be to set the keyframe that you have just added to 1 before adding a new keyframe; then you can control the shape with just the last key. Hope this is clear.