[Bf-blender-cvs] [d42b85e] pie-menus: Change template to an edit mode selection pie menu.

Antony Riakiotakis noreply at git.blender.org
Thu Aug 7 17:08:09 CEST 2014


Commit: d42b85e2d8fad7a346ff27d089e1668732fe742c
Author: Antony Riakiotakis
Date:   Thu Aug 7 17:07:57 2014 +0200
Branches: pie-menus
https://developer.blender.org/rBd42b85e2d8fad7a346ff27d089e1668732fe742c

Change template to an edit mode selection pie menu.

===================================================================

M	release/scripts/templates_py/ui_pie_menu.py

===================================================================

diff --git a/release/scripts/templates_py/ui_pie_menu.py b/release/scripts/templates_py/ui_pie_menu.py
index 35044fb..08ef5b2 100644
--- a/release/scripts/templates_py/ui_pie_menu.py
+++ b/release/scripts/templates_py/ui_pie_menu.py
@@ -1,55 +1,27 @@
 import bpy
 from bpy.props import *
-from bpy.types import Operator
 from bpy.types import Menu
 
-# expand an operator's macro in a pie menu
-
-my_items = (
-    ('ONE', "Im First!", ""),
-    ('SPACE', "Space!", ""),
-    ('AWESOME', "Wanna be awesome in space?", ""),
-    ('SPHERE', "The fact sphere is always useful", ""),
-    )
-
-
-class TestPieOperator(bpy.types.Operator):
-    """Tooltip"""
-    bl_idname = "wm.test_pie_operator"
-    bl_label = "Simple Pie Sticky Operator"
-
-    test_type = EnumProperty(
-            name='test_type',
-            items=my_items,
-            default='AWESOME',
-            )
-
-    @classmethod
-    def poll(cls, context):
-        return True
-
-    def execute(self, context):
-        print("The sphere core says:", self.test_type)
-        return {'FINISHED'}
-
+#spawn an edit mode selection pie (run while object is in edit mode to get a valid output)
 
 class VIEW3D_PIE_template(Menu):
-    bl_label = "Test Pie"
+    #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()
-        pie.operator_enum("WM_OT_test_pie_operator", "test_type")
+        #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():
-    bpy.utils.register_class(TestPieOperator)
     bpy.utils.register_class(VIEW3D_PIE_template)
 
 
 def unregister():
-    bpy.utils.unregister_class(TestPieOperator)
     bpy.utils.unregister_class(VIEW3D_PIE_template)




More information about the Bf-blender-cvs mailing list