From 30ce13a617f287dbcf367ac96174807d95cd0ac1 Mon Sep 17 00:00:00 2001 From: kimmi Date: Sat, 17 Nov 2012 12:47:15 +0000 Subject: [PATCH] Github merge: Adjusting the Collada Color Parser from albert-wang. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1336 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- CREDITS | 5 ++++- code/ColladaParser.cpp | 8 +++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CREDITS b/CREDITS index a14d587b8..6fee05163 100644 --- a/CREDITS +++ b/CREDITS @@ -138,4 +138,7 @@ GCC/Linux fixes for the SimpleOpenGL sample. Bugfix for a compiler fix for iOS on arm. - Séverin Lemaignan -Rewrite of PyAssimp, distutils and Python3 support \ No newline at end of file +Rewrite of PyAssimp, distutils and Python3 support + +- albert-wang +Bugfixes for the collada parser \ No newline at end of file diff --git a/code/ColladaParser.cpp b/code/ColladaParser.cpp index 195d0d7ca..41aaee320 100644 --- a/code/ColladaParser.cpp +++ b/code/ColladaParser.cpp @@ -2231,7 +2231,13 @@ void ColladaParser::ExtractDataObjectFromChannel( const InputChannel& pInput, si pMesh->mColors[pInput.mIndex].insert( pMesh->mColors[pInput.mIndex].end(), pMesh->mPositions.size() - pMesh->mColors[pInput.mIndex].size() - 1, aiColor4D( 0, 0, 0, 1)); - pMesh->mColors[pInput.mIndex].push_back( aiColor4D( obj[0], obj[1], obj[2], obj[3])); + //pMesh->mColors[pInput.mIndex].push_back( aiColor4D( obj[0], obj[1], obj[2], obj[3])); + aiColor4D result(0, 0, 0, 1); + for (size_t i = 0; i < pInput.mResolved->mSize; ++i) + { + result[i] = obj[pInput.mResolved->mSubOffset[i]]; + } + pMesh->mColors[pInput.mIndex].push_back(result); } else { DefaultLogger::get()->error("Collada: too many vertex color sets. Skipping.");