Is the Curve module accepting BezTriple for appendNurb ?

I can’t get the Curve module to create bezier curves by giving it BezTriple objects. I’m assuming a BezTriple is a list of 3 lists, each sublist defining the x,y,z coords of a point, as the getTriple function returns for an existing curve object.
I’m using Blender 2.40.

Has anyone succeeded in creating Bezier curves from a python script?

In 2.37 appending a BezTriple resulted in a seg fault. I was told this is fixed in 2.40 and yes, it doesn’t crash, but still I keep getting the error:

TypeError: expected a sequence of 4 or 5 floats

Any help appreciated.

UPDATE: found the answer myself. One has to pass Blender.BezTriple objects to the appendNurb and the appendPoint functions of the Blender.Curve module. AND the BezTriple.New() accepts a tuple, not a list, so one has to do (NOTE the double brackets):
bt = BezTriple.New((1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9,0))

Albert

This has been killing me trying to figure out how to create bezier curves. Previously I had to actually have a bezier curve in the scene and grab a beztriple from that curve, but this fix is a lifesaver! Thanks!

leafw, Thanks this helps a lot :smiley:

This method is used in the SVG import script since the 0.45 version .
https://blenderartists.org/forum/viewtopic.php?t=28197&highlight=svg