From c1670b6a97dc91f7176afc16e21922a4c633bb95 Mon Sep 17 00:00:00 2001 From: kimkulling Date: Tue, 16 Jul 2019 11:40:34 +0200 Subject: [PATCH] closes https://github.com/assimp/assimp/issues/2548: check if weight are set or set the weight to 1.0f --- code/Collada/ColladaLoader.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/code/Collada/ColladaLoader.cpp b/code/Collada/ColladaLoader.cpp index 81db957d5..8d4570da8 100644 --- a/code/Collada/ColladaLoader.cpp +++ b/code/Collada/ColladaLoader.cpp @@ -772,10 +772,14 @@ aiMesh* ColladaLoader::CreateMesh( const ColladaParser& pParser, const Collada:: 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 if( weight > 0.0f)