Struggling to create a Maya pie menu- need help

Hi. I’m completely new to Blender coding, and I wish to create a Maya-like pie menu, oppened on LMB click.

Firstly, I oppened the pie menu template, which seems the best way to start.

import bpy
from bpy.types import Menu

# spawn an edit mode selection pie (run while object is in edit mode to get a valid output)

class VIEW3D_PIE_template(Menu):
    # label is displayed at the center of the pie menu.
    bl_label = "Select Mode"

    def draw(self, context):
        layout = self.layout

        pie = layout.menu_pie()
        # operator_enum will just spread all available options
        # for the type enum of the operator on the pie
        pie.operator_enum("mesh.select_mode", "type")

def register():

def unregister():

if __name__ == "__main__":



I have some question:

  1. How do I assign LMB to open that particular pie menu ?

  2. How do I change the menu items location? When I spawn the pie, the edge vertex and face is not in the same order as in the image. By using this line " pie.operator_enum(“mesh.select_mode”, “type”) , it seems that the order is random. Is it possible to put separate operators for edges select, vertex select and face select in slots similar to the pie in Maya ?

  3. Wish to assign to the pie vertex-face and multi.

    In docs, found this thing, but don’t get it how to make it work:

bpy.ops.mesh.select_mode(use_extend=False, use_expand=False, type=‘VERT’, action=‘TOGGLE’)
Change selection mode

use_extend (boolean, (optional)) – Extend
use_expand (boolean, (optional)) – Expand
type (enum in [‘VERT’, ‘EDGE’, ‘FACE’], (optional)) – Type
action (enum in [‘DISABLE’, ‘ENABLE’, ‘TOGGLE’], (optional)) –
Action, Selection action to execute
DISABLE Disable, Disable selected markers.
ENABLE Enable, Enable selected markers.
TOGGLE Toggle, Toggle disabled flag for selected markers.
Select more vertices, edges or faces connected to initial selection

  1. How to assign object.mode_set to the pie ?