WM: remove interaction presets
authorCampbell Barton <ideasman42@gmail.com>
Mon, 19 Nov 2018 21:08:46 +0000 (08:08 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 19 Nov 2018 21:11:46 +0000 (08:11 +1100)
These only exposed a few options, which didn't end up helping
much to make Blender's key-map fit the behavior of other applications.

release/scripts/presets/interaction/3dsmax.py [deleted file]
release/scripts/presets/interaction/blender.py [deleted file]
release/scripts/presets/interaction/maya.py [deleted file]
release/scripts/startup/bl_operators/presets.py
release/scripts/startup/bl_operators/wm.py
release/scripts/startup/bl_ui/space_userpref.py
tests/python/bl_run_operators.py

diff --git a/release/scripts/presets/interaction/3dsmax.py b/release/scripts/presets/interaction/3dsmax.py
deleted file mode 100644 (file)
index 681aa4a..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-# Configuration 3dsmax
-import bpy
-
-bpy.context.user_preferences.edit.use_drag_immediately = False
-bpy.context.user_preferences.edit.use_insertkey_xyz_to_rgb = False
-bpy.context.user_preferences.view.use_auto_perspective = True
-bpy.context.user_preferences.view.use_quit_dialog = True
-bpy.context.user_preferences.inputs.select_mouse = 'LEFT'
-bpy.context.user_preferences.inputs.view_zoom_method = 'DOLLY'
-bpy.context.user_preferences.inputs.view_zoom_axis = 'VERTICAL'
-bpy.context.user_preferences.inputs.view_rotate_method = 'TURNTABLE'
-bpy.context.user_preferences.inputs.invert_mouse_zoom = False
diff --git a/release/scripts/presets/interaction/blender.py b/release/scripts/presets/interaction/blender.py
deleted file mode 100644 (file)
index 0c79a3f..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-# Configuration Blender
-import bpy
-
-bpy.context.user_preferences.view.use_mouse_depth_cursor = False
-bpy.context.user_preferences.view.use_mouse_depth_navigate = False
-bpy.context.user_preferences.view.use_zoom_to_mouse = False
-bpy.context.user_preferences.view.use_rotate_around_active = False
-bpy.context.user_preferences.edit.use_drag_immediately = False
-bpy.context.user_preferences.edit.use_insertkey_xyz_to_rgb = False
-bpy.context.user_preferences.inputs.select_mouse = 'RIGHT'
-bpy.context.user_preferences.inputs.view_zoom_method = 'DOLLY'
-bpy.context.user_preferences.inputs.view_zoom_axis = 'VERTICAL'
-bpy.context.user_preferences.inputs.view_rotate_method = 'TURNTABLE'
-bpy.context.user_preferences.inputs.invert_mouse_zoom = False
diff --git a/release/scripts/presets/interaction/maya.py b/release/scripts/presets/interaction/maya.py
deleted file mode 100644 (file)
index 059669d..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-# Configuration Blender
-import bpy
-
-bpy.context.user_preferences.edit.use_drag_immediately = True
-bpy.context.user_preferences.edit.use_insertkey_xyz_to_rgb = False
-bpy.context.user_preferences.inputs.select_mouse = 'LEFT'
-bpy.context.user_preferences.inputs.view_zoom_method = 'DOLLY'
-bpy.context.user_preferences.inputs.view_zoom_axis = 'HORIZONTAL'
-bpy.context.user_preferences.inputs.view_rotate_method = 'TURNTABLE'
-bpy.context.user_preferences.inputs.invert_mouse_zoom = False
index 3e08bd1fe6f35fe3efc8edfa31e9515390ce085d..770133e2514c32e73e89eee0310e8d989cd94b7a 100644 (file)
@@ -441,32 +441,6 @@ class AddPresetHairDynamics(AddPresetBase, Operator):
     ]
 
 
-class AddPresetInteraction(AddPresetBase, Operator):
-    """Add or remove an Application Interaction Preset"""
-    bl_idname = "wm.interaction_preset_add"
-    bl_label = "Add Interaction Preset"
-    preset_menu = "USERPREF_MT_interaction_presets"
-
-    preset_defines = [
-        "user_preferences = bpy.context.user_preferences"
-    ]
-
-    preset_values = [
-        "user_preferences.edit.use_drag_immediately",
-        "user_preferences.edit.use_insertkey_xyz_to_rgb",
-        "user_preferences.inputs.invert_mouse_zoom",
-        "user_preferences.inputs.select_mouse",
-        "user_preferences.inputs.use_emulate_numpad",
-        "user_preferences.inputs.use_mouse_continuous",
-        "user_preferences.inputs.use_mouse_emulate_3_button",
-        "user_preferences.inputs.view_rotate_method",
-        "user_preferences.inputs.view_zoom_axis",
-        "user_preferences.inputs.view_zoom_method",
-    ]
-
-    preset_subdir = "interaction"
-
-
 class AddPresetTrackingCamera(AddPresetBase, Operator):
     """Add or remove a Tracking Camera Intrinsics Preset"""
     bl_idname = "clip.camera_preset_add"
