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.
This commit is contained in:
Campbell Barton
2025-06-14 06:35:38 +00:00
parent bb9d491ca5
commit 7ae8e18f0b
9 changed files with 34 additions and 30 deletions

View File

@@ -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),

View File

@@ -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),
])

View File

@@ -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),
])

View File

@@ -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()

View File

@@ -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;

View File

@@ -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;

View File

@@ -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)

View File

@@ -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);

View File

@@ -5604,8 +5604,8 @@ static void attach_ndof_data(wmEvent *event, const GHOST_TEventNDOFMotionData *g
{
wmNDOFMotionData *data = MEM_callocN<wmNDOFMotionData>("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);