[Bf-extensions-cvs] [2e7de782] master: UI Pie Menu Official: Cleanup, update to version 1.1.5

lijenstina noreply at git.blender.org
Sun Jul 2 12:38:18 CEST 2017


Commit: 2e7de78293291168d159c5922311b5faddc6f384
Author: lijenstina
Date:   Sun Jul 2 12:37:39 2017 +0200
Branches: master
https://developer.blender.org/rBA2e7de78293291168d159c5922311b5faddc6f384

UI Pie Menu Official: Cleanup, update to version 1.1.5

Bumped version to 1.1.5
Pep8 cleanup
Remove unused imports - Operator was copy pasted
Comment out the code for getting the submodule name
instead of commenting out the bl_info entries
Add an icon to the End of the Pie activation label

Fix several crashes in the Clip Editor Pies related
to calling them when the clip was missing
Fix crash with Pivot pie when there is no active object

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

M	pie_menus_official/__init__.py
M	pie_menus_official/pie_clip_marker_of.py
M	pie_menus_official/pie_manipulator_of.py
M	pie_menus_official/pie_object_modes_of.py
M	pie_menus_official/pie_pivot_of.py
M	pie_menus_official/pie_shade_of.py
M	pie_menus_official/pie_snap_of.py
M	pie_menus_official/pie_view_of.py

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

diff --git a/pie_menus_official/__init__.py b/pie_menus_official/__init__.py
index bd70a8e4..513ae2b3 100644
--- a/pie_menus_official/__init__.py
+++ b/pie_menus_official/__init__.py
@@ -28,15 +28,16 @@ from bpy.types import (
 
 
 bl_info = {
-    'name': 'UI Pie Menu Official',
-    'author': 'Antony Riakiotakis, Sebastian Koenig',
-    'version': (1, 1, 4),
-    'blender': (2, 7, 7),
-    'description': 'Individual Pie Menu Activation List',
-    'location': 'Addons Preferences',
-    'warning': '',
-    'wiki_url': 'https://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/3D_interaction/Pie_Menu',
-    'category': 'Pie Menu'
+    "name": "UI Pie Menu Official",
+    "author": "Antony Riakiotakis, Sebastian Koenig",
+    "version": (1, 1, 5),
+    "blender": (2, 7, 7),
+    "description": "Individual Pie Menu Activation List",
+    "location": "Addons Preferences",
+    "warning": "",
+    "wiki_url": "https://wiki.blender.org/index.php/Extensions:2.6/Py/"
+                "Scripts/3D_interaction/Pie_Menu",
+    "category": "Pie Menu"
     }
 
 
@@ -105,6 +106,7 @@ def unregister_submodule(mod):
                 if name in prefs:
                     del prefs[name]
 
+
 class UIToolsPreferences(AddonPreferences):
     bl_idname = __name__
 
@@ -144,10 +146,12 @@ class UIToolsPreferences(AddonPreferences):
                     split = col.row().split(percentage=0.15)
                     split.label('Location:')
                     split.label(info['location'])
-                if info.get('author') and info.get('author') != 'chromoly':
+                """
+                if info.get('author'):
                     split = col.row().split(percentage=0.15)
                     split.label('Author:')
                     split.label(info['author'])
+                """
                 if info.get('version'):
                     split = col.row().split(percentage=0.15)
                     split.label('Version:')
@@ -179,12 +183,13 @@ class UIToolsPreferences(AddonPreferences):
                         try:
                             prefs.draw(context)
                         except:
+                            import traceback
                             traceback.print_exc()
                             box.label(text='Error (see console)', icon='ERROR')
                         del prefs.layout
 
         row = layout.row()
-        row.label("End of Pie Menu Activations")
+        row.label(text="End of Pie Menu Activations", icon="FILE_PARENT")
 
 
 for mod in sub_modules:
@@ -193,20 +198,20 @@ for mod in sub_modules:
 
     def gen_update(mod):
         def update(self, context):
-            enabled =  getattr(self, 'use_' + mod.__name__.split('.')[-1])
+            enabled = getattr(self, 'use_' + mod.__name__.split('.')[-1])
             if enabled:
                 register_submodule(mod)
             else:
                 unregister_submodule(mod)
-            mod.__addon_enabled__  = enabled
+            mod.__addon_enabled__ = enabled
         return update
 
     prop = BoolProperty(
-        name=info['name'],
-        description=info.get('description', ''),
-        update=gen_update(mod),
-        default=True,
-    )
+            name=info['name'],
+            description=info.get('description', ''),
+            update=gen_update(mod),
+            default=True,
+            )
 
     setattr(UIToolsPreferences, 'use_' + mod_name, prop)
     prop = BoolProperty()
