Post #3526: ![](https://blenderartists.org/user_avatar/blenderartists.org/el_bibika/48/57584

📋 Metadata

  • Author: roaoao
  • Date: 2020-08-19 23:59:14
  • Type: answer
  • Quality Score: 8/10
  • Reply to: post_03518

🏷️ Tags

pie-menu hotkeys advanced solved

  • Pie Menu Editor
  • Python Scripting
  • Macro Editor

💬 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