Browse Source

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
kimmi 12 years ago
parent
commit
30ce13a617
2 changed files with 11 additions and 2 deletions
  1. 4 1
      CREDITS
  2. 7 1
      code/ColladaParser.cpp

+ 4 - 1
CREDITS

@@ -138,4 +138,7 @@ GCC/Linux fixes for the SimpleOpenGL sample.
 Bugfix for a compiler fix for iOS on arm.
 Bugfix for a compiler fix for iOS on arm.
 
 
 - Séverin Lemaignan
 - Séverin Lemaignan
-Rewrite of PyAssimp, distutils and Python3 support
+Rewrite of PyAssimp, distutils and Python3 support
+
+- albert-wang
+Bugfixes for the collada parser

+ 7 - 1
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->mColors[pInput.mIndex].insert( pMesh->mColors[pInput.mIndex].end(), 
             pMesh->mPositions.size() - pMesh->mColors[pInput.mIndex].size() - 1, aiColor4D( 0, 0, 0, 1));
             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 
       } else 
       {
       {
 				DefaultLogger::get()->error("Collada: too many vertex color sets. Skipping.");
 				DefaultLogger::get()->error("Collada: too many vertex color sets. Skipping.");