📋 Metadata

💬 Content

Way2Close:

Heya, I have a pme macro which does:

#store pivot mode
stored_pivot_mode = bpy.context.space_data.pivot_point

#change pivot mode to 3d cursor
bpy.context.space_data.pivot_point = ‘CURSOR’

#rotate
bpy.ops.transform.rotate(‘INVOKE_DEFAULT’, True)

#restore pivot mode
bpy.context.space_data.pivot_point = stored_pivot_mode

It works fine, but if I cancel the rotate it never restores the pivot mode, is there a way to brute force it back to the stored?

Hi, try to restore the pivot mode in the 3rd slot:

bpy.ops.transform.rotate('INVOKE_DEFAULT', True); bpy.context.space_data.pivot_point = stored_pivot_mode

🔗 View on Blender Artists