diff options
Diffstat (limited to 'editor/import')
-rw-r--r-- | editor/import/editor_import_collada.cpp | 6 | ||||
-rw-r--r-- | editor/import/resource_importer_texture.cpp | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/editor/import/editor_import_collada.cpp b/editor/import/editor_import_collada.cpp index eb454301fa..8e69090da3 100644 --- a/editor/import/editor_import_collada.cpp +++ b/editor/import/editor_import_collada.cpp @@ -1656,8 +1656,9 @@ void ColladaImport::create_animation(int p_clip, bool p_make_tracks_in_all_bones } } - Quat q = Math::is_equal_approx(xform.basis.determinant(), 0) ? Quat() : xform.basis.get_rotation_quat(); Vector3 s = xform.basis.get_scale(); + bool singular_matrix = Math::is_equal_approx(s.x, 0.0f) || Math::is_equal_approx(s.y, 0.0f) || Math::is_equal_approx(s.z, 0.0f); + Quat q = singular_matrix ? Quat() : xform.basis.get_rotation_quat(); Vector3 l = xform.origin; animation->transform_track_insert_key(track, snapshots[i], l, q, s); @@ -1706,8 +1707,9 @@ 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 = Math::is_equal_approx(xform.basis.determinant(), 0) ? Quat() : xform.basis.get_rotation_quat(); Vector3 s = xform.basis.get_scale(); + bool singular_matrix = Math::is_equal_approx(s.x, 0.0f) || Math::is_equal_approx(s.y, 0.0f) || Math::is_equal_approx(s.z, 0.0f); + Quat q = singular_matrix ? Quat() : xform.basis.get_rotation_quat(); Vector3 l = xform.origin; animation->transform_track_insert_key(track, 0, l, q, s); diff --git a/editor/import/resource_importer_texture.cpp b/editor/import/resource_importer_texture.cpp index b38f4c4f14..724203831c 100644 --- a/editor/import/resource_importer_texture.cpp +++ b/editor/import/resource_importer_texture.cpp @@ -415,7 +415,7 @@ Error ResourceImporterTexture::import(const String &p_source_file, const String image->resize(new_width, new_height, Image::INTERPOLATE_CUBIC); } - if (normal) { + if (normal == 1) { image->normalize(); } } |