How do set the control point of a bezier curve to "active" in script in 2.8? Like so: enter image description here

I want to hook it to a new object like so:

bpy.data.objects['Bezier'].data.splines[0].bezier_points[i].select_control_point = True 

but the first line doesn't make it active, and I get this error:

RuntimeError: Error: Requires selected vertices or active vertex group



2 Answers 2


You need to be in edit mode for this to work.

import bpy

i = 0  # this is the index of the bezier point you want

points = bpy.data.objects['BezierCurve']data.splines[0].bezier_points

bpy.ops.object.mode_set(mode = 'EDIT')

points[i].select_control_point = True


bpy.ops.object.mode_set(mode = 'OBJECT')

After setting the value, you may need to call:


I can't find any docs on this, but others have had similar issues with this on mesh vertices and calling an update seems to re-synch blender.


Try this format instead

curve.data.splines[0].bezier_points[0].select_control_point = True

Just make sure you select the right point.


You must log in to answer this question.

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