I want to subdivide the curve between two control points of a bezier curve using a python script. It's very easy if I do i manually. Just enter the edit mode and select two point, then click the right mouse ,choose subdivide. Show in Image 1,2,3.
However, this seems so hard by using a python script. I use the code below, but it doesn't work.
bezier_curve = bpy.context.active_object
bpy.ops.object.mode_set(mode='EDIT', toggle=False)
points = bezier_curve.data.splines[0].bezier_points
points[1].select_control_point = True
points[2].select_control_point = True
bpy.ops.curve.subdivide()
The code above just subdivide the whole curve like Image 4 show.Anyone know how to get the effect I expected? Thank you.