From 76b674198123eb0c5d77270ae037ad9c6c32c321 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 19 May 2022 13:06:45 +1000 Subject: Fix View Roll failure to align the quaternion to the view-axis View roll checked if the resulting roll was close to a view axis but didn't write the aligned quaternion back to the final result. Add ED_view3d_quat_to_axis_view_and_reset_quat since most callers to ED_view3d_quat_to_axis_view will reset the quaternion when a view aligned axis is found. --- source/blender/editors/include/ED_view3d.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source/blender/editors/include/ED_view3d.h') diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h index 1e9b68c0920..51fd8e6c533 100644 --- a/source/blender/editors/include/ED_view3d.h +++ b/source/blender/editors/include/ED_view3d.h @@ -1064,6 +1064,16 @@ bool ED_view3d_quat_to_axis_view(const float viewquat[4], float epsilon, char *r_view, char *r_view_axis_rotation); +/** + * A version of #ED_view3d_quat_to_axis_view that updates `viewquat` + * if it's within `epsilon` to an axis-view. + * + * \note Include the special case function since most callers need to perform these operations. + */ +bool ED_view3d_quat_to_axis_view_and_reset_quat(float viewquat[4], + float epsilon, + char *r_view, + char *r_view_axis_rotation); char ED_view3d_lock_view_from_index(int index); char ED_view3d_axis_view_opposite(char view); -- cgit v1.2.3