Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Poirier <theeth@yahoo.com>2011-03-28 01:45:37 +0400
committerMartin Poirier <theeth@yahoo.com>2011-03-28 01:45:37 +0400
commit47f9b496b130776220f53a33c2a7fad8ea7eb960 (patch)
treea94ce2a9cf5829c3704abf44f808044ac4fd59d8 /release/scripts
parent3598882f0ef630aac8c4810f04b28ab1ae64bd0d (diff)
[#24658] Switching to "maya" via interaction preset breaks when switching back
[#25045] User Preferences Input, not enough menu choices [#26525] Saving the Maya preset and another key configs Untangle keyconfig presets and interaction presets (maya keyconfig would set interaction setting, blender interaction would set keyconfig). Preset menu on slash screen now displays a list of available keyconfigs (as before) but will also set the correspondant interaction presets, if it exists)
Diffstat (limited to 'release/scripts')
-rw-r--r--release/scripts/presets/interaction/blender.py3
-rw-r--r--release/scripts/presets/interaction/maya.py10
-rw-r--r--release/scripts/presets/keyconfig/maya.py8
-rw-r--r--release/scripts/startup/bl_operators/wm.py32
-rw-r--r--release/scripts/startup/bl_ui/space_userpref.py12
5 files changed, 53 insertions, 12 deletions
diff --git a/release/scripts/presets/interaction/blender.py b/release/scripts/presets/interaction/blender.py
index 7ac9cd1eb0b..603158ed936 100644
--- a/release/scripts/presets/interaction/blender.py
+++ b/release/scripts/presets/interaction/blender.py
@@ -1,9 +1,6 @@
# Configuration Blender
import bpy
-wm = bpy.context.window_manager
-wm.keyconfigs.active = wm.keyconfigs['Blender']
-
bpy.context.user_preferences.view.use_mouse_auto_depth = False
bpy.context.user_preferences.view.use_zoom_to_mouse = False
bpy.context.user_preferences.view.use_rotate_around_active = False
diff --git a/release/scripts/presets/interaction/maya.py b/release/scripts/presets/interaction/maya.py
new file mode 100644
index 00000000000..4b4bb3c4f0a
--- /dev/null
+++ b/release/scripts/presets/interaction/maya.py
@@ -0,0 +1,10 @@
+# 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_wheel_zoom = True \ No newline at end of file
diff --git a/release/scripts/presets/keyconfig/maya.py b/release/scripts/presets/keyconfig/maya.py
index 4014920698d..87f4791ec51 100644
--- a/release/scripts/presets/keyconfig/maya.py
+++ b/release/scripts/presets/keyconfig/maya.py
@@ -376,11 +376,3 @@ kmi = km.keymap_items.new('mesh.select_all', 'SELECTMOUSE', 'CLICK')
kmi.properties.action = 'DESELECT'
wm.keyconfigs.active = kc
-
-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_wheel_zoom = True
diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py
index bb5f3a3a2a9..6ed46191099 100644
--- a/release/scripts/startup/bl_operators/wm.py
+++ b/release/scripts/startup/bl_operators/wm.py
@@ -859,6 +859,38 @@ class WM_OT_keyconfig_activate(bpy.types.Operator):
bpy.utils.keyconfig_set(self.filepath)
return {'FINISHED'}
+class WM_OT_appconfig_default(bpy.types.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(bpy.types.Operator):
+ bl_idname = "wm.appconfig_activate"
+ bl_label = "Activate Application Configuration"
+
+ filepath = StringProperty(name="File Path", maxlen=1024)
+
+ def execute(self, context):
+ import os
+ bpy.utils.keyconfig_set(self.filepath)
+
+ filepath = self.filepath.replace("keyconfig", "interaction")
+
+ if os.path.exists(filepath):
+ bpy.ops.script.execute_preset(filepath = filepath, menu_idname = "USERPREF_MT_interaction_presets")
+
+ return {'FINISHED'}
class WM_OT_sysinfo(bpy.types.Operator):
'''Generate System Info'''
diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index 67174db1d3d..59d9aef12f2 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -119,6 +119,16 @@ class USERPREF_MT_interaction_presets(bpy.types.Menu):
preset_operator = "script.execute_preset"
draw = bpy.types.Menu.draw_preset
+class USERPREF_MT_appconfigs(bpy.types.Menu):
+ bl_label = "AppPresets"
+ preset_subdir = "keyconfig"
+ preset_operator = "wm.appconfig_activate"
+
+ def draw(self, context):
+ props = self.layout.operator("wm.appconfig_default", text="Blender (default)")
+
+ # now draw the presets
+ bpy.types.Menu.draw_preset(self, context)
class USERPREF_MT_splash(bpy.types.Menu):
bl_label = "Splash"
@@ -134,7 +144,7 @@ class USERPREF_MT_splash(bpy.types.Menu):
# text = bpy.path.display_name(context.window_manager.keyconfigs.active.name)
# if not text:
# text = "Blender (default)"
- row.menu("USERPREF_MT_keyconfigs", text="Preset")
+ row.menu("USERPREF_MT_appconfigs", text="Preset")
class USERPREF_PT_interface(bpy.types.Panel):