Browse Source

Merge pull request #2549 from assimp/issue_2548

closes https://github.com/assimp/assimp/issues/2548: check if weight …
Kim Kulling 6 năm trước cách đây
mục cha
commit
fed764d2a8
1 tập tin đã thay đổi với 7 bổ sung3 xóa
  1. 7 3
      code/Collada/ColladaLoader.cpp

+ 7 - 3
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)
             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)