📋 Metadata

💬 Content

EL_BIBIKA:

How to set coordinates of called PIE menu in the center of the screen?

You can use C.window.cursor_warp(x, y) to move the mouse and call a pie with some delay using pme.timeout operator.
Eg. call the pie in the center of 3DView:

a = find_by(C.screen.areas, "ui_type", 'VIEW_3D'); a and C.window.cursor_warp(a.x + a.width / 2, a.y + a.height / 2); a and bpy.ops.pme.timeout(cmd="open_menu('Pie Menu')")

To open the pie in the center of screen use this:

w = C.window; C.window.cursor_warp(w.width / 2, w.height / 2); bpy.ops.pme.timeout(cmd="open_menu('Pie Menu')")

❤️ 4 likes


🔗 View on Blender Artists