Skip to main content
added 1951 characters in body
Source Link
Gaia Clary
  • 3.8k
  • 2
  • 27
  • 40
bl_info = {
    "name": "My Pies",
    "author": "My Name",
    "version": (1, 1, 0),
    "blender": (2, 72, 0),
    "description": "My Pie menu",
    "category": "Object" }

import bpy
from bpy.types import Menu

# Implements an edit mode selection pie

class VIEW3D_PIE_template(Menu):
    # label is displayed at the center of the pie menu.
    bl_label  = "Select Mode" # Appears as Pie title
    bl_idname = "mesh.mypie"  # Used to refer (see below)

    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")

addon_keymaps = [] # Store keymaps to use in unregister()

def register():
    bpy.utils.register_class(VIEW3D_PIE_template)

    Now# defineDefine a keyboard shortcut: (for Mesh Edit mode)
    wm = bpy.context.window_manager
    km = wm.keyconfigs.addon.keymaps.new(name="Mesh") #For Mesh Edit Mode
    
    #Open# Open the pie when you press CTRL SHIFT E:
    kmi = km.keymap_items.new("wm.call_menu_pie", 'E', 'PRESS', shift=True, ctrl=True)
    kmi.properties.name="mesh.mypie"
    addon_keymaps.append((km,kmi)) # Store keymap


def unregister():
    bpy.utils.unregister_class(VIEW3D_PIE_template)
    
    #use stored keymaps to unregister
    for km, kmi in addon_keymaps:
        km.keymap_items.remove(kmi)
    addon_keymaps.clear()

if __name__ == "__main__":
    register()
bl_info = {
    "name": "My Pies",
    "author": "My Name",
    "version": (1, 1, 0),
    "blender": (2, 72, 0),
    "description": "My Pie menu",
    "category": "Object" }

import bpy
from bpy.types import Menu

# Implements an edit mode selection pie

class VIEW3D_PIE_template(Menu):
    # label is displayed at the center of the pie menu.
    bl_label  = "Select Mode" # Appears as Pie title
    bl_idname = "mesh.mypie"  # Used to refer (see below)

    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")

addon_keymaps = [] # Store keymaps to use in unregister()

def register():
    bpy.utils.register_class(VIEW3D_PIE_template)

    Now define a keyboard shortcut:
    wm = bpy.context.window_manager
    km = wm.keyconfigs.addon.keymaps.new(name="Mesh") #For Mesh Edit Mode
    
    #Open the pie when you press CTRL SHIFT E:
    kmi = km.keymap_items.new("wm.call_menu_pie", 'E', 'PRESS', shift=True, ctrl=True)
    kmi.properties.name="mesh.mypie"
    addon_keymaps.append((km,kmi)) # Store keymap


def unregister():
    bpy.utils.unregister_class(VIEW3D_PIE_template)
    
    #use stored keymaps to unregister
    for km, kmi in addon_keymaps:
        km.keymap_items.remove(kmi)
    addon_keymaps.clear()

if __name__ == "__main__":
    register()
bl_info = {
    "name": "My Pies",
    "author": "My Name",
    "version": (1, 1, 0),
    "blender": (2, 72, 0),
    "description": "My Pie menu",
    "category": "Object" }

import bpy
from bpy.types import Menu

# Implements an edit mode selection pie

class VIEW3D_PIE_template(Menu):
    # label is displayed at the center of the pie menu.
    bl_label  = "Select Mode" # Appears as Pie title
    bl_idname = "mesh.mypie"  # Used to refer (see below)

    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")

addon_keymaps = [] # Store keymaps to use in unregister()

def register():
    bpy.utils.register_class(VIEW3D_PIE_template)

    # Define a keyboard shortcut (for Mesh Edit mode)
    wm = bpy.context.window_manager
    km = wm.keyconfigs.addon.keymaps.new(name="Mesh")
    
    # Open the pie when you press CTRL SHIFT E:
    kmi = km.keymap_items.new("wm.call_menu_pie", 'E', 'PRESS', shift=True, ctrl=True)
    kmi.properties.name="mesh.mypie"
    addon_keymaps.append((km,kmi)) # Store keymap


def unregister():
    bpy.utils.unregister_class(VIEW3D_PIE_template)
    
    #use stored keymaps to unregister
    for km, kmi in addon_keymaps:
        km.keymap_items.remove(kmi)
    addon_keymaps.clear()

if __name__ == "__main__":
    register()
added 1951 characters in body
Source Link
Gaia Clary
  • 3.8k
  • 2
  • 27
  • 40

You basically have to enable a new Pie menu Addon (official released with Blender 2.72). Once you have enabled this addon, you can start creating your own Pie menus. Some Basics are documented in the Blender Wiki, see: Creating Pie Menus and Coding Pie Menus

I am not sure how to extract the essentials here. So instead of copying the documentation hereBelow you find a complete, i just leavebriefly commented and fully working mini example addon. Just place the linkscode below into a file named

