[Bf-blender-cvs] [7327e15630d] sculpt-dev: Merge branch 'master' into sculpt-dev

Joseph Eagar noreply at git.blender.org
Sat Oct 2 12:22:31 CEST 2021


Commit: 7327e15630d0703a8cee1a27197c70d6ee1a2bc4
Author: Joseph Eagar
Date:   Sat Oct 2 03:22:22 2021 -0700
Branches: sculpt-dev
https://developer.blender.org/rB7327e15630d0703a8cee1a27197c70d6ee1a2bc4

Merge branch 'master' into sculpt-dev

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



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

diff --cc release/scripts/presets/keyconfig/keymap_data/blender_default.py
index 1e74f5b705d,35eb6490265..534cb8fb209
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@@ -19,10 -19,10 +19,8 @@@
  
  # ------------------------------------------------------------------------------
  # Configurable Parameters
--
  class Params:
--    __slots__ = (
--        "apple",
++    __slots__ = ("apple",
          "legacy",
          "select_mouse",
          "select_mouse_value",
@@@ -54,15 -56,40 +54,45 @@@
          "use_v3d_mmb_pan",
          # Alt click to access tools.
          "use_alt_click_leader",
 -        # Transform keys G/S/R activate tools instead of immediately transforming.
++        # Transform keys G/S/R activate tools instead of immediately
++        # transforming.
+         "use_key_activate_tools",
+         # Optionally use a modifier to access tools.
+         "tool_modifier",
          # Experimental option.
          "use_pie_click_drag",
          "v3d_tilde_action",
          # Alt-MMB axis switching 'RELATIVE' or 'ABSOLUTE' axis switching.
          "v3d_alt_mmb_drag_action",
-     )
  
-     def __init__(
-             self,
+         "use_file_single_click",
+         # Convenience variables:
+         # (derived from other settings).
+         #
+         # This case needs to be checked often,
 -        # Shorthand for: `(params.use_fallback_tool if params.select_mouse == 'RIGHT' else False)`.
++        # Shorthand for: `(params.use_fallback_tool if params.select_mouse ==
++        # 'RIGHT' else False)`.
+         "use_fallback_tool_rmb",
 -        # Shorthand for: `('CLICK' if params.use_fallback_tool_rmb else params.select_mouse_value)`.
++        # Shorthand for: `('CLICK' if params.use_fallback_tool_rmb else
++        # params.select_mouse_value)`.
+         "select_mouse_value_fallback",
 -        # Shorthand for: `('CLICK_DRAG' if params.use_pie_click_drag else 'PRESS')`
++        # Shorthand for: `('CLICK_DRAG' if params.use_pie_click_drag else
++        # 'PRESS')`
+         "pie_value",
+         # Shorthand for: `{"type": params.tool_tweak, "value": 'ANY'}`.
+         "tool_tweak_event",
 -        # Shorthand for: `{"type": params.tool_maybe_tweak, "value": params.tool_maybe_tweak_value}`.
++        # Shorthand for: `{"type": params.tool_maybe_tweak, "value":
++        # params.tool_maybe_tweak_value}`.
+         #
 -        # NOTE: This is typically used for active tool key-map items however it should never
 -        # be used for selection tools (the default box-select tool for example).
++        # NOTE: This is typically used for active tool key-map items however it
++        # should never
++        # be used for selection tools (the default box-select tool for
++        # example).
+         # Since this means with RMB select enabled in edit-mode for e.g.
+         # `Ctrl-LMB` would be caught by box-select instead of add/extrude.
 -        "tool_maybe_tweak_event",
 -    )
++        "tool_maybe_tweak_event",)
+ 
 -    def __init__(
 -            self,
++    def __init__(self,
              *,
              legacy=False,
              select_mouse='RIGHT',
@@@ -75,11 -104,13 +107,12 @@@
              use_v3d_tab_menu=False,
              use_v3d_shade_ex_pie=False,
              use_v3d_mmb_pan=False,
+             use_alt_tool_or_cursor=False,
              use_alt_click_leader=False,
              use_pie_click_drag=False,
+             use_file_single_click=False,
              v3d_tilde_action='VIEW',
--            v3d_alt_mmb_drag_action='RELATIVE',
--    ):
++            v3d_alt_mmb_drag_action='RELATIVE',):
          from sys import platform
          self.apple = (platform == 'darwin')
          self.legacy = legacy
@@@ -93,12 -127,27 +129,29 @@@
              self.action_tweak = 'EVT_TWEAK_L'
              self.tool_mouse = 'LEFTMOUSE'
              self.tool_tweak = 'EVT_TWEAK_L'
+             if use_alt_tool_or_cursor:
+                 self.tool_maybe_tweak = 'LEFTMOUSE'
+                 self.tool_maybe_tweak_value = 'PRESS'
+             else:
+                 self.tool_maybe_tweak = 'EVT_TWEAK_L'
+                 self.tool_maybe_tweak_value = 'ANY'
+ 
              self.context_menu_event = {"type": 'W', "value": 'PRESS'}
