Create a file that contains object *and* movement data that can be imported to Blender I'm experimenting (outside of Blender) with some algorithms that place balls in a larger box, then incrementally move these balls to optimize positions until they reach an optimal state. Now, i would like to use Blender to visualize these algorithms, once to present the results to some audience, but also to find problems in the algorithms, as well as implementation bugs, as it's much easier to spot a wrong movement in a visualization than in a huge table of coordinates.

So what i would like to do is


After each step of my algorithm, create a file that can be imported into Blender and contains the X/Y/Z coordinates of each of those balls
Create a kind of motion description, like "File0 is the list of ball positions at 0 seconds, File1 is the list of positions after one second; i want a movie that moves each ball from its 1st position to the 2nd one"


I know how to solve part 1), as writing STL files is not very difficult, and Blender has an import feature. I will need to create a mesh of triangles around each center point, but i'm not afraid of that either.

The part where i don't have a clue how to do it is 2). Ideally, i'd like to create a file that i can import that contains all coordinate sets at all frame positions, but if that's not possible, i could import each STL file at its designated frame manually. However, i still have no clue how to tell blender "file 2 contains the same objects as file 1, just at a different point of time", and i don't want to "connect" every single vertext manually.

Is there a file format that can specify object positions as well as position changes over time, that's not too hard to create, that can be imported into Blender?
My first option would be to use python to implement your algorithm and run it directly in blender to position the balls directly.

Another option would be to read the first file to create and position the balls then keyframe the positions. Then read the next file using the data to move each corresponding ball to the new location and keyframe. Repeat. You would only need a text file with 3 values per line, these would be absolute coordinates in the first file but could be absolute or distances moved for following files.

Blender has an importer/exporter for MDD files (Lightwaves MotionDesigner format). It is only about 100 lines for the exporter so shouldn't be hard to follow. There is also a mesh cache modifier that can use the MDD file to alter a mesh object. While this format is designed for mesh deformation data per frame, you could define a mesh with a vertex at the location of each sphere, then use dupliverts to place a sphere at the location of each vertex in blender.