Page Menu
Home
Search
Configure Global Search
Log In
Paste
P2678
T94231_snippet
Active
Public
Actions
Authored by
Philipp Oeser (lichtwerk)
on Dec 22 2021, 3:46 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Tags
None
Subscribers
None
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);
}
Event Timeline
Philipp Oeser (lichtwerk)
created this paste.
Dec 22 2021, 3:46 PM
Philipp Oeser (lichtwerk)
mentioned this in
T94231: matrix.to_quaternion() returns invalid rotation
.
Dec 22 2021, 3:48 PM
Log In to Comment