I made a script that creates a circle, deselects all vertices in edit mode, selects first 5 vertices and then scales those vertices. I expected those vertices to be scaled with 3D cursor which sits in the middle of the circle, but instead the vertices are scaled with their median point.
I was experimenting with bpy.ops.transform.transform()
function too, but to no avail.
import bpy
bpy.ops.mesh.primitive_circle_add(vertices=35, enter_editmode=False, align='WORLD', location=(0, 0, 0), scale=(1, 1, 1))
obj = bpy.context.active_object
bpy.ops.object.editmode_toggle()
bpy.ops.mesh.select_all(action='DESELECT')
bpy.ops.object.editmode_toggle()
obj.data.vertices[0].select = True
obj.data.vertices[1].select = True
obj.data.vertices[2].select = True
obj.data.vertices[3].select = True
obj.data.vertices[4].select = True
bpy.ops.object.editmode_toggle()
bpy.ops.transform.resize(value=(0.5, 0.5, 0.5),orient_type='CURSOR')
Script result:
Expected result: