From dffc754a0aaafcb1e269394e03714d23aa94fdd1 Mon Sep 17 00:00:00 2001 From: Vivatchai Kaveeta Date: Mon, 18 Mar 2019 03:08:46 +0700 Subject: [PATCH] Fix order of transformation in GLTF import From the gltf 2 spec, the order is R * S. Previously we did S * R, which broke some mesh with non-uniform scale. Fix #23356, Fix #14725 (cherry picked from commit 32dd9c67c683d40e98b444eab4a0a57a270c1276) --- editor/import/editor_scene_importer_gltf.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/editor/import/editor_scene_importer_gltf.cpp b/editor/import/editor_scene_importer_gltf.cpp index 70321462290..7cdac7da338 100644 --- a/editor/import/editor_scene_importer_gltf.cpp +++ b/editor/import/editor_scene_importer_gltf.cpp @@ -237,8 +237,7 @@ Error EditorSceneImporterGLTF::_parse_nodes(GLTFState &state) { node->scale = _arr_to_vec3(n["scale"]); } - node->xform.basis = Basis(node->rotation); - node->xform.basis.scale(node->scale); + node->xform.basis.set_quat_scale(node->rotation, node->scale); node->xform.origin = node->translation; }