From 929d83398d686d7a7fbe8698413cf57f3e90223f Mon Sep 17 00:00:00 2001 From: Paul Arden Date: Mon, 25 Nov 2019 13:51:33 +1100 Subject: [PATCH 1/3] Remove duplicate call to exporter. Fixes issue #2718. --- code/Common/Exporter.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/code/Common/Exporter.cpp b/code/Common/Exporter.cpp index 8a95ceae5..b9bd0409b 100644 --- a/code/Common/Exporter.cpp +++ b/code/Common/Exporter.cpp @@ -445,8 +445,7 @@ aiReturn Exporter::Export( const aiScene* pScene, const char* pFormatId, const c ExportProperties emptyProperties; // Never pass NULL ExportProperties so Exporters don't have to worry. ExportProperties* pProp = pProperties ? (ExportProperties*)pProperties : &emptyProperties; - pProp->SetPropertyBool("bJoinIdenticalVertices", must_join_again); - exp.mExportFunction(pPath,pimpl->mIOSystem.get(),scenecopy.get(), pProp); + pProp->SetPropertyBool("bJoinIdenticalVertices", must_join_again); exp.mExportFunction(pPath,pimpl->mIOSystem.get(),scenecopy.get(), pProp); pimpl->mProgressHandler->UpdateFileWrite(4, 4); From 7230f32c143d656f365d628de1d7ad1f14dced61 Mon Sep 17 00:00:00 2001 From: Paul Arden Date: Mon, 25 Nov 2019 20:58:21 +1100 Subject: [PATCH 2/3] Fix issue with y UV translation. Fixes #2119. --- code/glTF2/glTF2Importer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/glTF2/glTF2Importer.cpp b/code/glTF2/glTF2Importer.cpp index 43eabdab7..88345f98a 100644 --- a/code/glTF2/glTF2Importer.cpp +++ b/code/glTF2/glTF2Importer.cpp @@ -205,7 +205,7 @@ inline void SetMaterialTextureProperty(std::vector &embeddedTexIdxs, Asset if (prop.textureTransformSupported) { aiUVTransform transform; transform.mTranslation.x = prop.TextureTransformExt_t.offset[0]; - transform.mTranslation.y = prop.TextureTransformExt_t.offset[0]; + transform.mTranslation.y = prop.TextureTransformExt_t.offset[1]; transform.mRotation = prop.TextureTransformExt_t.rotation; transform.mScaling.x = prop.TextureTransformExt_t.scale[0]; transform.mScaling.y = prop.TextureTransformExt_t.scale[1]; From b4f778f53b11340facb26371d2e0ae3e6c12dda2 Mon Sep 17 00:00:00 2001 From: Paul Arden Date: Tue, 26 Nov 2019 18:17:35 +1100 Subject: [PATCH 3/3] Fix aiGetMaterialUVTransform which assumed the data was 4 floats when in fact it is 5 floats. Fixes and issue seen in #2119. --- code/Material/MaterialSystem.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/Material/MaterialSystem.cpp b/code/Material/MaterialSystem.cpp index fabd9415a..aa3df9ac2 100644 --- a/code/Material/MaterialSystem.cpp +++ b/code/Material/MaterialSystem.cpp @@ -273,14 +273,14 @@ aiReturn aiGetMaterialColor(const aiMaterial* pMat, } // ------------------------------------------------------------------------------------------------ -// Get a aiUVTransform (4 floats) from the material +// Get a aiUVTransform (5 floats) from the material aiReturn aiGetMaterialUVTransform(const aiMaterial* pMat, const char* pKey, unsigned int type, unsigned int index, aiUVTransform* pOut) { - unsigned int iMax = 4; + unsigned int iMax = 5; return aiGetMaterialFloatArray(pMat,pKey,type,index,(ai_real*)pOut,&iMax); }