From 3f22f8d1f04d896fc01b387f66120c2c531939a5 Mon Sep 17 00:00:00 2001 From: Guillaume Laforte Date: Wed, 21 Nov 2018 10:15:08 -0500 Subject: [PATCH] Avoids spamming the user when the COLLADA importer detects a singular basis during the animation import. Fixes https://github.com/godotengine/godot/issues/22848. --- editor/import/editor_import_collada.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/editor/import/editor_import_collada.cpp b/editor/import/editor_import_collada.cpp index e8bb772a64c..65ccfc9309a 100644 --- a/editor/import/editor_import_collada.cpp +++ b/editor/import/editor_import_collada.cpp @@ -1655,7 +1655,7 @@ void ColladaImport::create_animation(int p_clip, bool p_make_tracks_in_all_bones } } - Quat q = xform.basis.get_rotation_quat(); + Quat q = Math::is_equal_approx(xform.basis.determinant(), 0) ? Quat() : xform.basis.get_rotation_quat(); Vector3 s = xform.basis.get_scale(); Vector3 l = xform.origin; @@ -1705,7 +1705,7 @@ void ColladaImport::create_animation(int p_clip, bool p_make_tracks_in_all_bones xform = sk->get_bone_rest(nm.bone).affine_inverse() * xform; - Quat q = xform.basis.get_rotation_quat(); + Quat q = Math::is_equal_approx(xform.basis.determinant(), 0) ? Quat() : xform.basis.get_rotation_quat(); Vector3 s = xform.basis.get_scale(); Vector3 l = xform.origin;