[Bf-extensions-cvs] [bd071806] master: viewport pies: proportional edit and save defaults pies

meta-androcto noreply at git.blender.org
Wed Dec 11 08:46:41 CET 2019


Commit: bd0718063f6ab86296d715135ee7cff3f66ecdb8
Author: meta-androcto
Date:   Wed Dec 11 18:46:08 2019 +1100
Branches: master
https://developer.blender.org/rBAbd0718063f6ab86296d715135ee7cff3f66ecdb8

viewport pies: proportional edit and save defaults pies

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

M	space_view3d_pie_menus/__init__.py
A	space_view3d_pie_menus/pie_defaults_menu.py
A	space_view3d_pie_menus/pie_proportional_menu.py

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

diff --git a/space_view3d_pie_menus/__init__.py b/space_view3d_pie_menus/__init__.py
index e211e1fa..92e7e74e 100644
--- a/space_view3d_pie_menus/__init__.py
+++ b/space_view3d_pie_menus/__init__.py
@@ -58,6 +58,8 @@ sub_modules_names = (
     "pie_animation_menu",
     "pie_save_open_menu",
     "pie_editor_switch_menu",
+    "pie_defaults_menu",
+    "pie_proportional_menu",
     )
 
 
diff --git a/space_view3d_pie_menus/pie_defaults_menu.py b/space_view3d_pie_menus/pie_defaults_menu.py
new file mode 100644
index 00000000..cda67e7c
--- /dev/null
+++ b/space_view3d_pie_menus/pie_defaults_menu.py
@@ -0,0 +1,100 @@
+# ##### 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": "Hotkey: 'Ctrl U'",
+    "description": "Save/Open & File Menus",
+    "blender": (2, 80, 0),
+    "location": "All Editors",
+    "warning": "",
+    "wiki_url": "",
+    "category": "Interface"
+    }
+
+import bpy
+from bpy.types import (
+        Menu,
+        Operator,
+        )
+import os
+
+
+# Pie Save/Open
+class PIE_MT_Load_Defaults(Menu):
+    bl_idname = "PIE_MT_loaddefaults"
+    bl_label = "Save Defaults"
+
+    def draw(self, context):
+        layout = self.layout
+        prefs = context.preferences
+        pie = layout.menu_pie()
+        # 4 - LEFT
+        pie.operator("wm.read_factory_settings", text="Load Factory Settings", icon='IMPORT')
+        # 6 - RIGHT
+        pie.operator("wm.read_factory_userpref", text="Load Factory Preferences", icon='RECOVER_LAST')
+        # 2 - BOTTOM
+        pie.operator("wm.read_userpref", text="Revert to Saved Prefs", icon='NONE')
+        # 8 - TOP
+        pie.operator("wm.save_homefile", text="Save StartUp File", icon='FILE_NEW')
+        # 7 - TOP - LEFT
+        pie.prop(prefs, "use_preferences_save", text="Auto-Save Preferences", icon='LINK_BLEND')
+        # 9 - TOP - RIGHT
+        pie.operator("wm.save_userpref", text="Save User Preferences", icon='NONE')
+        # 1 - BOTTOM - LEFT
+        pie.separator()
+        # 3 - BOTTOM - RIGHT
+        pie.separator()
+
+
+
+classes = (
+    PIE_MT_Load_Defaults,
+    )
+
+addon_keymaps = []
+
+
+def register():
+    for cls in classes:
+        bpy.utils.register_class(cls)
+
+    wm = bpy.context.window_manager
+    if wm.keyconfigs.addon:
+        # Save/Open/...
+        km = wm.keyconfigs.addon.keymaps.new(name='Window')
+        kmi = km.keymap_items.new('wm.call_menu_pie', 'U', 'PRESS', ctrl=True)
+        kmi.properties.name = "PIE_MT_loaddefaults"
+        addon_keymaps.append((km, kmi))
+
+
+def unregister():
+    for cls in classes:
+        bpy.utils.unregister_class(cls)
+
+    wm = bpy.context.window_manager
+    kc = wm.keyconfigs.addon
+    if kc:
+        for km, kmi in addon_keymaps:
+            km.keymap_items.remove(kmi)
+    addon_keymaps.clear()
+
+
+if __name__ == "__main__":
+    register()
diff --git a/space_view3d_pie_menus/pie_proportional_menu.py b/space_view3d_pie_menus/pie_proportional_menu.py
new file mode 100644
index 00000000..55d91763
--- /dev/null
+++ b/space_view3d_pie_menus/pie_proportional_menu.py
@@ -0,0 +1,457 @@
+# ##### 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": "Hotkey: 'O'",
+    "description": "Proportional Object/Edit Tools",
+    "author": "pitiwazou, meta-androcto",
+    "version": (0, 1, 1),
+    "blender": (2, 80, 0),
+    "location": "3D View Object & Edit modes",
+    "warning": "",
+    "wiki_url": "",
+    "category": "Proportional Edit Pie"
+    }
+
+import bpy
+from bpy.types import (
+        Menu,
+        Operator,
+        )
+
+
+# Proportional Edit Object
+class PIE_OT_ProportionalEditObj(Operator):
+    bl_idname = "proportional_obj.active"
+    bl_label = "Proportional Edit Object"
+    bl_options = {'REGISTER', 'UNDO'}
+
+    def execute(self, context):
+        ts = context.tool_settings
+
+        if ts.use_proportional_edit_objects is True:
+            ts.use_proportional_edit_objects = False
+
+        elif ts.use_proportional_edit_objects is False:
+            ts.use_proportional_edit_objects = True
+
+        return {'FINISHED'}
+
+
+class PIE_OT_ProportionalSmoothObj(Operator):
+    bl_idname = "proportional_obj.smooth"
+    bl_label = "Proportional Smooth Object"
+    bl_options = {'REGISTER', 'UNDO'}
+
+    def execute(self, context):
+        ts = context.tool_settings
+        if ts.use_proportional_edit_objects is False:
+            ts.use_proportional_edit_objects = True
+            ts.proportional_edit_falloff = 'SMOOTH'
+
+        if ts.proportional_edit_falloff != 'SMOOTH':
+            ts.proportional_edit_falloff = 'SMOOTH'
+        return {'FINISHED'}
+
+
+class PIE_OT_ProportionalSphereObj(Operator):
+    bl_idname = "proportional_obj.sphere"
+    bl_label = "Proportional Sphere Object"
+    bl_options = {'REGISTER', 'UNDO'}
+
+    def execute(self, context):
+        ts = context.tool_settings
+        if ts.use_proportional_edit_objects is False:
+            ts.use_proportional_edit_objects = True
+            ts.proportional_edit_falloff = 'SPHERE'
+
+        if ts.proportional_edit_falloff != 'SPHERE':
+            ts.proportional_edit_falloff = 'SPHERE'
+        return {'FINISHED'}
+
+
+class PIE_OT_ProportionalRootObj(Operator):
+    bl_idname = "proportional_obj.root"
+    bl_label = "Proportional Root Object"
+    bl_options = {'REGISTER', 'UNDO'}
+
+    def execute(self, context):
+        ts = context.tool_settings
+        if ts.use_proportional_edit_objects is False:
+            ts.use_proportional_edit_objects = True
+            ts.proportional_edit_falloff = 'ROOT'
+
+        if ts.proportional_edit_falloff != 'ROOT':
+            ts.proportional_edit_falloff = 'ROOT'
+        return {'FINISHED'}
+
+
+class PIE_OT_ProportionalSharpObj(Operator):
+    bl_idname = "proportional_obj.sharp"
+    bl_label = "Proportional Sharp Object"
+    bl_options = {'REGISTER', 'UNDO'}
+
+    def execute(self, context):
+        ts = context.tool_settings
+        if ts.use_proportional_edit_objects is False:
+            ts.use_proportional_edit_objects = True
+            ts.proportional_edit_falloff = 'SHARP'
+
+        if ts.proportional_edit_falloff != 'SHARP':
+            ts.proportional_edit_falloff = 'SHARP'
+        return {'FINISHED'}
+
+
+class PIE_OT_ProportionalLinearObj(Operator):
+    bl_idname = "proportional_obj.linear"
+    bl_label = "Proportional Linear Object"
+    bl_options = {'REGISTER', 'UNDO'}
+
+    def execute(self, context):
+        ts = context.tool_settings
+        if ts.use_proportional_edit_objects is False:
+            ts.use_proportional_edit_objects = True
+            ts.proportional_edit_falloff = 'LINEAR'
+
+        if ts.proportional_edit_falloff != 'LINEAR':
+            ts.proportional_edit_falloff = 'LINEAR'
+        return {'FINISHED'}
+
+
+class PIE_OT_ProportionalConstantObj(Operator):
+    bl_idname = "proportional_obj.constant"
+    bl_label = "Proportional Constant Object"
+    bl_options = {'REGISTER', 'UNDO'}
+
+    def execute(self, context):
+        ts = context.tool_settings
+        if ts.use_proportional_edit_objects is False:
+            ts.use_proportional_edit_objects = True
+            ts.proportional_edit_falloff = 'CONSTANT'
+
+        if ts.proportional_edit_falloff != 'CONSTANT':
+            ts.proportional_edit_falloff = 'CONSTANT'
+        return {'FINISHED'}
+
+
+class PIE_OT_ProportionalRandomObj(Operator):
+    bl_idname = "proportional_obj.random"
+    bl_label = "Proportional Random Object"
+    bl_options = {'REGISTER', 'UNDO'}
+
+    def execute(self, context):
+        ts = context.tool_settings
+        if ts.use_proportional_edit_objects is False:
+            ts.use_proportional_edit_objects = True
+            ts.proportional_edit_falloff = 'RANDOM'
+
+        if ts.proportional_edit_falloff != 'RANDOM':
+            ts.proportional_edit_falloff = 'RANDOM'
+        return {'FINISHED'}
+
+class PIE_OT_ProportionalInverseSquareObj(Operator):
+    bl_idname = "proportional_obj.inversesquare"
+    bl_label = "Proportional Random Object"
+    bl_options = {'REGISTER', 'UNDO'}
+
+    def execute(self, context):
+        ts = context.tool_settings
+        if ts.use_proportional_edit_objects is False:
+            ts.use_proportional_edit_objects = True
+            ts.proportional_edit_falloff = 'INVERSE_SQUARE'
+
+        if ts.proportional_edit_falloff != 'INVERSE_SQUARE':
+            ts.proportional_edit_falloff = 'INVERSE_SQUARE'
+        return {'FINISHED'}
+
+
+# Proportional Edit Edit Mode
+class PIE_OT_ProportionalEditEdt(Operator):
+    bl_idname = "proportional_edt.active"
+    bl_label = "Proportional Edit E

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-extensions-cvs mailing list