@@ -748,7 +722,6 @@ classes = (
     AddPresetCloth,
     AddPresetFluid,
     AddPresetHairDynamics,
-    AddPresetInteraction,
     AddPresetInterfaceTheme,
     AddPresetKeyconfig,
     AddPresetNodeColor,
index 81183dd3fd62e77f45b03480e7f036106b21e4da..0f112d408c4e264d469a42e82f3d785120efb9de 100644 (file)
@@ -1419,49 +1419,6 @@ class WM_OT_keyconfig_activate(Operator):
             return {'CANCELLED'}
 
 
-class WM_OT_appconfig_default(Operator):
-    bl_idname = "wm.appconfig_default"
-    bl_label = "Default Application Configuration"
-
-    def execute(self, context):
-        import os
-
-        context.window_manager.keyconfigs.active = context.window_manager.keyconfigs.default
-
-        filepath = os.path.join(bpy.utils.preset_paths("interaction")[0], "blender.py")
-
-        if os.path.exists(filepath):
-            bpy.ops.script.execute_preset(
-                filepath=filepath,
-                menu_idname="USERPREF_MT_interaction_presets",
-            )
-
-        return {'FINISHED'}
-
-
-class WM_OT_appconfig_activate(Operator):
-    bl_idname = "wm.appconfig_activate"
-    bl_label = "Activate Application Configuration"
-
-    filepath: StringProperty(
-        subtype='FILE_PATH',
-    )
-
-    def execute(self, context):
-        import os
-        filepath = self.filepath
-        bpy.utils.keyconfig_set(filepath)
-        dirname, filename = os.path.split(filepath)
-        filepath = os.path.normpath(os.path.join(dirname, os.pardir, "interaction", filename))
-        if os.path.exists(filepath):
-            bpy.ops.script.execute_preset(
-                filepath=filepath,
-                menu_idname="USERPREF_MT_interaction_presets",
-            )
-
-        return {'FINISHED'}
-
-
 class WM_OT_sysinfo(Operator):
     """Generate system information, saved into a text file"""
 
@@ -2754,8 +2711,6 @@ classes = (
     WM_OT_addon_remove,
     WM_OT_addon_userpref_show,
     WM_OT_app_template_install,
-    WM_OT_appconfig_activate,
-    WM_OT_appconfig_default,
     WM_OT_context_collection_boolean_set,
     WM_OT_context_cycle_array,
     WM_OT_context_cycle_enum,
index a2f9c11b46d6a9e7ddc8e9bbe93d80ccb993385a..a14d1b892beccedae40ad78d3401676f1863e5b6 100644 (file)
@@ -73,25 +73,6 @@ class USERPREF_PT_tabs(Panel):
         layout.row().prop(userpref, "active_section", expand=True)
 
 
-class USERPREF_MT_interaction_presets(Menu):
-    bl_label = "Presets"
-    preset_subdir = "interaction"
-    preset_operator = "script.execute_preset"
-    draw = Menu.draw_preset
-
-
-class USERPREF_MT_appconfigs(Menu):
-    bl_label = "AppPresets"
-    preset_subdir = "keyconfig"
-    preset_operator = "wm.appconfig_activate"
-
-    def draw(self, context):
-        self.layout.operator("wm.appconfig_default", text="Blender (default)")
-
-        # now draw the presets
-        Menu.draw_preset(self, context)
-
-
 class USERPREF_PT_interface(Panel):
     bl_space_type = 'USER_PREFERENCES'
     bl_label = "Interface"
@@ -1089,13 +1070,6 @@ class USERPREF_PT_input(Panel):
 
         # General settings
         sub = layout.column()
-        sub.label(text="Presets:")
-        subrow = sub.row(align=True)
-
-        subrow.menu("USERPREF_MT_interaction_presets", text=bpy.types.USERPREF_MT_interaction_presets.bl_label)
-        subrow.operator("wm.interaction_preset_add", text="", icon='ADD')
-        subrow.operator("wm.interaction_preset_add", text="", icon='REMOVE').remove_active = True
-        sub.separator()
 
         sub.label(text="Mouse:")
         sub.prop(inputs, "use_mouse_emulate_3_button")
@@ -1608,8 +1582,6 @@ class USERPREF_PT_studiolight_specular(Panel, StudioLightPanelMixin):
 classes = (
     USERPREF_HT_header,
     USERPREF_PT_tabs,
-    USERPREF_MT_interaction_presets,
-    USERPREF_MT_appconfigs,
     USERPREF_PT_interface,
     USERPREF_PT_edit,
     USERPREF_PT_system,
index 9a3f801b04a67107f0677039f7755b746f89780f..f3b1ec2f4c217ca8ffae9833ae6829686f296cae 100644 (file)
@@ -81,7 +81,6 @@ op_blacklist = (
     "wm.operator_cheat_sheet",
     "wm.interface_theme_*",
     "wm.previews_ensure",       # slow - but harmless
-    "wm.appconfig_*",           # just annoying - but harmless
     "wm.keyitem_add",           # just annoying - but harmless
     "wm.keyconfig_activate",    # just annoying - but harmless
     "wm.keyconfig_preset_add",  # just annoying - but harmless