### Coded by Wray Bowling ### rgbk.org ### because i have a deadline and for some reason ### i couldn't find anything that would do this for me import Blender from Blender import Object, Scene, Window def import_icarus2d(file_path): Blender.Window.WaitCursor(1) file_contents = open(file_path, 'r') selected = Blender.Object.GetSelected() this_scene = Scene.GetCurrent() for line in file_contents.readlines(): words = line.split() if len(words) == 0 or words[0].startswith('#'): #skip comment lines pass elif words[0].startswith('"'): empty_name = words[0].strip('"') ob = Object.New("Empty",empty_name) ob.LocX=0 ob.LocY=0 this_scene.objects.link(ob) print "created " + empty_name print "the selected object is " + ob.name my_ipo = Blender.Ipo.New('Object', empty_name) ob.setIpo(my_ipo) LocX = my_ipo.addCurve('LocX') LocY = my_ipo.addCurve('LocY') elif len(words) == 1: #skip the line that says how many frames there are pass else: # import LocX try: animation = LocX.getPoints()[i] animation.setPoints(words[0], words[1]) except: LocX.addBezier((int(words[0]), float(words[1])/100)) # import LocY try: animation = LocY.getPoints()[i] animation.setPoints(words[0], words[2]) except: LocY.addBezier((int(words[0]), float(words[2])/100)) Window.RedrawAll() Blender.Window.FileSelector(import_icarus2d, 'Import')