From 04d2219bea77e86870c695c949153c2ba4b38754 Mon Sep 17 00:00:00 2001 From: MrDiver Date: Sun, 29 Aug 2021 20:54:33 +0200 Subject: [PATCH] add check for models that were missed during BindGLTFPrimitiveToBones to not segfault the program --- src/models.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/models.c b/src/models.c index f6a0c4eca..3d0ded5e8 100644 --- a/src/models.c +++ b/src/models.c @@ -1615,6 +1615,10 @@ void UpdateModelAnimation(Model model, ModelAnimation anim, int frame) for (int m = 0; m < model.meshCount; 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 Vector3 animVertex = { 0 }; Vector3 animNormal = { 0 };