From 34afb0867317846cf51ba29e30b31bf73b3fdc73 Mon Sep 17 00:00:00 2001 From: ink-soul Date: Thu, 1 Jun 2023 15:56:40 +0800 Subject: [PATCH] feature: load model dynamicly is available bug fix : crush when loading model with no animation bug : crush when loading model with no materials info --- src/render/render.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/render/render.cpp b/src/render/render.cpp index 6970e14..311320e 100644 --- a/src/render/render.cpp +++ b/src/render/render.cpp @@ -1620,8 +1620,11 @@ if (camera.updated) { updateUniformBuffers(); } - if(!paused) + if (!paused && glTFModel.animations.size() > 0) + { glTFModel.updateAnimation(frameTimer, shaderData.skinSSBO); + } + } void VulkanExample::viewChanged() @@ -1659,7 +1662,8 @@ GUIFunction guiFunc{}; std::string strModelFilePath; strModelFilePath = guiFunc.openFileFolderDialog(); - std::cout << strModelFilePath << std::endl; + filePath.glTFModelFilePath = strModelFilePath; + loadAssets(); } } }