Script to Import 3D Point List to Curve

Greetings, all!

I need a script that will parse a sorted ASCII point list that contains X,Y,Z information for points along a 3D Curve and then create that 3D curve in Blender.

Does anything like this exist? If not, I’d be willing to negotiate a fee for producing the script for me.


Easy to adapt from a script that made hair curves from edgeloops in a mesh

import Blender

def loadPoints(file):
  f = Blender.Text.Load(file)
  points = []
  for l in f.asLines():
      coords = l.split()
      x= float(coords[0])
      y= float(coords[1])
      z= float(coords[2])
      points.append([x,y,z, 1.0])

  if len(points) < 4:
     Blender.Draw.PupMenu('%tFile contains less than four control points')

  curveOb = Blender.Object.New('Curve')
  curve = curveOb.getData()

  for p in points[1:]:


Blender.Window.FileSelector(loadPoints, 'Text coordinates file')

Thanks for the example code! I’ll blow the dust off of my Python knowledge (I used to be pretty good at it!) and give it a go.

BTW, does anyone know if there’s a limit to the number of points in a curve?


Some of those methods are now deprecated. Try looking in the curve module documentation here: To see the updated methods. Note that only a couple need this, and the arguments won’t really change to the functions that do, but its always good form to write modern code.