From fa8a1fc4201dc4c16b5eef844dde17c5bba92dc8 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sun, 17 Dec 2017 12:04:35 -0300 Subject: Fixes how transform is applied to geometry in UV unwrap --- editor/import/resource_importer_scene.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'editor/import') diff --git a/editor/import/resource_importer_scene.cpp b/editor/import/resource_importer_scene.cpp index 74f23cd052..77820bf6a0 100644 --- a/editor/import/resource_importer_scene.cpp +++ b/editor/import/resource_importer_scene.cpp @@ -849,15 +849,15 @@ void ResourceImporterScene::_find_meshes(Node *p_node, Map, Trans if (mesh.is_valid() && !meshes.has(mesh)) { Spatial *s = mi; - while (s->get_parent_spatial()) { + Transform transform; + while (s) { + transform = transform * s->get_transform(); s = s->get_parent_spatial(); } - if (s == mi) { - meshes[mesh] = s->get_transform(); - } else { - meshes[mesh] = s->get_transform() * mi->get_relative_transform(s); - } + meshes[mesh] = transform; + + print_line("mesh transform: " + meshes[mesh]); } } for (int i = 0; i < p_node->get_child_count(); i++) { -- cgit v1.2.3