@@ -238,5 +243,6 @@ def unregister():
     for cls in reversed(classes):
         bpy.utils.unregister_class(cls)
 
+
 if __name__ == "__main__":
     register()
diff --git a/pie_menus_official/pie_clip_marker_of.py b/pie_menus_official/pie_clip_marker_of.py
index 97c3a237..865aa24c 100644
--- a/pie_menus_official/pie_clip_marker_of.py
+++ b/pie_menus_official/pie_clip_marker_of.py
@@ -21,25 +21,28 @@
 bl_info = {
     "name": "Clip Editor Pies: Key: 'hotkey list Below'",
     "description": "Clip Editor Pies",
-#    "author": "Antony Riakiotakis, Sebastian Koenig",
-#    "version": (0, 1, 0),
+    "author": "Antony Riakiotakis, Sebastian Koenig",
+    "version": (0, 1, 1),
     "blender": (2, 77, 0),
-    "location": "Q, W, Shift W, E. Shift S, Shift A",
+    "location": "Q, W, Shift W, E, Shift S, Shift A",
     "warning": "",
     "wiki_url": "",
     "category": "Pie Menu"
     }
 
 import bpy
-from bpy.types import (
-        Menu,
-        Operator,
-        )
+from bpy.types import Menu
+
 
 class CLIP_PIE_refine_pie(Menu):
     # Refinement Options
     bl_label = "Refine Intrinsics"
 
+    @classmethod
+    def poll(cls, context):
+        space = context.space_data
+        return (space.type == 'CLIP_EDITOR') and space.clip
+
     def draw(self, context):
         clip = context.space_data.clip
         settings = clip.tracking.settings
@@ -66,6 +69,11 @@ class CLIP_PIE_proxy_pie(Menu):
     # Proxy Controls
     bl_label = "Proxy Size"
 
+    @classmethod
+    def poll(cls, context):
+        space = context.space_data
+        return (space.type == 'CLIP_EDITOR') and space.clip
+
     def draw(self, context):
         space = context.space_data
 
@@ -98,7 +106,8 @@ class CLIP_PIE_marker_pie(Menu):
 
     def draw(self, context):
         clip = context.space_data.clip
-        track_active = clip.tracking.tracks.active
+        tracky = getattr(getattr(clip, "tracking", None), "tracks", None)
+        track_active = tracky.active if tracky else None
 
         layout = self.layout
         pie = layout.menu_pie()
@@ -171,7 +180,10 @@ class CLIP_PIE_clipsetup_pie(Menu):
         pie.operator("clip.set_scene_frames", text="Set Scene Frames", icon='SCENE_DATA')
         pie.operator("wm.call_menu_pie", text="Marker Display", icon='PLUS').name = "CLIP_PIE_display_pie"
         pie.operator("clip.set_active_clip", icon='CLIP')
-        pie.operator("wm.call_menu_pie", text="Proxy", icon='PLUS').name = "CLIP_PIE_proxy_pie"
+
+        pie_proxy = layout.menu_pie()
+        pie_proxy.enabled = space.clip is not None
+        pie_proxy.operator("wm.call_menu_pie", text="Proxy", icon='PLUS').name = "CLIP_PIE_proxy_pie"
 
 
 class CLIP_PIE_solver_pie(Menu):
@@ -180,7 +192,7 @@ class CLIP_PIE_solver_pie(Menu):
 
     def draw(self, context):
         clip = context.space_data.clip
-        settings = clip.tracking.settings
+        settings = getattr(getattr(clip, "tracking", None), "settings", None)
 
         layout = self.layout
         pie = layout.menu_pie()
@@ -188,11 +200,15 @@ class CLIP_PIE_solver_pie(Menu):
         pie.operator("clip.create_plane_track", icon='MESH_PLANE')
         pie.operator("clip.solve_camera", text="Solve Camera", icon='OUTLINER_OB_CAMERA')
 