whatever_name_you_like.py  

and then Install/Enable this python file as a regular Addon.

Notes:

  • The name of the file is not important, however the appendix '.py' is essential to mark this as a python file.
  • You do not need to enable the "Pie Menus Official" Addon in order to get your own Pie menus to work properly!

Begin of the code:

bl_info = {
    "name": "My Pies",
    "author": "My Name",
    "version": (1, 1, 0),
    "blender": (2, 72, 0),
    "description": "My Pie menu",
    "category": "Object" }

import bpy
from bpy.types import Menu

# Implements an edit mode selection pie

class VIEW3D_PIE_template(Menu):
    # label is displayed at the center of the pie menu.
    bl_label  = "Select Mode" # Appears as Pie title
    bl_idname = "mesh.mypie"  # Used to refer (see below)

    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")

addon_keymaps = [] # Store keymaps to use in unregister()

def register():
    bpy.utils.register_class(VIEW3D_PIE_template)

    Now define a keyboard shortcut:
    wm = bpy.context.window_manager
    km = wm.keyconfigs.addon.keymaps.new(name="Mesh") #For Mesh Edit Mode
    
    #Open the pie when you press CTRL SHIFT E:
    kmi = km.keymap_items.new("wm.call_menu_pie", 'E', 'PRESS', shift=True, ctrl=True)
    kmi.properties.name="mesh.mypie"
    addon_keymaps.append((km,kmi)) # Store keymap


def unregister():
    bpy.utils.unregister_class(VIEW3D_PIE_template)
    
    #use stored keymaps to unregister
    for km, kmi in addon_keymaps:
        km.keymap_items.remove(kmi)
    addon_keymaps.clear()

if __name__ == "__main__":
    register()

You basically have to enable a new Pie menu Addon (official released with Blender 2.72). Once you have enabled this addon, you can start creating your own Pie menus. Some Basics are documented in the Blender Wiki, see: Creating Pie Menus and Coding Pie Menus

I am not sure how to extract the essentials here. So instead of copying the documentation here, i just leave the links.

Some Basics are documented in the Blender Wiki, see:

Below you find a complete, briefly commented and fully working mini example addon. Just place the code below into a file named

whatever_name_you_like.py  

and then Install/Enable this python file as a regular Addon.

Notes:

  • The name of the file is not important, however the appendix '.py' is essential to mark this as a python file.
  • You do not need to enable the "Pie Menus Official" Addon in order to get your own Pie menus to work properly!

Begin of the code:

bl_info = {
    "name": "My Pies",
    "author": "My Name",
    "version": (1, 1, 0),
    "blender": (2, 72, 0),
    "description": "My Pie menu",
    "category": "Object" }

import bpy
from bpy.types import Menu

# Implements an edit mode selection pie

class VIEW3D_PIE_template(Menu):
    # label is displayed at the center of the pie menu.
    bl_label  = "Select Mode" # Appears as Pie title
    bl_idname = "mesh.mypie"  # Used to refer (see below)

    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")

addon_keymaps = [] # Store keymaps to use in unregister()

def register():
    bpy.utils.register_class(VIEW3D_PIE_template)

    Now define a keyboard shortcut:
    wm = bpy.context.window_manager
    km = wm.keyconfigs.addon.keymaps.new(name="Mesh") #For Mesh Edit Mode
    
    #Open the pie when you press CTRL SHIFT E:
    kmi = km.keymap_items.new("wm.call_menu_pie", 'E', 'PRESS', shift=True, ctrl=True)
    kmi.properties.name="mesh.mypie"
    addon_keymaps.append((km,kmi)) # Store keymap


def unregister():
    bpy.utils.unregister_class(VIEW3D_PIE_template)
    
    #use stored keymaps to unregister
    for km, kmi in addon_keymaps:
        km.keymap_items.remove(kmi)
    addon_keymaps.clear()

if __name__ == "__main__":
    register()
Post Undeleted by Gaia Clary
Post Deleted by Gaia Clary
added 117 characters in body
Source Link
Gaia Clary
  • 3.8k
  • 2
  • 27
  • 40

You basically have to enable a new Pie menu Addon (official released with Blender 2.72). Once you have enabled this addon, you can start creating your own Pie menus. Some Basics are documented in the Blender Wiki, see: Creating Pie Menus and Coding Pie Menus

I am not sure how to extract the essentials here. So instead of copying the documentation here, i just leave the links.

Some Basics are documented in the Blender Wiki, see: Creating Pie Menus and Coding Pie Menus

You basically have to enable a new Pie menu Addon (official released with Blender 2.72). Once you have enabled this addon, you can start creating your own Pie menus. Some Basics are documented in the Blender Wiki, see: Creating Pie Menus and Coding Pie Menus

I am not sure how to extract the essentials here. So instead of copying the documentation here, i just leave the links.

Source Link
Gaia Clary
  • 3.8k
  • 2
  • 27
  • 40
Loading