I'm writing an add-on for Blender, and I'd like to create two different key mappings for rotation: one will rotate around the median point, the other around the cursor. In each case, the plan is to set the pivot mode first, then enable rotation.
I can change the pivot point by setting bpy.context.scene.tool_settings.transform_pivot_point
, but the next step is the manual rotation, which I can't figure out.
To be clear, I don't want to switch to the Rotate tool. I just want to do a quick rotation (as if the user pressed the R key); so once the rotation is confirmed, I want to switch back to whatever tool I was using before.
Is there an instruction in the Python API to trigger a manual rotation?
invoke()
, instead ofexecute()
– right? Please, could you share some links on that topic? It would be useful either for me and for the author of the original question. $\endgroup$