Browse Source

added a check for invalid boneIndex caused by geometry key animation

Lumak 9 năm trước cách đây
mục cha
commit
79f1a1bdcd
1 tập tin đã thay đổi với 7 bổ sung0 xóa
  1. 7 0
      Source/Tools/AssetImporter/AssetImporter.cpp

+ 7 - 0
Source/Tools/AssetImporter/AssetImporter.cpp

@@ -1324,6 +1324,13 @@ void BuildAndSaveAnimations(OutModel* model)
                         continue;
 
                     boneIndex = GetPivotlessBoneIndex(*model, channelName);
+                    if (boneIndex == M_MAX_UNSIGNED)
+                    {
+                        PrintLine("Warning: skipping animation track " + channelName + " not found in model skeleton");
+                        outAnim->RemoveTrack(channelName);
+                        continue;
+                    }
+
                     boneNode = model->pivotlessBones_[boneIndex];
                 }
                 isRootBone = boneIndex == 0;