[Bf-extensions-cvs] [40b654f] master: pie menu: add toggle quadview to 'more' menu

Campbell Barton noreply at git.blender.org
Tue Nov 25 09:47:34 CET 2014


Commit: 40b654f13c0401e7c65d30a48cf9c4832e862d1b
Author: Campbell Barton
Date:   Tue Nov 25 09:46:30 2014 +0100
Branches: master
https://developer.blender.org/rBA40b654f13c0401e7c65d30a48cf9c4832e862d1b

pie menu: add toggle quadview to 'more' menu

also minor cleanup

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

M	ui_pie_menus_official.py

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

diff --git a/ui_pie_menus_official.py b/ui_pie_menus_official.py
index d13a05b..cc862f1 100644
--- a/ui_pie_menus_official.py
+++ b/ui_pie_menus_official.py
@@ -42,6 +42,7 @@ class VIEW3D_PIE_object_mode(Menu):
         pie = layout.menu_pie()
         pie.operator_enum("OBJECT_OT_mode_set", "mode")
 
+
 class VIEW3D_PIE_view_more(Menu):
     bl_label = "More"
 
@@ -54,6 +55,7 @@ class VIEW3D_PIE_view_more(Menu):
         pie.operator("VIEW3D_OT_view_selected")
         pie.operator("VIEW3D_OT_view_all")
         pie.operator("VIEW3D_OT_localview")
+        pie.operator("SCREEN_OT_region_quadview")
 
 
 class VIEW3D_PIE_view(Menu):
@@ -94,11 +96,11 @@ class VIEW3D_manipulator_set(Operator):
             items=(('TRANSLATE', "Translate", "Use the manipulator for movement transformations"),
                    ('ROTATE', "Rotate", "Use the manipulator for rotation transformations"),
                    ('SCALE', "Scale", "Use the manipulator for scale transformations"),
-                  ),
-        )
+                   ),
+            )
 
     def execute(self, context):
-        #show manipulator if user selects an option
+        # show manipulator if user selects an option
         context.space_data.show_manipulator = True
 
         context.space_data.transform_manipulators = {self.type}
@@ -145,18 +147,22 @@ class VIEW3D_PIE_snap(Menu):
 
 addon_keymaps = []
 
+classes = (
+    VIEW3D_manipulator_set,
 
-def register():
-    bpy.utils.register_class(VIEW3D_manipulator_set)
+    VIEW3D_PIE_object_mode,
+    VIEW3D_PIE_view,
+    VIEW3D_PIE_view_more,
+    VIEW3D_PIE_shade,
+    VIEW3D_PIE_manipulator,
+    VIEW3D_PIE_pivot,
+    VIEW3D_PIE_snap,
+    )
 
-    #register menus
-    bpy.utils.register_class(VIEW3D_PIE_object_mode)
-    bpy.utils.register_class(VIEW3D_PIE_view)
-    bpy.utils.register_class(VIEW3D_PIE_view_more)
-    bpy.utils.register_class(VIEW3D_PIE_shade)
-    bpy.utils.register_class(VIEW3D_PIE_manipulator)
-    bpy.utils.register_class(VIEW3D_PIE_pivot)
-    bpy.utils.register_class(VIEW3D_PIE_snap)
+
+def register():
+    for cls in classes:
+        bpy.utils.register_class(cls)
 
     wm = bpy.context.window_manager
 
@@ -179,15 +185,8 @@ def register():
 
 
 def unregister():
-    bpy.utils.unregister_class(VIEW3D_manipulator_set)
-
-    bpy.utils.unregister_class(VIEW3D_PIE_object_mode)
-    bpy.utils.unregister_class(VIEW3D_PIE_view)
-    bpy.utils.unregister_class(VIEW3D_PIE_view_more)
-    bpy.utils.unregister_class(VIEW3D_PIE_shade)
-    bpy.utils.unregister_class(VIEW3D_PIE_manipulator)
-    bpy.utils.unregister_class(VIEW3D_PIE_pivot)
-    bpy.utils.unregister_class(VIEW3D_PIE_snap)
+    for cls in classes:
+        bpy.utils.unregister_class(cls)
 
     wm = bpy.context.window_manager
 
@@ -198,5 +197,4 @@ def unregister():
 
             wm.keyconfigs.addon.keymaps.remove(km)
 
-    # clear the list
-    del addon_keymaps[:]
+    addon_keymaps.clear()



More information about the Bf-extensions-cvs mailing list