I am trying to visualise some physics simulations in Blender. The simulation result is a path that an object travels over time. I am importing the collection of points as a curve into Blender using a python script. I then use a "follow path" constraint on the object and set the curve as the target.
So far so good. However, the motion of the object is not as I expected. Blender seems to interpolate the motion along the distance of the path. The spatial co-ordinates are correct, but the time doesn't match.
For example, assume that the points are (in 2D for simplicity):
(0,0) (1,1) (4,4)
And I want to run the animation for 20 frames. I expect the object to be at (1,1) on frame #10.
However, what Blender does is, it takes the length of the total path and then interpolates. Since the last point (4,4) is much farther away, on frame #10 the object is not at (1,1) but somewhere between (1,1) and (4,4).
My workaround was to write a script instead of using the "follow path" constraint. The script inserts keyframes at each position in the simulation at the corresponding frame numbers. In the example above, key frames will be inserted at frames 0, 10 and 20.
The script is hacky and slow. My question is, can this be done in a better way? I suspect this will be very useful to many people who try to visualise data.