Windows: add support for Windows Ink.

Before this Blender always needed the Wintab driver. This adds support for the
native pressure API in Windows 8+, making it possible to get pressure sensitivity
on e.g. Microsoft Surface hardware without any extra drivers.

By default Blender will automatically use Wintab if available, and if not use
Windows Ink instead. There is also a new user preference to explicitly specify
which API to use if automatic detection fails.

Fixes T57869: no pressure sensitivity with Surface pen or laptop.

Code by Christopher Peerman with some tweaks by Brecht Van Lommel.

Differential Revision: https://developer.blender.org/D4165
This commit is contained in:
Christopher Peerman
2019-01-14 17:46:49 +01:00
committed by Brecht Van Lommel
parent eaf282b375
commit 4693207918
14 changed files with 277 additions and 7 deletions

View File

@@ -1504,6 +1504,11 @@ class USERPREF_PT_input_devices_tablet(PreferencePanel):
prefs = context.preferences
inputs = prefs.inputs
import sys
if sys.platform[:3] == "win":
layout.prop(inputs, "tablet_api")
layout.separator()
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
flow.prop(inputs, "pressure_threshold_max")