From 7ae8e18f0be0b80ee33fb9949fdccc1252dce96b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 14 Jun 2025 06:35:38 +0000 Subject: [PATCH] Cleanup: rename preferences for NDOF sensitivity Clarify the terms for NDOF translation & rotation sensitivity. Previously translation was named: "ndof_sensitivity" making it sound like it would control rotation as well. --- release/datafiles/userdef/userdef_default.c | 4 ++-- .../keyconfig/keymap_data/blender_default.py | 8 ++++---- .../keymap_data/industry_compatible_data.py | 8 ++++---- scripts/startup/bl_ui/space_userpref.py | 4 ++-- .../blender/blenloader/intern/versioning_userdef.cc | 8 ++++---- source/blender/makesdna/DNA_userdef_types.h | 9 +++++---- source/blender/makesdna/intern/dna_rename_defs.h | 6 ++++-- source/blender/makesrna/intern/rna_userdef.cc | 13 +++++++------ .../blender/windowmanager/intern/wm_event_system.cc | 4 ++-- 9 files changed, 34 insertions(+), 30 deletions(-) diff --git a/release/datafiles/userdef/userdef_default.c b/release/datafiles/userdef/userdef_default.c index 166261831ba..5a4a6b880b2 100644 --- a/release/datafiles/userdef/userdef_default.c +++ b/release/datafiles/userdef/userdef_default.c @@ -155,8 +155,8 @@ const UserDef U_default = { .tablet_api = USER_TABLET_AUTOMATIC, .pressure_threshold_max = 1.0, .pressure_softness = 0.0, - .ndof_sensitivity = 4.0, - .ndof_orbit_sensitivity = 4.0, + .ndof_translation_sensitivity = 4.0, + .ndof_rotation_sensitivity = 4.0, .ndof_deadzone = 0.0, .ndof_flag = (NDOF_SHOW_GUIDE_ORBIT_CENTER | NDOF_ORBIT_CENTER_AUTO | NDOF_LOCK_HORIZON | NDOF_SHOULD_PAN | NDOF_SHOULD_ZOOM | NDOF_SHOULD_ROTATE | NDOF_CAMERA_PAN_ZOOM), diff --git a/scripts/presets/keyconfig/keymap_data/blender_default.py b/scripts/presets/keyconfig/keymap_data/blender_default.py index b628cd588e8..a84ced110d1 100644 --- a/scripts/presets/keyconfig/keymap_data/blender_default.py +++ b/scripts/presets/keyconfig/keymap_data/blender_default.py @@ -742,13 +742,13 @@ def km_window(params): # NDOF settings op_panel("USERPREF_PT_ndof_settings", {"type": 'NDOF_BUTTON_MENU', "value": 'PRESS'}), ("wm.context_scale_float", {"type": 'NDOF_BUTTON_PLUS', "value": 'PRESS'}, - {"properties": [("data_path", "preferences.inputs.ndof_sensitivity"), ("value", 1.1)]}), + {"properties": [("data_path", "preferences.inputs.ndof_translation_sensitivity"), ("value", 1.1)]}), ("wm.context_scale_float", {"type": 'NDOF_BUTTON_MINUS', "value": 'PRESS'}, - {"properties": [("data_path", "preferences.inputs.ndof_sensitivity"), ("value", 1.0 / 1.1)]}), + {"properties": [("data_path", "preferences.inputs.ndof_translation_sensitivity"), ("value", 1.0 / 1.1)]}), ("wm.context_scale_float", {"type": 'NDOF_BUTTON_PLUS', "value": 'PRESS', "shift": True}, - {"properties": [("data_path", "preferences.inputs.ndof_sensitivity"), ("value", 1.5)]}), + {"properties": [("data_path", "preferences.inputs.ndof_translation_sensitivity"), ("value", 1.5)]}), ("wm.context_scale_float", {"type": 'NDOF_BUTTON_MINUS', "value": 'PRESS', "shift": True}, - {"properties": [("data_path", "preferences.inputs.ndof_sensitivity"), ("value", 2.0 / 3.0)]}), + {"properties": [("data_path", "preferences.inputs.ndof_translation_sensitivity"), ("value", 2.0 / 3.0)]}), ("info.reports_display_update", {"type": 'TIMER_REPORT', "value": 'ANY', "any": True}, None), ]) diff --git a/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py b/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py index 6e2a28950a1..0af050b8f25 100644 --- a/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py +++ b/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py @@ -205,13 +205,13 @@ def km_window(params): # NDOF settings op_panel("USERPREF_PT_ndof_settings", {"type": 'NDOF_BUTTON_MENU', "value": 'PRESS'}), ("wm.context_scale_float", {"type": 'NDOF_BUTTON_PLUS', "value": 'PRESS'}, - {"properties": [("data_path", "preferences.inputs.ndof_sensitivity"), ("value", 1.1)]}), + {"properties": [("data_path", "preferences.inputs.ndof_translation_sensitivity"), ("value", 1.1)]}), ("wm.context_scale_float", {"type": 'NDOF_BUTTON_MINUS', "value": 'PRESS'}, - {"properties": [("data_path", "preferences.inputs.ndof_sensitivity"), ("value", 1.0 / 1.1)]}), + {"properties": [("data_path", "preferences.inputs.ndof_translation_sensitivity"), ("value", 1.0 / 1.1)]}), ("wm.context_scale_float", {"type": 'NDOF_BUTTON_PLUS', "value": 'PRESS', "shift": True}, - {"properties": [("data_path", "preferences.inputs.ndof_sensitivity"), ("value", 1.5)]}), + {"properties": [("data_path", "preferences.inputs.ndof_translation_sensitivity"), ("value", 1.5)]}), ("wm.context_scale_float", {"type": 'NDOF_BUTTON_MINUS', "value": 'PRESS', "shift": True}, - {"properties": [("data_path", "preferences.inputs.ndof_sensitivity"), ("value", 2.0 / 3.0)]}), + {"properties": [("data_path", "preferences.inputs.ndof_translation_sensitivity"), ("value", 2.0 / 3.0)]}), ("info.reports_display_update", {"type": 'TIMER_REPORT', "value": 'ANY', "any": True}, None), ]) diff --git a/scripts/startup/bl_ui/space_userpref.py b/scripts/startup/bl_ui/space_userpref.py index 7c724ebc38a..39623e84f34 100644 --- a/scripts/startup/bl_ui/space_userpref.py +++ b/scripts/startup/bl_ui/space_userpref.py @@ -2116,8 +2116,8 @@ class USERPREF_PT_ndof_settings(Panel): layout_header.label(text="Advanced") if layout_advanced: col = layout_advanced.column() - col.prop(props, "ndof_sensitivity", text="Pan Sensitivity") - col.prop(props, "ndof_orbit_sensitivity") + col.prop(props, "ndof_translation_sensitivity") + col.prop(props, "ndof_rotation_sensitivity") col.prop(props, "ndof_deadzone") col.separator() diff --git a/source/blender/blenloader/intern/versioning_userdef.cc b/source/blender/blenloader/intern/versioning_userdef.cc index e071ddc24cf..977404ddf9b 100644 --- a/source/blender/blenloader/intern/versioning_userdef.cc +++ b/source/blender/blenloader/intern/versioning_userdef.cc @@ -900,14 +900,14 @@ void blo_do_versions_userdef(UserDef *userdef) userdef->anisotropic_filter = 1; } - if (userdef->ndof_sensitivity == 0.0f) { - userdef->ndof_sensitivity = 1.0f; + if (userdef->ndof_translation_sensitivity == 0.0f) { + userdef->ndof_translation_sensitivity = 1.0f; userdef->ndof_flag = (NDOF_LOCK_HORIZON | NDOF_SHOULD_PAN | NDOF_SHOULD_ZOOM | NDOF_SHOULD_ROTATE); } - if (userdef->ndof_orbit_sensitivity == 0.0f) { - userdef->ndof_orbit_sensitivity = userdef->ndof_sensitivity; + if (userdef->ndof_rotation_sensitivity == 0.0f) { + userdef->ndof_rotation_sensitivity = userdef->ndof_translation_sensitivity; if (!(userdef->flag & USER_TRACKBALL)) { userdef->ndof_flag |= NDOF_TURNTABLE; diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 3e356cce5f0..4d20fe1b163 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -513,10 +513,11 @@ typedef struct UserDef { /** Curve non-linearity parameter. */ float pressure_softness; - /** Overall sensitivity of 3D mouse. */ - float ndof_sensitivity; - float ndof_orbit_sensitivity; - /** Dead-zone of 3D mouse. */ + /** 3D mouse: overall translation sensitivity. */ + float ndof_translation_sensitivity; + /** 3D mouse: overall rotation sensitivity. */ + float ndof_rotation_sensitivity; + /** 3D mouse: dead-zone. */ float ndof_deadzone; /** #eNdof_Flag, flags for 3D mouse. */ int ndof_flag; diff --git a/source/blender/makesdna/intern/dna_rename_defs.h b/source/blender/makesdna/intern/dna_rename_defs.h index 9595da151d5..1bd23ef8ac3 100644 --- a/source/blender/makesdna/intern/dna_rename_defs.h +++ b/source/blender/makesdna/intern/dna_rename_defs.h @@ -188,12 +188,12 @@ DNA_STRUCT_RENAME_MEMBER(RenderData, blurfac, motion_blur_shutter) DNA_STRUCT_RENAME_MEMBER(RigidBodyWorld, steps_per_second, substeps_per_frame) DNA_STRUCT_RENAME_MEMBER(SDefBind, numverts, verts_num) DNA_STRUCT_RENAME_MEMBER(SDefVert, numbinds, binds_num) +DNA_STRUCT_RENAME_MEMBER(SceneEEVEE, gtao_focus, fast_gi_bias) DNA_STRUCT_RENAME_MEMBER(SceneEEVEE, gtao_quality, fast_gi_quality) +DNA_STRUCT_RENAME_MEMBER(SceneEEVEE, gtao_resolution, fast_gi_resolution) DNA_STRUCT_RENAME_MEMBER(SceneEEVEE, motion_blur_position, motion_blur_position_deprecated) DNA_STRUCT_RENAME_MEMBER(SceneEEVEE, motion_blur_shutter, motion_blur_shutter_deprecated) DNA_STRUCT_RENAME_MEMBER(SceneEEVEE, shadow_cube_size, shadow_cube_size_deprecated) -DNA_STRUCT_RENAME_MEMBER(SceneEEVEE, gtao_resolution, fast_gi_resolution) -DNA_STRUCT_RENAME_MEMBER(SceneEEVEE, gtao_focus, fast_gi_bias) DNA_STRUCT_RENAME_MEMBER(SpaceImage, pixel_snap_mode, pixel_round_mode) DNA_STRUCT_RENAME_MEMBER(SpaceSeq, overlay_type, overlay_frame_type) DNA_STRUCT_RENAME_MEMBER(Strip, machine, channel) @@ -218,6 +218,8 @@ DNA_STRUCT_RENAME_MEMBER(UVProjectModifierData, num_projectors, projectors_num) DNA_STRUCT_RENAME_MEMBER(UserDef, autokey_flag, keying_flag) DNA_STRUCT_RENAME_MEMBER(UserDef, gp_manhattendist, gp_manhattandist) DNA_STRUCT_RENAME_MEMBER(UserDef, max_shader_compilation_subprocesses, gpu_shader_workers) +DNA_STRUCT_RENAME_MEMBER(UserDef, ndof_orbit_sensitivity, ndof_rotation_sensitivity) +DNA_STRUCT_RENAME_MEMBER(UserDef, ndof_sensitivity, ndof_translation_sensitivity) DNA_STRUCT_RENAME_MEMBER(UserDef, pythondir, pythondir_legacy) DNA_STRUCT_RENAME_MEMBER(VFont, name, filepath) DNA_STRUCT_RENAME_MEMBER(View3D, far, clip_end) diff --git a/source/blender/makesrna/intern/rna_userdef.cc b/source/blender/makesrna/intern/rna_userdef.cc index 06ff1868234..7f6a636d982 100644 --- a/source/blender/makesrna/intern/rna_userdef.cc +++ b/source/blender/makesrna/intern/rna_userdef.cc @@ -6692,14 +6692,15 @@ static void rna_def_userdef_input(BlenderRNA *brna) # ifdef WITH_INPUT_NDOF /* 3D mouse settings */ /* global options */ - prop = RNA_def_property(srna, "ndof_sensitivity", PROP_FLOAT, PROP_NONE); - RNA_def_property_range(prop, 0.01f, 40.0f); - RNA_def_property_ui_text(prop, "Sensitivity", "Overall sensitivity of the 3D Mouse for panning"); - - prop = RNA_def_property(srna, "ndof_orbit_sensitivity", PROP_FLOAT, PROP_NONE); + prop = RNA_def_property(srna, "ndof_translation_sensitivity", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.01f, 40.0f); RNA_def_property_ui_text( - prop, "Orbit Sensitivity", "Overall sensitivity of the 3D Mouse for orbiting"); + prop, "Pan Sensitivity", "Overall sensitivity of the 3D Mouse for translation"); + + prop = RNA_def_property(srna, "ndof_rotation_sensitivity", PROP_FLOAT, PROP_NONE); + RNA_def_property_range(prop, 0.01f, 40.0f); + RNA_def_property_ui_text( + prop, "Orbit Sensitivity", "Overall sensitivity of the 3D Mouse for rotation"); prop = RNA_def_property(srna, "ndof_deadzone", PROP_FLOAT, PROP_FACTOR); RNA_def_property_range(prop, 0.0f, 1.0f); diff --git a/source/blender/windowmanager/intern/wm_event_system.cc b/source/blender/windowmanager/intern/wm_event_system.cc index 158311767d3..d9259125b8e 100644 --- a/source/blender/windowmanager/intern/wm_event_system.cc +++ b/source/blender/windowmanager/intern/wm_event_system.cc @@ -5604,8 +5604,8 @@ static void attach_ndof_data(wmEvent *event, const GHOST_TEventNDOFMotionData *g { wmNDOFMotionData *data = MEM_callocN("Custom-data NDOF"); - const float ts = U.ndof_sensitivity; - const float rs = U.ndof_orbit_sensitivity; + const float ts = U.ndof_translation_sensitivity; + const float rs = U.ndof_rotation_sensitivity; mul_v3_v3fl(data->tvec, &ghost->tx, ts); mul_v3_v3fl(data->rvec, &ghost->rx, rs);