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:
authorChristopher Peerman <chris_82>2019-01-14 19:46:49 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2019-01-14 22:48:11 +0300
commit46932079184754ace63b25f854e3f273fbf6f0c5 (patch)
tree2d17a33cccbb5e873b090d319add3485528ace54 /source/blender/makesrna
parenteaf282b375598e63876465735519ab3190bd3214 (diff)
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
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 15f20a6aba7..eea2595d2a7 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -236,6 +236,11 @@ static void rna_userdef_autokeymode_set(PointerRNA *ptr, int value)
}
}
+static void rna_userdef_tablet_api_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
+{
+ WM_init_tablet_api();
+}
+
#ifdef WITH_INPUT_NDOF
static void rna_userdef_ndof_deadzone_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
@@ -4608,6 +4613,13 @@ static void rna_def_userdef_input(BlenderRNA *brna)
};
#endif /* WITH_INPUT_NDOF */
+ static const EnumPropertyItem tablet_api[] = {
+ {USER_TABLET_AUTOMATIC, "AUTOMATIC", 0, "Automatic", "Automatically choose Wintab or Windows Ink depending on the device"},
+ {USER_TABLET_NATIVE, "WINDOWS_INK", 0, "Windows Ink", "Use native Windows Ink API, for modern tablet and pen devices. Requires Windows 8 or newer"},
+ {USER_TABLET_WINTAB, "WINTAB", 0, "Wintab", "Use Wintab driver for older tablets and Windows versions"},
+ {0, NULL, 0, NULL, NULL}
+ };
+
static const EnumPropertyItem view_zoom_styles[] = {
{USER_ZOOM_CONT, "CONTINUE", 0, "Continue", "Old style zoom, continues while moving mouse up or down"},
{USER_ZOOM_DOLLY, "DOLLY", 0, "Dolly", "Zoom in and out based on vertical mouse movement"},
@@ -4733,6 +4745,11 @@ static void rna_def_userdef_input(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Softness",
"Adjusts softness of the low pressure response onset using a gamma curve");
+ prop = RNA_def_property(srna, "tablet_api", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, tablet_api);
+ RNA_def_property_ui_text(prop, "Tablet API", "Select the tablet API to use for pressure sensitivity");
+ RNA_def_property_update(prop, 0, "rna_userdef_tablet_api_update");
+
#ifdef WITH_INPUT_NDOF
/* 3D mouse settings */
/* global options */