I have created a bezier curve in Blender.

enter image description here

I'd like to export this curve to a text file. What I need is :

Control point + handles, three points in total.

Example :

{{ 2.3333,4.3942, 55.333 }, { 0.3234, 2.4234, 4.0332 }, { 2.534, 6.S234, 12.0332 }}

I have tried to export the scene in Collada format but it doesn't seems to include curves information.

What is the easiest / simplest way to export this curve to some readable text file format ?

  • \$\begingroup\$ can anyone say why doesn't the exported Collada file include curves? \$\endgroup\$
    – Dor
    Commented Nov 14, 2015 at 17:16

3 Answers 3


There are scripts available that do this. Though they may be a bit out of date. Perhaps not the simplest method, but you can write your own python script to export them. Using Blender scripting you can enumerate the objects in the scene and then enumerate through all the curves of a particular bezier curve.

  • \$\begingroup\$ Thanks. Most of the scripts i have found (including the one you suggest) are for old version of Blender (2.4?). It seems they changed almost all the api since recent 2.6 versions (the one i use). Even documentation for 2.6 still do not exists : wiki.blender.org/index.php/Doc:2.6/Tutorials/Extensions/Python/…. Do you recommand sticking with old version ? I was expecting some Blender script guru to show me a simple script example to start with. eg: how to loop on control points of a curve. \$\endgroup\$
    – tigrou
    Commented Mar 23, 2013 at 15:48
  • 1
    \$\begingroup\$ Here's blender python api for 2.66a: blender.org/documentation/blender_python_api_2_66a_release \$\endgroup\$
    – Exilyth
    Commented Mar 23, 2013 at 15:51

Try this:

import bpy
myCurve = bpy.data.curves[0] # here your curve
spline= myCurve.splines[0] # maybe you need a loop if more than 1 spline

for x in range(len(spline.bezier_points)):
    print("Point " + str(x)
  • \$\begingroup\$ How would one integrate this Python script into Blender in order to utilize it? This seems like the start of a good answer but it could be expanded upon. \$\endgroup\$ Commented Dec 13, 2013 at 19:56
  • \$\begingroup\$ blender incorporates and depends on python to run. You can paste this code into a text window and run it as a script. The top of the blender window most likely lists default as the current layout, change that to scripting to see a layout with 3dview, text and python console visible. \$\endgroup\$
    – sambler
    Commented Dec 14, 2013 at 1:46

For anyone interested, here is revelant code :

ob = bpy.context.object # active object 

# iterate over points of the curve's first spline 
file = open('foo.txt', 'w')     
for p in ob.data.splines.active.bezier_points: 
    file.write("%.3f, %.3f, %.3f" % p.co.x, p.co.y, p.co.z) 
    file.write("%.3f, %.3f, %.3f" % p.handle_left.x, p.handle_left.y, p.handle_left.z) 
    file.write("%.3f, %.3f, %.3f" % p.handle_right.x, p.handle_right.y,p.handle_right.z) 
  • \$\begingroup\$ This isn't an answer. You should edit the original question to add any extra info. \$\endgroup\$
    – petervaz
    Commented Mar 27, 2013 at 1:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .