closes https://github.com/assimp/assimp/issues/2548: check if weight are set or set the weight to 1.0f

pull/2549/head
kimkulling 2019-07-16 11:40:34 +02:00
parent b344beb00b
commit c1670b6a97
1 changed files with 7 additions and 3 deletions

View File

@ -772,10 +772,14 @@ aiMesh* ColladaLoader::CreateMesh( const ColladaParser& pParser, const Collada::
for( size_t b = 0; b < pairCount; ++b, ++iit) for( size_t b = 0; b < pairCount; ++b, ++iit)
{ {
size_t jointIndex = iit->first;
size_t vertexIndex = iit->second;
ai_real weight = ReadFloat( weightsAcc, weights, vertexIndex, 0); const size_t jointIndex = iit->first;
const size_t vertexIndex = iit->second;
ai_real weight = 1.0f;
if (!weights.mValues.empty()) {
weight = ReadFloat(weightsAcc, weights, vertexIndex, 0);
}
// one day I gonna kill that XSI Collada exporter // one day I gonna kill that XSI Collada exporter
if( weight > 0.0f) if( weight > 0.0f)