I'm trying to edit curves via python, but deleting bezier points is causing me trouble. I'm able to do it using high-level operators (see sample code below), but I would prefer edit the data more directly, for speed and cleanliness.
#Define vars
one = bpy.data.objects['Curve']
point_to_remove = one.data.splines[0].bezier_points[0]
#Set 'one' to edit mode
bpy.context.scene.objects.active = one
bpy.ops.object.mode_set(mode = 'EDIT')
#Select point_to_remove and remove it
point_to_remove.select_control_point = True
bpy.ops.curve.dissolve_verts()
I've tried using .add()
to create a dummy object with the desired set of bezier points and then setting one.data.splines[0].bezier_points = ...
, but bezier_points is read-only.
I've tried python's del()
and the blender API's `remove()', but they either aren't supported for bezier points or I'm using them wrong.
Any help would be much appreciated.
Edit: It seems this is a special case of deleting instances of the bpy_struct class, which I also don't know how to do.