-             self.cursor_set_event = {"type": 'LEFTMOUSE', "value": 'CLICK'}
+ 
+             # Use the "cursor" functionality for RMB select.
+             if use_alt_tool_or_cursor:
+                 self.cursor_set_event = {"type": 'LEFTMOUSE', "value": 'PRESS', "alt": True}
+             else:
+                 self.cursor_set_event = {"type": 'LEFTMOUSE', "value": 'CLICK'}
+ 
              self.cursor_tweak_event = None
+             self.use_fallback_tool = use_fallback_tool
+             self.tool_modifier = {}
          else:
--            # Left mouse select uses Click event for selection. This is a little
--            # less immediate, but is needed to distinguish between click and tweak
++            # 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'
@@@ -148,8 -213,24 +217,22 @@@ NUMBERS_0 = ('ZERO', 'ONE', 'TWO', 'THR
  
  
  # ------------------------------------------------------------------------------
- # Keymap Item Wrappers
+ # Generic Utilities
 -
+ def _fallback_id(text, fallback):
+     if fallback:
+         return text + " (fallback)"
+     return text
+ 
+ 
+ def any_except(*args):
+     mod = {"ctrl": -1, "alt": -1, "shift": -1, "oskey": -1}
+     for arg in args:
+         del mod[arg]
+     return mod
  
+ 
+ # ------------------------------------------------------------------------------
+ # Keymap Item Wrappers
 -
  def op_menu(menu, kmi_args):
      return ("wm.call_menu", kmi_args, {"properties": [("name", menu)]})
  
@@@ -170,9 -251,19 +253,18 @@@ def op_tool_cycle(tool, kmi_args)
      return ("wm.tool_set_by_id", kmi_args, {"properties": [("name", tool), ("cycle", True)]})
  
  
+ # Utility to select between an operator and a tool,
+ # without having to duplicate key map item arguments.
+ def op_tool_optional(op_args, tool_pair, params):
+     if params.use_key_activate_tools:
+         kmi_args = op_args[1]
+         op_tool_fn, tool_id = tool_pair
+         return op_tool_fn(tool_id, kmi_args)
+     return op_args
+ 
+ 
  # ------------------------------------------------------------------------------
  # Keymap Templates
--
  def _template_items_context_menu(menu, key_args_primary):
      return [
          op_menu(menu, kmi_args)
@@@ -190,44 -281,52 +282,38 @@@ def _template_items_context_panel(menu
  def _template_space_region_type_toggle(*, toolbar_key=None, sidebar_key=None, channels_key=None):
      items = []
      if toolbar_key is not None:
--        items.append(
--            ("wm.context_toggle", toolbar_key,
--             {"properties": [("data_path", 'space_data.show_region_toolbar')]})
--        )
++        items.append(("wm.context_toggle", toolbar_key,
++             {"properties": [("data_path", 'space_data.show_region_toolbar')]}))
      if sidebar_key is not None:
--        items.append(
--            ("wm.context_toggle", sidebar_key,
--             {"properties": [("data_path", 'space_data.show_region_ui')]}),
--        )
++        items.append(("wm.context_toggle", sidebar_key,
++             {"properties": [("data_path", 'space_data.show_region_ui')]}),)
      if channels_key is not None:
--        items.append(
--            ("wm.context_toggle", channels_key,
--             {"properties": [("data_path", 'space_data.show_region_channels')]}),
--        )
++        items.append(("wm.context_toggle", channels_key,
++             {"properties": [("data_path", 'space_data.show_region_channels')]}),)
  
      return items
  
  
  def _template_items_select_actions(params, operator):
      if not params.use_select_all_toggle:
--        return [
--            (operator, {"type": 'A', "value": 'PRESS'}, {"properties": [("action", 'SELECT')]}),
++        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')]}),
--        ]
++            (operator, {"type": 'A', "value": 'DOUBLE_CLICK'}, {"properties": [("action", 'DESELECT')]}),]
      elif params.legacy:
          # Alt+A is for playback in legacy keymap.
--        return [
--            (operator, {"type": 'A', "value": 'PRESS'}, {"properties": [("action", 'TOGGLE')]}),
--            (operator, {"type": 'I', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'INVERT')]}),
--        ]
++        return [(operator, {"type": 'A', "value": 'PRESS'}, {"properties": [("action", 'TOGGLE')]}),
++            (operator, {"type": 'I', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'INVERT')]}),]
      else:
--        return [
--            (operator, {"type": 'A', "value": 'PRESS'}, {"properties": [("action", 'TOGGLE')]}),
++        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')]}),
--        ]
++            (operator, {"type": 'I', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'INVERT')]}),]
+ 
+ 
+ def _template_items_hide_reveal_actions(op_hide, op_reveal):
 -    return [
 -        (op_reveal, {"type": 'H', "value": 'PRESS', "alt": True}, None),
++    return [(op_reveal, {"type": 'H', "value": 'PRESS', "alt": True}, None),
+         (op_hide, {"t

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list