Scale or rotate using Python with chosen pivot


It seems far too difficult to rotate, or in my case scale, using Python with a pivot point other than ‘MEDIAN_POINT’. I’ve spent a good time searching for solutions on the internet, and although the issue has been raised before, it has not been simplified nor a clear approach established.

Surely scaling and rotating should just take the pivot as a parameter? This would simplify the issue greatly. Would it be fair to report this as a bug/improvement? Regardless, I cannot work out how to scale some faces in my mesh with individual origins as pivots, and would greatly appreciate any help.

The following code is what I’ve been trying to use, however, if you add ‘area’:area and run it, it will break Blender, and it currently just scales with the median point as pivot anyway :frowning:

for window in = window.screen
for area in screen.areas:
[INDENT=2]if area.type == ‘VIEW_3D’:[/INDENT]
[INDENT=3]override = {‘edit_object’: bpy.context.edit_object, ‘selected_objects’: bpy.context.selected_objects, ‘scene’:C.scene, ‘screen’:screen, ‘window’: window,‘pivot_point’: “INDIVIDUAL_ORIGINS”} #‘area’:area[/INDENT]
[INDENT=3]bpy.ops.transform.resize(override, value=(0.5,0.5,0.5))