From e3e52a7808655b3619cdfd9b22ed2bee2bb753a8 Mon Sep 17 00:00:00 2001 From: bjorn Date: Sat, 18 May 2019 00:30:43 -0700 Subject: [PATCH] Fix issue when animated model has no animator; --- src/graphics/model.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/graphics/model.c b/src/graphics/model.c index cff1ae6f..6e2fbe2c 100644 --- a/src/graphics/model.c +++ b/src/graphics/model.c @@ -27,8 +27,10 @@ static void renderNode(Model* model, uint32_t nodeIndex, int instances) { mat4 globalTransform = model->globalNodeTransforms + 16 * nodeIndex; if (node->primitiveCount > 0) { + bool animated = node->skin >= 0 && model->animator; float pose[16 * MAX_BONES]; - if (node->skin >= 0 && model->animator) { + + if (animated) { ModelSkin* skin = &model->data->skins[node->skin]; for (uint32_t j = 0; j < skin->jointCount; j++) { @@ -63,7 +65,7 @@ static void renderNode(Model* model, uint32_t nodeIndex, int instances) { .rangeStart = rangeStart, .rangeCount = rangeCount, .instances = instances, - .pose = node->skin >= 0 ? pose : NULL + .pose = animated ? pose : NULL }, .drawMode = primitive->mode, .transform = globalTransform,