diff --git a/release/datafiles/matcaps/license.txt b/release/datafiles/matcaps/license.txt index 2670a62e311..358c8dcd832 100644 --- a/release/datafiles/matcaps/license.txt +++ b/release/datafiles/matcaps/license.txt @@ -1,3 +1,3 @@ These matcap images are licensed as GNU GPL 2 or later, like the rest of Blender's code. -Thanks to Kent Trammell, Aidy Burrows, John Herreno , Terry Wallwork for making the pictures. +Thanks to Kent Trammell, Aidy Burrows, John Herreno , Terry Wallwork and David Silverman for making the pictures. diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py index 2a2db40310c..32eb1a593eb 100644 --- a/release/scripts/startup/bl_ui/space_userpref.py +++ b/release/scripts/startup/bl_ui/space_userpref.py @@ -963,6 +963,8 @@ class USERPREF_PT_input(Panel, InputKeyMapPanel): return (userpref.active_section == 'INPUT') def draw_input_prefs(self, inputs, layout): + import sys + # General settings row = layout.row() col = row.column() @@ -1015,6 +1017,11 @@ class USERPREF_PT_input(Panel, InputKeyMapPanel): sub.prop(inputs, "invert_zoom_wheel", text="Invert Wheel Zoom Direction") #sub.prop(view, "wheel_scroll_lines", text="Scroll Lines") + if sys.platform == "darwin": + sub = col.column() + sub.label(text="Trackpad:") + sub.prop(inputs, "use_trackpad_natural") + col.separator() sub = col.column() sub.label(text="NDOF Device:") diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 648857170ed..edd5b901ca1 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -237,8 +237,14 @@ void ui_pan_to_scroll(const wmEvent *event, int *type, int *val) lastdy += dy; if (ABS(lastdy) > (int)UI_UNIT_Y) { + int dy = event->prevy - event->y; + + if (U.uiflag2 & USER_TRACKPAD_NATURAL) + dy = -dy; + *val = KM_PRESS; - if (event->prevy - event->y > 0) + + if (dy > 0) *type = WHEELUPMOUSE; else *type = WHEELDOWNMOUSE; diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 562d1ec4b64..5c2e75776e4 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -921,8 +921,12 @@ static int viewrotate_invoke(bContext *C, wmOperator *op, wmEvent *event) } if (event->type == MOUSEPAN) { - /* invert it, trackpad scroll then follows how you mapped it globally */ - viewrotate_apply(vod, 2 * event->x - event->prevx, 2 * event->y - event->prevy); + /* Rotate direction we keep always same */ + if (U.uiflag2 & USER_TRACKPAD_NATURAL) + viewrotate_apply(vod, 2 * event->x - event->prevx, 2 * event->y - event->prevy); + else + viewrotate_apply(vod, event->prevx, event->prevy); + ED_view3d_depth_tag_update(rv3d); viewops_data_free(C, op); diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 861d44b214e..2d8d808198d 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -568,7 +568,8 @@ typedef enum eUserpref_UI_Flag { /* uiflag2 */ typedef enum eUserpref_UI_Flag2 { USER_KEEP_SESSION = (1 << 0), - USER_REGION_OVERLAP = (1 << 1) + USER_REGION_OVERLAP = (1 << 1), + USER_TRACKPAD_NATURAL = (1 << 2) } eUserpref_UI_Flag2; /* Auto-Keying mode */ diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 0def5988315..2b2f1a2469b 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -3549,7 +3549,6 @@ static void rna_def_userdef_system(BlenderRNA *brna) "Draw tool/property regions over the main region, when using Triple Buffer"); RNA_def_property_update(prop, 0, "rna_userdef_dpi_update"); - #ifdef WITH_CYCLES prop = RNA_def_property(srna, "compute_device_type", PROP_ENUM, PROP_NONE); RNA_def_property_flag(prop, PROP_ENUM_NO_CONTEXT); @@ -3755,6 +3754,11 @@ static void rna_def_userdef_input(BlenderRNA *brna) RNA_def_property_range(prop, 0, 32); RNA_def_property_ui_text(prop, "Wheel Scroll Lines", "Number of lines scrolled at a time with the mouse wheel"); + prop = RNA_def_property(srna, "use_trackpad_natural", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "uiflag2", USER_TRACKPAD_NATURAL); + RNA_def_property_ui_text(prop, "Trackpad Natural", + "If your system uses 'natural' scrolling, this option keeps consistent trackpad usage throughout the UI"); + prop = RNA_def_property(srna, "active_keyconfig", PROP_STRING, PROP_DIRPATH); RNA_def_property_string_sdna(prop, NULL, "keyconfigstr"); RNA_def_property_ui_text(prop, "Key Config", "The name of the active key configuration");