From 3264e219a98f426ed0efb9248e787e2bf335f389 Mon Sep 17 00:00:00 2001 From: Saracen Date: Thu, 4 Feb 2021 22:08:10 +0000 Subject: [PATCH] Patched to compile with latest version of xatlas and Godot 3.2 --- merge.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/merge.cpp b/merge.cpp index a5d9cff..6cb1cd0 100644 --- a/merge.cpp +++ b/merge.cpp @@ -805,8 +805,7 @@ void MeshMergeMaterialRepack::_generate_atlas(const int32_t p_num_meshes, Vector meshDecl.indexData = indexes.ptr(); meshDecl.indexFormat = xatlas::IndexFormat::UInt32; meshDecl.faceMaterialData = materials.ptr(); - meshDecl.rotateCharts = false; - xatlas::AddMeshError::Enum error = xatlas::AddUvMesh(atlas, meshDecl); + xatlas::AddMeshError error = xatlas::AddUvMesh(atlas, meshDecl); ERR_CONTINUE_MSG(error != xatlas::AddMeshError::Success, String("Error adding mesh ") + itos(mesh_i) + String(": ") + xatlas::StringForEnum(error)); mesh_count++; } @@ -817,6 +816,7 @@ void MeshMergeMaterialRepack::_generate_atlas(const int32_t p_num_meshes, Vector pack_options.bruteForce = true; pack_options.blockAlign = true; pack_options.resolution = 2048; + pack_options.rotateCharts = false; xatlas::PackCharts(atlas, pack_options); } @@ -958,7 +958,7 @@ void MeshMergeMaterialRepack::map_mesh_to_index_to_material(const Vectorsurface_get_arrays(j); Array uvs = mesh[ArrayMesh::ARRAY_TEX_UV]; if (!uvs.size()) { - array_mesh->mesh_unwrap(Transform(), 2.0f); + array_mesh->lightmap_unwrap(Transform(), 2.0f); break; } }