From b10d0058d72da3051895481ae5830a7b668b7d80 Mon Sep 17 00:00:00 2001 From: Mike Erwin Date: Thu, 18 Aug 2016 00:21:55 -0400 Subject: NDOF: compile 3D mouse code only if WITH_INPUT_NDOF When WITH_INPUT_NDOF is disabled, 3D mouse handling code is removed from: - GHOST (was mostly done, finished the job) - window manager - various editors - RNA - keymaps The input tab of user prefs does not show 3D mouse settings. Key map editor does not show NDOF mappings. DNA does not change. On my Mac the compiled binary is 42KB smaller after this change. It runs fine WITH_INPUT_NDOF on or off. --- source/blender/windowmanager/intern/wm_operators.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source/blender/windowmanager/intern/wm_operators.c') diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 78273615602..fcdab746d57 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -4348,7 +4348,6 @@ void wm_window_keymap(wmKeyConfig *keyconf) { wmKeyMap *keymap = WM_keymap_find(keyconf, "Window", 0, 0); wmKeyMapItem *kmi; - const char *data_path; /* note, this doesn't replace existing keymap items */ WM_keymap_verify_item(keymap, "WM_OT_window_duplicate", WKEY, KM_PRESS, KM_CTRL | KM_ALT, 0); @@ -4386,7 +4385,9 @@ void wm_window_keymap(wmKeyConfig *keyconf) /* menus that can be accessed anywhere in blender */ WM_keymap_verify_item(keymap, "WM_OT_search_menu", SPACEKEY, KM_PRESS, 0, 0); +#ifdef WITH_INPUT_NDOF WM_keymap_add_menu(keymap, "USERPREF_MT_ndof_settings", NDOF_BUTTON_MENU, KM_PRESS, 0, 0); +#endif /* Space switching */ kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", F2KEY, KM_PRESS, KM_SHIFT, 0); /* new in 2.5x, was DXF export */ @@ -4433,8 +4434,9 @@ void wm_window_keymap(wmKeyConfig *keyconf) RNA_string_set(kmi->ptr, "data_path", "area.type"); RNA_string_set(kmi->ptr, "value", "DOPESHEET_EDITOR"); +#ifdef WITH_INPUT_NDOF /* ndof speed */ - data_path = "user_preferences.inputs.ndof_sensitivity"; + const char *data_path = "user_preferences.inputs.ndof_sensitivity"; kmi = WM_keymap_add_item(keymap, "WM_OT_context_scale_float", NDOF_BUTTON_PLUS, KM_PRESS, 0, 0); RNA_string_set(kmi->ptr, "data_path", data_path); RNA_float_set(kmi->ptr, "value", 1.1f); @@ -4450,9 +4452,7 @@ void wm_window_keymap(wmKeyConfig *keyconf) kmi = WM_keymap_add_item(keymap, "WM_OT_context_scale_float", NDOF_BUTTON_MINUS, KM_PRESS, KM_SHIFT, 0); RNA_string_set(kmi->ptr, "data_path", data_path); RNA_float_set(kmi->ptr, "value", 1.0f / 1.5f); - data_path = NULL; - (void)data_path; - +#endif /* WITH_INPUT_NDOF */ gesture_circle_modal_keymap(keyconf); gesture_border_modal_keymap(keyconf); -- cgit v1.2.3