[Bf-blender-cvs] [d554502ad09] hair_object: Merge branch 'blender2.8' into hair_object
Lukas Tönne
noreply at git.blender.org
Sun Nov 25 11:29:48 CET 2018
Commit: d554502ad092faed6f91fd9e69303ff0b0afe580
Author: Lukas Tönne
Date: Sun Nov 25 10:29:39 2018 +0000
Branches: hair_object
https://developer.blender.org/rBd554502ad092faed6f91fd9e69303ff0b0afe580
Merge branch 'blender2.8' into hair_object
===================================================================
===================================================================
diff --cc release/scripts/presets/keyconfig/keymap_data/blender_default.py
index 00000000000,2b83b03f322..51ec4c85732
mode 000000,100644..100644
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@@ -1,0 -1,5987 +1,6018 @@@
+ # ##### 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 #####
+
+
+ # ------------------------------------------------------------------------------
+ # Configurable Parameters
+
+ class Params:
+ __slots__ = (
+ "apple",
+ "legacy",
+ "select_mouse",
+ "select_mouse_value",
+ "select_tweak",
+ "action_mouse",
+ "action_tweak",
+ "tool_mouse",
+ "tool_tweak",
+ "context_menu_event",
+ "cursor_set_event",
+ "cursor_tweak_event",
+
+ # User preferences.
+ #
+ # Swap 'Space/Shift-Space'.
+ "spacebar_action",
+ # Key toggles selection with 'A'.
+ "use_select_all_toggle",
+ # Use pie menu for tab by default (swap 'Tab/Ctrl-Tab').
+ "use_v3d_tab_menu",
+ # Use extended pie menu for shading.
+ "use_v3d_shade_ex_pie"
+ )
+
+ def __init__(
+ self,
+ *,
+ legacy=False,
+ select_mouse='RIGHT',
+
+ # User preferences.
+ spacebar_action='TOOL',
+ use_select_all_toggle=False,
+ use_pie_on_tab=False,
+ use_v3d_tab_menu=False,
+ use_v3d_shade_ex_pie=False,
+ ):
+ import platform
+
+ self.apple = platform.system() == 'Darwin'
+ self.legacy = legacy
+
+ if select_mouse == 'RIGHT':
+ # Right mouse select.
+ self.select_mouse = 'RIGHTMOUSE'
+ self.select_mouse_value = 'PRESS'
+ self.select_tweak = 'EVT_TWEAK_R'
+ self.action_mouse = 'LEFTMOUSE'
+ self.action_tweak = 'EVT_TWEAK_L'
+ self.tool_mouse = 'LEFTMOUSE'
+ self.tool_tweak = 'EVT_TWEAK_L'
+ self.context_menu_event = {"type": 'W', "value": 'PRESS'}
+ self.cursor_set_event = {"type": 'LEFTMOUSE', "value": 'CLICK'}
+ self.cursor_tweak_event = None
+ else:
+ # Left mouse select uses Click event for selection. This is a little
+ # less immediate, but is needed to distinguish between click and tweak
+ # events on the same mouse buttons.
+ self.select_mouse = 'LEFTMOUSE'
+ self.select_mouse_value = 'CLICK'
+ self.select_tweak = 'EVT_TWEAK_L'
+ self.action_mouse = 'RIGHTMOUSE'
+ self.action_tweak = 'EVT_TWEAK_R'
+ self.tool_mouse = 'LEFTMOUSE'
+ self.tool_tweak = 'EVT_TWEAK_L'
+
+ if self.legacy:
+ self.context_menu_event = {"type": 'W', "value": 'PRESS'}
+ else:
+ self.context_menu_event = {"type": 'RIGHTMOUSE', "value": 'PRESS'}
+
+ self.cursor_set_event = {"type": 'RIGHTMOUSE', "value": 'PRESS', "shift": True}
+ self.cursor_tweak_event = {"type": 'EVT_TWEAK_R', "value": 'ANY', "shift": True}
+
+ # User preferences
+ self.spacebar_action = spacebar_action
+ self.use_select_all_toggle = use_select_all_toggle
+ self.use_v3d_tab_menu = use_v3d_tab_menu
+ self.use_v3d_shade_ex_pie = use_v3d_shade_ex_pie
+
+
+ # ------------------------------------------------------------------------------
+ # Constants
+
+
+ # Physical layout.
+ NUMBERS_1 = ('ONE', 'TWO', 'THREE', 'FOUR', 'FIVE', 'SIX', 'SEVEN', 'EIGHT', 'NINE', 'ZERO')
+ # Numeric order.
+ NUMBERS_0 = ('ZERO', 'ONE', 'TWO', 'THREE', 'FOUR', 'FIVE', 'SIX', 'SEVEN', 'EIGHT', 'NINE')
+
+
+ # ------------------------------------------------------------------------------
+ # Keymap Item Wrappers
+
+ def op_menu(menu, kmi_args):
+ return ("wm.call_menu", kmi_args, {"properties": [("name", menu)]})
+
+
+ def op_menu_pie(menu, kmi_args):
+ return ("wm.call_menu_pie", kmi_args, {"properties": [("name", menu)]})
+
+
+ def op_panel(menu, kmi_args, kmi_data=()):
+ return ("wm.call_panel", kmi_args, {"properties": [("name", menu), *kmi_data]})
+
+
+ def op_tool(tool, kmi_args):
+ return ("wm.tool_set_by_name", kmi_args, {"properties": [("name", tool)]})
+
+
+ # ------------------------------------------------------------------------------
+ # Keymap Templates
+
+ def _template_items_select_actions(params, operator):
+ if not params.use_select_all_toggle:
+ return [
+ (operator, {"type": 'A', "value": 'PRESS'}, {"properties": [("action", 'SELECT')]}),
+ (operator, {"type": 'A', "value": 'PRESS', "alt": True}, {"properties": [("action", 'DESELECT')]}),
+ (operator, {"type": 'I', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'INVERT')]}),
+ (operator, {"type": 'A', "value": 'DOUBLE_CLICK'}, {"properties": [("action", 'DESELECT')]}),
+ ]
+ else:
+ return [
+ (operator, {"type": 'A', "value": 'PRESS'}, {"properties": [("action", 'TOGGLE')]}),
+ (operator, {"type": 'A', "value": 'PRESS', "alt": True}, {"properties": [("action", 'DESELECT')]}),
+ (operator, {"type": 'I', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'INVERT')]}),
+ ]
+
+
+ def _template_items_object_subdivision_set():
+ return [
+ ("object.subdivision_set",
+ {"type": NUMBERS_0[i], "value": 'PRESS', "ctrl": True},
+ {"properties": [("level", i)]})
+ for i in range(6)
+ ]
+
+
+ def _template_items_gizmo_tweak_value():
+ return [
+ ("gizmogroup.gizmo_tweak", {"type": 'LEFTMOUSE', "value": 'PRESS', "any": True}, None),
+ ]
+
+
+ def _template_items_gizmo_tweak_modal():
+ return [
+ ("CANCEL", {"type": 'ESC', "value": 'PRESS', "any": True}, None),
+ ("CANCEL", {"type": 'RIGHTMOUSE', "value": 'PRESS', "any": True}, None),
+ ("CONFIRM", {"type": 'RET', "value": 'PRESS', "any": True}, None),
+ ("CONFIRM", {"type": 'NUMPAD_ENTER', "value": 'PRESS', "any": True}, None),
+ ("PRECISION_ON", {"type": 'RIGHT_SHIFT', "value": 'PRESS', "any": True}, None),
+ ("PRECISION_OFF", {"type": 'RIGHT_SHIFT', "value": 'RELEASE', "any": True}, None),
+ ("PRECISION_ON", {"type": 'LEFT_SHIFT', "value": 'PRESS', "any": True}, None),
+ ("PRECISION_OFF", {"type": 'LEFT_SHIFT', "value": 'RELEASE', "any": True}, None),
+ ("SNAP_ON", {"type": 'RIGHT_CTRL', "value": 'PRESS', "any": True}, None),
+ ("SNAP_OFF", {"type": 'RIGHT_CTRL', "value": 'RELEASE', "any": True}, None),
+ ("SNAP_ON", {"type": 'LEFT_CTRL', "value": 'PRESS', "any": True}, None),
+ ("SNAP_OFF", {"type": 'LEFT_CTRL', "value": 'RELEASE', "any": True}, None),
+ ]
+
+
+ def _template_items_editmode_mesh_select_mode():
+ return [
+ (
+ "mesh.select_mode",
+ {"type": k, "value": 'PRESS', **key_expand, **key_extend},
+ {"properties": [*prop_extend, *prop_expand, ("type", e)]}
+ )
+ for key_expand, prop_expand in (({}, ()), ({"ctrl": True}, (("use_expand", True),)))
+ for key_extend, prop_extend in (({}, ()), ({"shift": True}, (("use_extend", True),)))
+ for k, e in (('ONE', 'VERT'), ('TWO', 'EDGE'), ('THREE', 'FACE'))
+ ]
+
+
+ def _template_items_proportional_editing(*, connected=False):
+ return [
+ op_menu_pie("VIEW3D_MT_proportional_editing_falloff_pie", {"type": 'O', "value": 'PRESS', "shift": True}),
+ ("wm.context_toggle_enum", {"type": 'O', "value": 'PRESS'},
+ {"properties": [("data_path", 'tool_settings.proportional_edit'), ("value_1", 'DISABLED'), ("value_2", 'ENABLED')]}),
+ *(() if not connected else (
+ ("wm.context_toggle_enum", {"type": 'O', "value": 'PRESS', "alt": True},
+ {"properties": [("data_path", 'tool_settings.proportional_edit'), ("value_1", 'DISABLED'), ("value_2", 'CONNECTED')]}),
+ ))
+ ]
+
+
+ # Tool System Templates
+
+ def _template_items_tool_select_actions(operator, *, type, value):
+ kmi_args = {"type": type, "value": value}
+ return [
+ (operator, kmi_args,
+ {"properties": [("mode", 'SET')]}),
+ (operator, {**kmi_args, "shift": True},
+ {"properties": [("mode", 'ADD')]}),
+ (operator, {**kmi_args, "ctrl": True},
+ {"properties": [("mode", 'SUB')]}),
+ (operator, {**kmi_args, "shift": True, "ctrl": True},
+ {"properties": [("mode", 'AND')]}),
+ ]
+
+
+ def _template_items_tool_select_actions_simple(operator, *, type, value):
+ kmi_args = {"type": type, "value": value}
+ return [
+ (operator, kmi_args,
+ {"properties": [("mode", 'SET')]}),
+ (operator, {**kmi_args, "shift": True},
+ {"properties": [("mode", 'ADD')]}),
+ (operator, {**kmi_args, "ctrl": True},
+ {"properties": [("mode", 'SUB')]}),
+ ]
+
+ # ------------------------------------------------------------------------------
+ # Window, Screen, Areas, Regions
+
+ def km_window(params):
+ items = []
+ keymap = (
+ "Window",
+ {"space_type": 'EMPTY
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list