From ad55e769bfc87d684b15ac3804c4d70775b9a9a7 Mon Sep 17 00:00:00 2001 From: Stepan Hrbek Date: Mon, 28 Dec 2015 11:27:12 +0100 Subject: [PATCH] Collada exporter: bind uv channels with . When there are multiple uv channels used by multiple textures, specifies what channels to use. Without , at least some importers are unable to match channels to textures. --- code/ColladaExporter.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/code/ColladaExporter.cpp b/code/ColladaExporter.cpp index 7f5333adc..6bd87e8f0 100644 --- a/code/ColladaExporter.cpp +++ b/code/ColladaExporter.cpp @@ -875,6 +875,11 @@ void ColladaExporter::WriteGeometry( size_t pIndex) mOutput << startstr << "" << endstr; PushTag(); mOutput << startstr << "" << endstr; + for( size_t a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++a ) + { + if( mesh->HasTextureCoords( a) ) + mOutput << startstr << "" << endstr; + } mOutput << startstr << ""; for( size_t a = 0; a < mesh->mNumFaces; ++a ) @@ -1070,8 +1075,19 @@ void ColladaExporter::WriteNode(aiNode* pNode) PushTag(); mOutput << startstr << "" << endstr; PushTag(); - mOutput << startstr << "mMaterialIndex].name) << "\" />" << endstr; - PopTag(); + mOutput << startstr << "mMaterialIndex].name) << "\">" << endstr; + PushTag(); + for( size_t a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++a ) + { + if( mesh->HasTextureCoords( a) ) + // semantic as in + // input_semantic as in + // input_set as in + mOutput << startstr << "" << endstr; + } + PopTag(); + mOutput << startstr << "" << endstr; + PopTag(); mOutput << startstr << "" << endstr; PopTag(); mOutput << startstr << "" << endstr;