Merge branch 'blender-v4.5-release'

This commit is contained in:
Campbell Barton
2025-06-26 22:08:36 +10:00
3 changed files with 7 additions and 7 deletions

View File

@@ -1018,9 +1018,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),

View File

@@ -6493,7 +6493,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",

View File

@@ -513,7 +513,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;
@@ -530,7 +530,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;
@@ -579,13 +579,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 */