From 0f590bbfb629cf7b1f0441c6e49ba8978652768a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 26 Jun 2025 21:50:03 +1000 Subject: [PATCH] Cleanup: correct flag name for NDOF Y/Z axis swap --- source/blender/makesdna/DNA_userdef_types.h | 4 ++-- source/blender/makesrna/intern/rna_userdef.cc | 2 +- source/blender/windowmanager/intern/wm_event_query.cc | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index f2a492f9dd1..8f3c44ab94d 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -1017,9 +1017,9 @@ typedef enum eNdof_Flag { // NDOF_UNUSED_6 = (1 << 6), /* Dirty. */ /** * When set translation results in zoom being up/down otherwise forward/backward - * This also swaps X/Y for rotation. + * This also swaps Y/Z for rotation. */ - NDOF_SWAP_XY_AXIS = (1 << 7), + NDOF_SWAP_YZ_AXIS = (1 << 7), // NDOF_UNUSED_8 = (1 << 8), /* Dirty. */ NDOF_ROTX_INVERT_AXIS = (1 << 9), NDOF_ROTY_INVERT_AXIS = (1 << 10), diff --git a/source/blender/makesrna/intern/rna_userdef.cc b/source/blender/makesrna/intern/rna_userdef.cc index 48eeee295b3..85699090d48 100644 --- a/source/blender/makesrna/intern/rna_userdef.cc +++ b/source/blender/makesrna/intern/rna_userdef.cc @@ -6515,7 +6515,7 @@ static void rna_def_userdef_input(BlenderRNA *brna) 0, "Forward/Backward", "Zoom by pulling the 3D Mouse cap upwards or pushing the cap downwards"}, - {NDOF_SWAP_XY_AXIS, + {NDOF_SWAP_YZ_AXIS, "NDOF_ZOOM_UP", 0, "Up/Down", diff --git a/source/blender/windowmanager/intern/wm_event_query.cc b/source/blender/windowmanager/intern/wm_event_query.cc index 91aeaf047f0..c2ca36f57f8 100644 --- a/source/blender/windowmanager/intern/wm_event_query.cc +++ b/source/blender/windowmanager/intern/wm_event_query.cc @@ -508,7 +508,7 @@ static blender::float3 event_ndof_translation_get_with_sign(const wmNDOFMotionDa { int ndof_flag = U.ndof_flag; int x = 0, y = 1, z = 2; - if (ndof_flag & NDOF_SWAP_XY_AXIS) { + if (ndof_flag & NDOF_SWAP_YZ_AXIS) { /* Map `{x, y, z}` -> `{x, -z, y}`. */ std::swap(y, z); ndof_flag ^= NDOF_PANY_INVERT_AXIS; @@ -525,7 +525,7 @@ static blender::float3 event_ndof_rotation_get_with_sign(const wmNDOFMotionData { int ndof_flag = U.ndof_flag; int x = 0, y = 1, z = 2; - if (ndof_flag & NDOF_SWAP_XY_AXIS) { + if (ndof_flag & NDOF_SWAP_YZ_AXIS) { /* Map `{x, y, z}` -> `{x, -z, y}`. */ std::swap(y, z); ndof_flag ^= NDOF_ROTY_INVERT_AXIS; @@ -574,13 +574,13 @@ float WM_event_ndof_rotation_get_axis_angle(const wmNDOFMotionData &ndof, float bool WM_event_ndof_translation_has_pan(const wmNDOFMotionData &ndof) { - return (U.ndof_flag & NDOF_SWAP_XY_AXIS) ? ((ndof.tvec[0] != 0.0f) || (ndof.tvec[2] != 0.0f)) : + return (U.ndof_flag & NDOF_SWAP_YZ_AXIS) ? ((ndof.tvec[0] != 0.0f) || (ndof.tvec[2] != 0.0f)) : ((ndof.tvec[0] != 0.0f) || (ndof.tvec[1] != 0.0f)); } bool WM_event_ndof_translation_has_zoom(const wmNDOFMotionData &ndof) { - return ndof.tvec[(U.ndof_flag & NDOF_SWAP_XY_AXIS) ? 1 : 2] != 0.0f; + return ndof.tvec[(U.ndof_flag & NDOF_SWAP_YZ_AXIS) ? 1 : 2] != 0.0f; } #endif /* WITH_INPUT_NDOF */