Initial Grease Pencil 3.0 stage #106848

Merged
Falk David merged 224 commits from filedescriptor/blender:grease-pencil-v3 into main 2023-05-30 11:14:22 +02:00
2 changed files with 26 additions and 12 deletions
Showing only changes of commit b2f8f066c0 - Show all commits

View File

@ -365,6 +365,7 @@ def load():
use_alt_click_leader=kc_prefs.use_alt_click_leader,
use_pie_click_drag=kc_prefs.use_pie_click_drag,
use_file_single_click=kc_prefs.use_file_single_click,
experimental=prefs.experimental,
),
)

View File

@ -93,6 +93,8 @@ class Params:
# 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",
# Access to bpy.context.preferences.experimental
"experimental",
)
def __init__(
@ -119,6 +121,7 @@ class Params:
use_file_single_click=False,
v3d_tilde_action='VIEW',
v3d_alt_mmb_drag_action='RELATIVE',
experimental=None
):
from sys import platform
self.apple = (platform == 'darwin')
@ -210,6 +213,9 @@ class Params:
self.tool_tweak_event = {"type": self.tool_mouse, "value": 'CLICK_DRAG'}
self.tool_maybe_tweak_event = {"type": self.tool_mouse, "value": self.tool_maybe_tweak_value}
if experimental:
self.experimental = experimental
# ------------------------------------------------------------------------------
# Constants
@ -3810,24 +3816,31 @@ def km_grease_pencil_stroke_paint_draw_brush(params):
{"items": items},
)
items.extend([
# Draw
# Draw
if params.experimental.use_grease_pencil_version3:
items.extend([
("grease_pencil.brush_stroke", {"type": 'LEFTMOUSE', "value": 'PRESS'},
{"properties": [("mode", 'NORMAL')]}),
("grease_pencil.brush_stroke", {"type": 'LEFTMOUSE', "value": 'PRESS', "ctrl": True},
{"properties": [("mode", 'INVERT')]}),
("grease_pencil.brush_stroke", {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True},
{"properties": [("mode", 'SMOOTH')]}),
# ("gpencil.draw", {"type": 'LEFTMOUSE', "value": 'PRESS'},
# {"properties": [("mode", 'DRAW'), ("wait_for_input", False)]}),
# ("gpencil.draw", {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True},
# {"properties": [("mode", 'DRAW'), ("wait_for_input", False)]}),
# # Draw - straight lines
# ("gpencil.draw", {"type": 'LEFTMOUSE', "value": 'PRESS', "alt": True},
# {"properties": [("mode", 'DRAW_STRAIGHT'), ("wait_for_input", False)]}),
# # Erase
# ("gpencil.draw", {"type": 'LEFTMOUSE', "value": 'PRESS', "ctrl": True},
# {"properties": [("mode", 'ERASER'), ("wait_for_input", False)]}),
])
else:
items.extend([
("gpencil.draw", {"type": 'LEFTMOUSE', "value": 'PRESS'},
{"properties": [("mode", 'DRAW'), ("wait_for_input", False)]}),
("gpencil.draw", {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True},
{"properties": [("mode", 'DRAW'), ("wait_for_input", False)]}),
# Draw - straight lines
("gpencil.draw", {"type": 'LEFTMOUSE', "value": 'PRESS', "alt": True},
{"properties": [("mode", 'DRAW_STRAIGHT'), ("wait_for_input", False)]}),
# Erase
("gpencil.draw", {"type": 'LEFTMOUSE', "value": 'PRESS', "ctrl": True},
{"properties": [("mode", 'ERASER'), ("wait_for_input", False)]}),
])
items.extend([
# Constrain Guides Speedlines
# Freehand
("gpencil.draw", {"type": 'O', "value": 'PRESS'}, None),