[Bf-extensions-cvs] [e1fadee] master: Pie Menus: Version bunmp, author and wiki info

Sebastian Koenig noreply at git.blender.org
Mon Feb 16 11:32:46 CET 2015


Commit: e1fadee6e7033013fa1df9ec99eb191c80639601
Author: Sebastian Koenig
Date:   Mon Feb 16 11:31:20 2015 +0100
Branches: master
https://developer.blender.org/rBACe1fadee6e7033013fa1df9ec99eb191c80639601

Pie Menus: Version bunmp, author and wiki info

Raised the version to 1.02 due to new funcionality (tracking pies),
added self as author and added link to wiki page

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

A	ui_pie_menus_official.py

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

diff --git a/ui_pie_menus_official.py b/ui_pie_menus_official.py
new file mode 100644
index 0000000..2914fc8
--- /dev/null
+++ b/ui_pie_menus_official.py
@@ -0,0 +1,434 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+# <pep8 compliant>
+
+bl_info = {
+    "name": "Pie Menus Official",
+    "author": "Antony Riakiotakis, Sebastian Koenig",
+    "version": (1, 0, 2),
+    "blender": (2, 71, 4),
+    "description": "Enable official Pie Menus in Blender",
+    "category": "User Interface",
+    "wiki_url": "http://wiki.blender.org/index.php/Doc:2.6/Manual/Interface/Pie_Menus"
+}
+
+
+import bpy
+from bpy.types import Menu, Operator
+from bpy.props import EnumProperty
+
+
+class VIEW3D_PIE_object_mode(Menu):
+    bl_label = "Mode"
+
+    def draw(self, context):
+        layout = self.layout
+
+        pie = layout.menu_pie()
+        pie.operator_enum("OBJECT_OT_mode_set", "mode")
+
+
+class VIEW3D_PIE_view_more(Menu):
+    bl_label = "More"
+
+    def draw(self, context):
+        layout = self.layout
+
+        pie = layout.menu_pie()
+        pie.operator("VIEW3D_OT_view_persportho", text="Persp/Ortho", icon='RESTRICT_VIEW_OFF')
+        pie.operator("VIEW3D_OT_camera_to_view")
+        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):
+    bl_label = "View"
+
+    def draw(self, context):
+        layout = self.layout
+
+        pie = layout.menu_pie()
+        pie.operator_enum("VIEW3D_OT_viewnumpad", "type")
+        pie.operator("wm.call_menu_pie", text="More", icon='PLUS').name = "VIEW3D_PIE_view_more"
+
+
+class VIEW3D_PIE_shade(Menu):
+    bl_label = "Shade"
+
+    def draw(self, context):
+        layout = self.layout
+
+        pie = layout.menu_pie()
+        pie.prop(context.space_data, "viewport_shade", expand=True)
+
+        if context.active_object:
+            if(context.mode == 'EDIT_MESH'):
+                pie.operator("MESH_OT_faces_shade_smooth")
+                pie.operator("MESH_OT_faces_shade_flat")
+            else:
+                pie.operator("OBJECT_OT_shade_smooth")
+                pie.operator("OBJECT_OT_shade_flat")
+
+
+class VIEW3D_manipulator_set(Operator):
+    bl_label = "Set Manipulator"
+    bl_idname = "view3d.manipulator_set"
+
+    type = EnumProperty(
+            name="Type",
+            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
+        context.space_data.show_manipulator = True
+
+        context.space_data.transform_manipulators = {self.type}
+
+        return {'FINISHED'}
+
+
+class VIEW3D_PIE_manipulator(Menu):
+    bl_label = "Manipulator"
+
+    def draw(self, context):
+        layout = self.layout
+
+        pie = layout.menu_pie()
+        pie.operator("view3d.manipulator_set", icon='MAN_TRANS', text="Translate").type = 'TRANSLATE'
+        pie.operator("view3d.manipulator_set", icon='MAN_ROT', text="Rotate").type = 'ROTATE'
+        pie.operator("view3d.manipulator_set", icon='MAN_SCALE', text="Scale").type = 'SCALE'
+        pie.prop(context.space_data, "show_manipulator")
+
+
+class VIEW3D_PIE_pivot(Menu):
+    bl_label = "Pivot"
+
+    def draw(self, context):
+        layout = self.layout
+
+        pie = layout.menu_pie()
+        pie.prop(context.space_data, "pivot_point", expand=True)
+        if context.active_object.mode == 'OBJECT':
+            pie.prop(context.space_data, "use_pivot_point_align", text="Center Points")
+
+
+class VIEW3D_PIE_snap(Menu):
+    bl_label = "Snapping"
+
+    def draw(self, context):
+        layout = self.layout
+
+        toolsettings = context.tool_settings
+        pie = layout.menu_pie()
+        pie.prop(toolsettings, "snap_element", expand=True)
+        pie.prop(toolsettings, "use_snap")
+
+
+class CLIP_PIE_refine_pie(Menu):
+    # Refinement Options
+    bl_label = "Refine Intrinsics"
+
+    def draw(self, context):
+        clip = context.space_data.clip
+        settings = clip.tracking.settings
+
+        layout = self.layout
+        pie = layout.menu_pie()
+
+        pie.prop(settings, "refine_intrinsics", expand=True)
+
+
+class CLIP_PIE_geometry_reconstruction(Menu):
+    # Geometry Reconstruction
+    bl_label = "Reconstruction"
+
+    def draw(self, context):
+        layout = self.layout
+        pie = layout.menu_pie()
+
+        pie.operator("clip.bundles_to_mesh", icon='MESH_DATA')
+        pie.operator("clip.track_to_empty", icon='EMPTY_DATA')
+
+
+class CLIP_PIE_proxy_pie(Menu):
+    # Proxy Controls
+    bl_label = "Proxy Size"
+
+    def draw(self, context):
+        space = context.space_data
+
+        layout = self.layout
+        pie = layout.menu_pie()
+
+        pie.prop(space.clip, "use_proxy", text="Use Proxy")
+        pie.prop(space.clip_user, "proxy_render_size", expand=True)
+
+
+class CLIP_PIE_display_pie(Menu):
+    # Display Options
+    bl_label = "Marker Display"
+
+    def draw(self, context):
+        space = context.space_data
+
+        layout = self.layout
+        pie = layout.menu_pie()
+
+        pie.prop(space, "show_names", text="Show Track Info", icon='WORDWRAP_ON')
+        pie.prop(space, "show_disabled", text="Show Disabled Tracks", icon='VISIBLE_IPO_ON')
+        pie.prop(space, "show_marker_search", text="Display Search Area", icon='VIEWZOOM')
+        pie.prop(space, "show_marker_pattern", text="Display Pattern Area", icon='BORDERMOVE')
+
+
+class CLIP_PIE_marker_pie(Menu):
+    # Settings for the individual markers
+    bl_label = "Marker Settings"
+
+    def draw(self, context):
+        clip = context.space_data.clip
+        track_active = clip.tracking.tracks.active
+
+        layout = self.layout
+        pie = layout.menu_pie()
+
+        prop = pie.operator("wm.context_set_enum", text="Loc", icon='OUTLINER_DATA_EMPTY')
+        prop.data_path = "space_data.clip.tracking.tracks.active.motion_model"
+        prop.value = "Loc"
+        prop = pie.operator("wm.context_set_enum", text="Affine", icon='OUTLINER_DATA_LATTICE')
+        prop.data_path = "space_data.clip.tracking.tracks.active.motion_model"
+        prop.value = "Affine"
+
+        pie.operator("clip.track_settings_to_track", icon='COPYDOWN')
+        pie.operator("clip.track_settings_as_default", icon='SETTINGS')
+
+        if track_active:
+            pie.prop(track_active, "use_normalization", text="Normalization")
+            pie.prop(track_active, "use_brute", text="Use Brute Force")
+            pie.prop(track_active, "use_blue_channel", text="Blue Channel")
+
+            if track_active.pattern_match == "PREV_FRAME":
+                prop = pie.operator("wm.context_set_enum", text="Match Previous", icon='KEYINGSET')
+                prop.data_path = "space_data.clip.tracking.tracks.active.pattern_match"
+                prop.value = 'KEYFRAME'
+            else:
+                prop = pie.operator("wm.context_set_enum", text="Match Keyframe", icon='KEY_HLT')
+                prop.data_pat = "space_data.clip.tracking.tracks.active.pattern_match"
+                prop.value = 'PREV_FRAME'
+
+
+class CLIP_PIE_tracking_pie(Menu):
+    # Tracking Operators
+    bl_label = "Tracking"
+
+    def draw(self, context):
+        layout = self.layout
+        pie = layout.menu_pie()
+
+        prop = pie.operator("clip.track_markers", icon='PLAY_REVERSE')
+        prop.backwards = True
+        prop.sequence = True
+        prop = pie.operator("clip.track_markers", icon='PLAY')
+        prop.backwards = False
+        prop.sequence = True
+
+        pie.operator("clip.disable_markers", icon='RESTRICT_VIEW_ON')
+        pie.operator("clip.detect_features", icon='ZOOM_SELECTED')
+
+        pie.operator("clip.clear_track_path", icon='BACK').action = 'UPTO'
+        pie.operator("clip.clear_track_path", icon='FORWARD').action = 'REMAINED'
+
+        pie.operator("clip.refine_markers", icon='LOOP_BACK').backwards = True
+        pie.operator("clip.refine_markers", icon='LOOP_FORWARDS').backwards = False
+
+
+class CLIP_PIE_clipsetup_pie(Menu):
+    # Setup the clip display options
+    bl_label = "Clip and Display Setup"
+
+    def draw(self, context):
+        space = context.space_data
+
+        layout = self.layout
+        pie = layout.menu_pie()
+
+        pie.operator("clip.reload", text="Reload Footage", icon='FILE_REFRESH')
+        pie.operator("clip.prefetch", text="Prefetch Footage", icon='LOOP_FORWARDS')
+
+        pie.prop(space, "use_mute_footage", text="Mute Footage", icon='MUTE_IPO_ON')
+        pie.prop(space.clip_user, "use_render_undistorted", text="Render Undistorted")
+        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"
+
+
+class CLIP_PIE_solver_pie(Menu):
+    # Operators to solve the scene
+    bl_label = "Solving"
+
+    def draw(self, context):


@@ Diff output truncated at 10240 characters. @@



More information about the Bf-extensions-cvs mailing list