[Bf-blender-cvs] [8a58f1f3bb6] sculpt-dev: Merge remote-tracking branch 'origin' into sculpt-dev

Joseph Eagar noreply at git.blender.org
Fri Apr 1 04:11:51 CEST 2022


Commit: 8a58f1f3bb641b3bec3613ae1e1b23b9320c1291
Author: Joseph Eagar
Date:   Thu Mar 31 19:11:32 2022 -0700
Branches: sculpt-dev
https://developer.blender.org/rB8a58f1f3bb641b3bec3613ae1e1b23b9320c1291

Merge remote-tracking branch 'origin' into sculpt-dev

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



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

diff --cc release/scripts/presets/keyconfig/keymap_data/blender_default.py
index dabf4aebcb5,b626f6a237a..5be16e047d2
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@@ -305,11 -327,29 +313,27 @@@ def _template_items_select_actions(para
  
  
  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, {"type": 'H', "value": 'PRESS'}, {"properties": [("unselected", False)]}),
 -        (op_hide, {"type": 'H', "value": 'PRESS', "shift": True}, {"properties": [("unselected", True)]}),
 -    ]
 +        (op_hide, {"type": 'H', "value": 'PRESS', "shift": True}, {"properties": [("unselected", True)]}),]
  
  
+ def _template_object_hide_collection_from_number_keys():
+     return [
+         ("object.hide_collection", {
+             "type": NUMBERS_1[i], "value": 'PRESS',
+             **({"shift": True} if extend else {}),
+             **({"alt": True} if add_10 else {}),
+         }, {"properties": [
+             ("collection_index", i + (11 if add_10 else 1)),
+             ("extend", extend),
+         ]})
+         for extend in (False, True)
+         for add_10 in (False, True)
+         for i in range(10)
+     ]
+ 
+ 
  def _template_items_object_subdivision_set():
      return [
          ("object.subdivision_set",
@@@ -1052,13 -1180,21 +1089,18 @@@ def km_outliner(params)
  
  def km_uv_editor(params):
      items = []
 -    keymap = (
 -        "UV Editor",
 +    keymap = ("UV Editor",
          {"space_type": 'EMPTY', "region_type": 'WINDOW'},
 -        {"items": items},
 -    )
 +        {"items": items},)
  
 -    items.extend([
 -        # Selection modes.
 +    items.extend([# Selection modes.
          *_template_items_uv_select_mode(params),
-         *_template_uv_select(type=params.select_mouse, value=params.select_mouse_value_fallback, legacy=params.legacy),
+         *_template_uv_select(
+             type=params.select_mouse,
+             value=params.select_mouse_value_fallback,
+             select_passthrough=params.use_tweak_select_passthrough,
+             legacy=params.legacy,
+         ),
          ("uv.mark_seam", {"type": 'E', "value": 'PRESS', "ctrl": True}, None),
          ("uv.select_loop",
           {"type": params.select_mouse, "value": params.select_mouse_value, "alt": True}, None),
@@@ -1347,10 -1518,14 +1389,13 @@@ def km_view3d(params)
          ("view3d.view_axis", {"type": 'NDOF_BUTTON_TOP', "value": 'PRESS', "shift": True},
           {"properties": [("type", 'TOP'), ("align_active", True)]}),
          # Selection.
 -        *_template_view3d_select(
 -            type=params.select_mouse,
 +        *_template_view3d_select(type=params.select_mouse,
              value=params.select_mouse_value_fallback,
-             legacy=params.legacy,),
-         op_tool_optional(("view3d.select_box", {"type": 'B', "value": 'PRESS'}, None),
+             legacy=params.legacy,
+             select_passthrough=params.use_tweak_select_passthrough,
+         ),
+         op_tool_optional(
+             ("view3d.select_box", {"type": 'B', "value": 'PRESS'}, None),
              (op_tool, "builtin.select_box"), params),
          ("view3d.select_lasso", {"type": params.action_mouse, "value": 'CLICK_DRAG', "ctrl": True},
           {"properties": [("mode", 'ADD')]}),
@@@ -4102,15 -4523,13 +4144,12 @@@ def km_object_mode(params)
          ("object.link_to_collection", {"type": 'M', "value": 'PRESS', "shift": True}, None),
          *_template_items_hide_reveal_actions("object.hide_view_set", "object.hide_view_clear"),
          ("object.hide_collection", {"type": 'H', "value": 'PRESS', "ctrl": True}, None),
-         *((("object.hide_collection",
-               {"type": NUMBERS_1[i], "value": 'PRESS', "any": True},
-               {"properties": [("collection_index", i + 1)]})
-              for i in range(10)
-              )),
-         *_template_items_context_menu("VIEW3D_MT_object_context_menu", params.context_menu_event),])
+         *_template_object_hide_collection_from_number_keys(),
+         *_template_items_context_menu("VIEW3D_MT_object_context_menu", params.context_menu_event),
+     ])
  
      if params.legacy:
 -        items.extend([
 -            ("object.select_mirror", {"type": 'M', "value": 'PRESS', "shift": True, "ctrl": True}, None),
 +        items.extend([("object.select_mirror", {"type": 'M', "value": 'PRESS', "shift": True, "ctrl": True}, None),
              ("object.parent_no_inverse_set", {"type": 'P', "value": 'PRESS', "shift": True, "ctrl": True}, None),
              ("object.track_set", {"type": 'T', "value": 'PRESS', "ctrl": True}, None),
              ("object.track_clear", {"type": 'T', "value": 'PRESS', "alt": True}, None),
@@@ -4265,38 -4686,17 +4304,41 @@@ def _template_paint_radial_control(pain
  
      return items
  
 +# Radial controls for the paint and sculpt modes.
 +def _template_paint_radial_control_channels(paint, rotation=False, secondary_rotation=False, color=False, zoom=False):
 +     items = []
 +
 +     items.extend([("wm.radial_control", {"type": 'F', "value": 'PRESS'},
 +          radial_control_properties_channels(paint, 'radius', 'use_unified_size', type="float", secondary_rotation=secondary_rotation, color=color, zoom=zoom)),
 +         ("wm.radial_control", {"type": 'F', "value": 'PRESS', "shift": True},
 +          radial_control_properties_channels(paint, 'strength', 'use_unified_strength', type="factor", secondary_rotation=secondary_rotation, color=color)),])
 +
 +     """
 +     if rotation:
 +         items.extend([
 +             ("wm.radial_control", {"type": 'F', "value": 'PRESS', "ctrl": True},
 +              radial_control_properties_channels(paint, 'texture_slot_angle', None, color=color)),
 +         ])
 +
 +     if secondary_rotation:
 +         items.extend([
 +             ("wm.radial_control", {"type": 'F', "value": 'PRESS', "ctrl": True, "alt": True},
 +              radial_control_properties_channels(paint, 'mask_texture_slot_angle', None, secondary_rotation=secondary_rotation, color=color)),
 +         ])
 +     """
 +
 +     return items
  
- def _template_view3d_select(*, type, value, legacy, exclude_mod=None):
+ def _template_view3d_select(*, type, value, legacy, select_passthrough, exclude_mod=None):
      # NOTE: `exclude_mod` is needed since we don't want this tool to exclude Control-RMB actions when this is used
      # as a tool key-map with RMB-select and `use_fallback_tool_rmb` is enabled. See T92467.
-     return [(
+     items = [(
          "view3d.select",
          {"type": type, "value": value, **{m: True for m in mods}},
-         {"properties": [(c, True) for c in props]},) for props, mods in ((("deselect_all",) if not legacy else (), ()),
+         {"properties": [(c, True) for c in props]},
+     ) for props, mods in (
+         ((("deselect_all", "select_passthrough") if select_passthrough else
+           ("deselect_all",)) if not legacy else (), ()),
          (("toggle",), ("shift",)),
          (("center", "object"), ("ctrl",)),
          (("enumerate",), ("alt",)),
@@@ -4306,9 -4706,22 +4348,20 @@@
          (("toggle", "center", "enumerate"), ("shift", "ctrl", "alt")),
      ) if exclude_mod is None or exclude_mod not in mods]
  
+     if select_passthrough and (value == 'PRESS'):
+         # Add an additional click item to de-select all other items,
+         # needed so pass-through is able to de-select other items.
+         items.append((
+             "view3d.select",
+             {"type": type, "value": 'CLICK'},
+             {"properties": [("deselect_all", True)]},
+         ))
+ 
+     return items
+ 
  
  def _template_view3d_gpencil_select(*, type, value, legacy, use_select_mouse=True):
 -    return [
 -        *([] if not use_select_mouse else [
 -            ("gpencil.select", {"type": type, "value": value},
 +    return [*([] if not use_select_mouse else [("gpencil.select", {"type": type, "value": value},
               {"properties": [("deselect_all", not legacy)]})]),
          ("gpencil.select", {"type": type, "value": value, "shift": True},
           {"properties": [("extend", True), ("toggle", True)]}),
@@@ -4316,14 -4729,31 +4369,30 @@@
          ("gpencil.select", {"type": type, "value": value, "alt": True},
           {"properties": [("entire_strokes", True)]}),
          ("gpencil.select", {"type": type, "value": value, "shift": True, "alt": True},
 -         {"properties": [("extend", True), ("entire_strokes", True)]}),
 -    ]
 +         {"properties": [("extend", True), ("entire_strokes", True)]}),]
  
  
- def _template_uv_select(*, type, value, legacy):
-     return [("uv.select", {"type": type, "value": value},
-          {"properties": [("deselect_all", not legacy)]}),
+ def _template_uv_select(*, type, value, select_passthrough, legacy):
+     items = [
+         ("uv.select", {"type": type, "value": value},
+          {"properties": [
+              *((("deselect_all", True),) if not legacy else ()),
+              *((("select_passthrough", True),) if select_passthrough else ()),
+          ]}),
          ("uv.select", {"type": type, "value": value, "shift": True},
-          {"properties": [("extend", True)]}),]
+          {"properties": [("toggle", True)]}),
+     ]
+ 
+     if select_passthrough and (value == 'PRESS'):
+         # Add an additional click item to de-select all other items,
+         # needed so pass-through is able to de-select other items.
+         items.append((
+             "uv.select",
+             {"type": type, "value": 'CLICK'},
+             {"properties": [("deselect_all", True)]},
+         ))
+ 
+     return items
  
  
  def _template_sequencer_generic_select(*, type, value, legacy):
@@@ -6636,9 -7605,10 +6714,9 @@@ def km_3d_view_tool_edit_gpencil_interp
  # Tool System (3D View, Grease Pencil, Sculpt)
  
  def km_3d_view_tool_sculpt_gpencil_select(params):
 -    return (
 -        "3D View Tool: Sculpt Gpencil, Tweak",
 +    return ("3D View Tool: Sculpt Gpen

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list