add check for models that were missed during BindGLTFPrimitiveToBones to not segfault the program

This commit is contained in:
MrDiver 2021-08-29 20:54:33 +02:00
parent ed0c5e09cf
commit 04d2219bea

View File

@ -1615,6 +1615,10 @@ void UpdateModelAnimation(Model model, ModelAnimation anim, int frame)
for (int m = 0; m < model.meshCount; m++) for (int m = 0; m < model.meshCount; m++)
{ {
Mesh mesh = model.meshes[m]; Mesh mesh = model.meshes[m];
if(mesh.boneIds == NULL || mesh.boneWeights == NULL){
TRACELOG(LOG_WARNING, "MODEL: UpdateModelAnimation Mesh %i has no connection to bones",m);
continue;
}
bool updated = false; // set to true when anim vertex information is updated bool updated = false; // set to true when anim vertex information is updated
Vector3 animVertex = { 0 }; Vector3 animVertex = { 0 };
Vector3 animNormal = { 0 }; Vector3 animNormal = { 0 };