-        pie.operator("wm.call_menu_pie", text="Refinement", icon='CAMERA_DATA').name = "CLIP_PIE_refine_pie"
-        pie.prop(settings, "use_tripod_solver", text="Tripod Solver")
+        if settings:
+            pie.operator("wm.call_menu_pie", text="Refinement",
+                        icon='CAMERA_DATA').name = "CLIP_PIE_refine_pie"
+            pie.prop(settings, "use_tripod_solver", text="Tripod Solver")
 
-        pie.operator("clip.set_solver_keyframe", text="Set Keyframe A", icon='KEY_HLT').keyframe = 'KEYFRAME_A'
-        pie.operator("clip.set_solver_keyframe", text="Set Keyframe B", icon='KEY_HLT').keyframe = 'KEYFRAME_B'
+        pie.operator("clip.set_solver_keyframe", text="Set Keyframe A",
+                    icon='KEY_HLT').keyframe = 'KEYFRAME_A'
+        pie.operator("clip.set_solver_keyframe", text="Set Keyframe B",
+                    icon='KEY_HLT').keyframe = 'KEYFRAME_B'
 
         prop = pie.operator("clip.clean_tracks", icon='STICKY_UVS_DISABLE')
         pie.operator("clip.filter_tracks", icon='FILTER')
@@ -218,7 +234,8 @@ class CLIP_PIE_reconstruction_pie(Menu):
         pie.operator("clip.set_axis", text="Set Y Axis", icon='AXIS_SIDE').axis = 'Y'
 
         pie.operator("clip.set_scale", text="Set Scale", icon='ARROW_LEFTRIGHT')
-        pie.operator("wm.call_menu_pie", text="Reconstruction", icon='MESH_DATA').name = "CLIP_PIE_geometry_reconstruction"
+        pie.operator("wm.call_menu_pie", text="Reconstruction",
+                    icon='MESH_DATA').name = "CLIP_PIE_geometry_reconstruction"
 
 
 class CLIP_PIE_timecontrol_pie(Menu):
@@ -266,7 +283,6 @@ def register():
     wm = bpy.context.window_manager
 
     if wm.keyconfigs.addon:
-        #km = wm.keyconfigs.addon.keymaps.new(name='Object Non-modal') # WHY
 
         km = wm.keyconfigs.addon.keymaps.new(name="Clip", space_type='CLIP_EDITOR')
 
@@ -300,7 +316,6 @@ def unregister():
         bpy.utils.unregister_class(cls)
 
     wm = bpy.context.window_manager
-
     kc = wm.keyconfigs.addon
     if kc:
         for km, kmi in addon_keymaps:
diff --git a/pie_menus_official/pie_manipulator_of.py b/pie_menus_official/pie_manipulator_of.py
index 46479b83..04ced83a 100644
--- a/pie_menus_official/pie_manipulator_of.py
+++ b/pie_menus_official/pie_manipulator_of.py
@@ -2,8 +2,8 @@
 bl_info = {
     "name": "Manipulator Menu: Key: 'Ctrl Space'",
     "description": "Manipulator Modes",
-#    "author": "Antony Riakiotakis, Sebastian Koenig",
-#    "version": (0, 1, 0),
+    "author": "Antony Riakiotakis, Sebastian Koenig",
+    "version": (0, 1, 1),
     "blender": (2, 77, 0),
     "location": "Ctrl Space",
     "warning": "",
@@ -20,6 +20,7 @@ from bpy.props import (
         EnumProperty,
         )
 
+
 # Pie Manipulator Mode - Ctrl Space
 class VIEW3D_manipulator_set_of(Operator):
     bl_label = "Set Manipulator"
@@ -36,7 +37,6 @@ class VIEW3D_manipulator_set_of(Operator):
     def execute(self, context):
         # show manipulator if user selects an option
         context.space_data.show_manipulator = True
-
         context.space_data.transform_manipulators = {self.type}
 
         return {'FINISHED'}
@@ -45,6 +45,7 @@ class VIEW3D_manipulator_set_of(Operator):
 class VIEW3D_PIE_manipulator_of(Menu):
     bl_label = "Manipulator"
     bl_idname = "view3d.manipulator_of"
+
     def draw(self, context):
         layout = self.layout
 
@@ -54,13 +55,15 @@ class VIEW3D_PIE_manipulator_of(Menu):
         pie.operator("view3d.manipulator_set", icon='MAN_SCALE', text="Scale").type = 'SCALE'


@@ Diff output truncated at 10240 characters. @@



More information about the Bf-extensions-cvs mailing list