In edit mode, it always is reduced against the median point of the selected faces even with the pivot at the cursor. How can I make it to behave like in object mode?
I need to use Edit mode because I just want to resize an extruded part of the object.
The context override seems to work, applying the principles found here by Garrett:
you can get a resize from the pivot point in edit mode following:
Set active Viewport’s pivot to 3d cursor
Set up a context override function (copied from the link above, thanks!)
import bpy
def get_override(area_type, region_type):
for area in bpy.context.screen.areas:
if area.type == area_type:
for region in area.regions:
if region.type == region_type:
override = {'area': area, 'region': region}
return override
#error message if the area or region wasn't found
raise RuntimeError("Wasn't able to find", region_type," in area ", area_type,
"
Make sure it's open while executing script.")
#we need to override the context of our operator
override = get_override( 'VIEW_3D', 'WINDOW' )
3.When applying transforms pass the override context as the first parameter
Hope I don’t break any rules by necrobumping, but just wanted to thank you for this Shiprex! Been struggling with it for hours and your snippet solved all of my problems. Happy holidays!