Page MenuHome
Paste P2678

T94231_snippet
ActivePublic

Authored by Philipp Oeser (lichtwerk) on Dec 22 2021, 3:46 PM.
diff --git a/source/blender/blenlib/intern/math_rotation.c b/source/blender/blenlib/intern/math_rotation.c
index dbcf3a6500c..44682cd19ec 100644
--- a/source/blender/blenlib/intern/math_rotation.c
+++ b/source/blender/blenlib/intern/math_rotation.c
@@ -373,6 +373,12 @@ void mat4_to_quat(float q[4], const float m[4][4])
float mat3[3][3];
copy_m3_m4(mat3, m);
+
+ /* FIXME: this is a workaround for negative matrix not working for rotation conversion. */
+ if (is_negative_m4(m)) {
+ negate_m3(mat3);
+ }
+
mat3_to_quat(q, mat3);
}