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:
authorCampbell Barton <ideasman42@gmail.com>2021-09-22 14:46:20 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-09-22 15:38:28 +0300
commitf7f5024c95ca72d9fee864ffda032723f343c605 (patch)
tree00020f5bddc3f9cba58f4e1a38cefceb6d867428
parent9add7c35cc6818b28842dd1bcdd3081d35d7623b (diff)
Keymap: support use_key_activate_tools for annotate
-rw-r--r--release/scripts/presets/keyconfig/keymap_data/blender_default.py39
1 files changed, 22 insertions, 17 deletions
diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
index 0ea3c1882c9..9dde1e024fd 100644
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@ -3258,7 +3258,7 @@ def km_animation_channels(params):
# Modes
-def km_grease_pencil(_params):
+def km_grease_pencil(params):
items = []
keymap = (
"Grease Pencil",
@@ -3266,22 +3266,27 @@ def km_grease_pencil(_params):
{"items": items},
)
- items.extend([
- # Draw
- ("gpencil.annotate", {"type": 'LEFTMOUSE', "value": 'PRESS', "key_modifier": 'D'},
- {"properties": [("mode", 'DRAW'), ("wait_for_input", False)]}),
- ("gpencil.annotate", {"type": 'LEFTMOUSE', "value": 'PRESS', "key_modifier": 'D', "shift": True},
- {"properties": [("mode", 'DRAW'), ("wait_for_input", False)]}),
- # Draw - straight lines
- ("gpencil.annotate", {"type": 'LEFTMOUSE', "value": 'PRESS', "alt": True, "key_modifier": 'D'},
- {"properties": [("mode", 'DRAW_STRAIGHT'), ("wait_for_input", False)]}),
- # Draw - poly lines
- ("gpencil.annotate", {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True, "alt": True, "key_modifier": 'D'},
- {"properties": [("mode", 'DRAW_POLY'), ("wait_for_input", False)]}),
- # Erase
- ("gpencil.annotate", {"type": 'RIGHTMOUSE', "value": 'PRESS', "key_modifier": 'D'},
- {"properties": [("mode", 'ERASER'), ("wait_for_input", False)]}),
- ])
+ if params.use_key_activate_tools:
+ items.extend([
+ op_tool_cycle("builtin.annotate", {"type": 'D', "value": 'PRESS'}),
+ ])
+ else:
+ items.extend([
+ # Draw
+ ("gpencil.annotate", {"type": 'LEFTMOUSE', "value": 'PRESS', "key_modifier": 'D'},
+ {"properties": [("mode", 'DRAW'), ("wait_for_input", False)]}),
+ ("gpencil.annotate", {"type": 'LEFTMOUSE', "value": 'PRESS', "key_modifier": 'D', "shift": True},
+ {"properties": [("mode", 'DRAW'), ("wait_for_input", False)]}),
+ # Draw - straight lines
+ ("gpencil.annotate", {"type": 'LEFTMOUSE', "value": 'PRESS', "alt": True, "key_modifier": 'D'},
+ {"properties": [("mode", 'DRAW_STRAIGHT'), ("wait_for_input", False)]}),
+ # Draw - poly lines
+ ("gpencil.annotate", {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True, "alt": True, "key_modifier": 'D'},
+ {"properties": [("mode", 'DRAW_POLY'), ("wait_for_input", False)]}),
+ # Erase
+ ("gpencil.annotate", {"type": 'RIGHTMOUSE', "value": 'PRESS', "key_modifier": 'D'},
+ {"properties": [("mode", 'ERASER'), ("wait_for_input", False)]}),
+ ])
return keymap