# Animation keyframes from file

I'm trying to do an animation starting from some data I collected. The data is stored in a single txt file which looks like pretty much as

o1 x y t
o1 x y t
...
o2 x y t
...


where o1 and o2 are two object identifiers, x and y are cartesian coordinates on the ground plane, and t is the timestamp of the observations.

My aim is to render the movement of the two objects while preserving time information.

I already know how to read in the text file and create the paths. I'm using this function

def create_curve(coords_list, name):
crv = bpy.data.curves.new('crv', 'CURVE')
crv.dimensions = '3D'
spline = crv.splines.new(type='NURBS')

• This will be a lot easier if you simply keyframe location values to define the motion path. eg set the location ob1.location = (x, y, 0) and keyframe it ob1.keyframe_insert('location', frame=f(t)) where f converts t to frames. (or build animation fcurve directly from data) Aug 12 at 9:30