How to animate object based on imported text data?

I am new to python and blender. I’m currently using v 2.58. I am trying to animate an object based on a text file containing two columns of data. The two columns are representative of time and position. I am having trouble opening the file to read in the blender scripting console and can’t figure out the correct command. Any help would be appreciated.


here is a script that takes a list of coordinates and then places a keyframe every 10 frames.
animating from a list and importing data (into a list)

if you give the first ten lines of the text file, i’ll show you how to read it and make a List from it to animate from.

Wow, thanks! I’ll get cracking

The file begins with verbage and terminates into two columns of numbers such as:

2 45.2
5 22
8 36.09

Unfortunately I don’t have access to the file until tomorrow so it will be difficult to set up a “cue.” Although I suppose the hard part is organizing the two columns into useable data

maybe i shouldn’t do this for you :slight_smile:

  • you should learn how to split a string in python. (google the italic)
  • read a file line by line in python

Thanks for your help! The project can continue now I’ve passed that hurdle. You’re a lifesaver