diff options
author | Mike Erwin <significant.bit@gmail.com> | 2016-08-18 07:21:55 +0300 |
---|---|---|
committer | Mike Erwin <significant.bit@gmail.com> | 2016-08-18 07:22:18 +0300 |
commit | b10d0058d72da3051895481ae5830a7b668b7d80 (patch) | |
tree | 987bcae7e565745b1371e60c7d74ffce2668aac7 /source/blender/makesrna/intern/rna_userdef.c | |
parent | a195dd15d4373ff0e240566795ff7795ca7485e6 (diff) |
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.
Diffstat (limited to 'source/blender/makesrna/intern/rna_userdef.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_userdef.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index cbf7bb4d5e0..29c0e948a4c 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -292,11 +292,13 @@ static void rna_userdef_autokeymode_set(PointerRNA *ptr, int value) } } +#ifdef WITH_INPUT_NDOF static void rna_userdef_ndof_deadzone_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { UserDef *userdef = ptr->data; WM_ndof_deadzone_set(userdef->ndof_deadzone); } +#endif static void rna_userdef_timecode_style_set(PointerRNA *ptr, int value) { @@ -4333,6 +4335,7 @@ static void rna_def_userdef_input(BlenderRNA *brna) {0, NULL, 0, NULL, NULL} }; +#ifdef WITH_INPUT_NDOF static EnumPropertyItem ndof_view_navigation_items[] = { {0, "FREE", 0, "Free", "Use full 6 degrees of freedom by default"}, {NDOF_MODE_ORBIT, "ORBIT", 0, "Orbit", "Orbit about the view center by default"}, @@ -4344,6 +4347,7 @@ static void rna_def_userdef_input(BlenderRNA *brna) {0, "TRACKBALL", 0, "Trackball", "Use trackball style rotation in the viewport"}, {0, NULL, 0, NULL, NULL} }; +#endif /* WITH_INPUT_NDOF */ static EnumPropertyItem view_zoom_styles[] = { {USER_ZOOM_CONT, "CONTINUE", 0, "Continue", "Old style zoom, continues while moving mouse up or down"}, @@ -4421,6 +4425,7 @@ static void rna_def_userdef_input(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Tweak Threshold", "Number of pixels you have to drag before tweak event is triggered"); +#ifdef WITH_INPUT_NDOF /* 3D mouse settings */ /* global options */ prop = RNA_def_property(srna, "ndof_sensitivity", PROP_FLOAT, PROP_NONE); @@ -4501,6 +4506,13 @@ static void rna_def_userdef_input(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_FLY_HELICOPTER); RNA_def_property_ui_text(prop, "Helicopter Mode", "Device up/down directly controls your Z position"); + /* let Python know whether NDOF is enabled */ + prop = RNA_def_boolean(srna, "use_ndof", true, "", ""); +#else + prop = RNA_def_boolean(srna, "use_ndof", false, "", ""); +#endif /* WITH_INPUT_NDOF */ + RNA_def_property_flag(prop, PROP_IDPROPERTY); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); prop = RNA_def_property(srna, "mouse_double_click_time", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "dbl_click_time"); |