From 6d13bfa407b4152eb2d4efb52e33942481bb1f9a Mon Sep 17 00:00:00 2001 From: lisyarus Date: Sat, 8 Jun 2024 17:32:57 +0300 Subject: [PATCH] Load gltf skin names --- libs/gfx/include/psemek/gfx/gltf_parser.hpp | 1 + libs/gfx/source/gltf_parser.cpp | 3 +++ 2 files changed, 4 insertions(+) diff --git a/libs/gfx/include/psemek/gfx/gltf_parser.hpp b/libs/gfx/include/psemek/gfx/gltf_parser.hpp index 1a117e31..3c6bd2c8 100644 --- a/libs/gfx/include/psemek/gfx/gltf_parser.hpp +++ b/libs/gfx/include/psemek/gfx/gltf_parser.hpp @@ -80,6 +80,7 @@ namespace psemek::gfx { std::vector joints; std::optional inverse_bind_matrices; // accessor + std::string name; }; struct animation diff --git a/libs/gfx/source/gltf_parser.cpp b/libs/gfx/source/gltf_parser.cpp index 932368a2..6e04abf3 100644 --- a/libs/gfx/source/gltf_parser.cpp +++ b/libs/gfx/source/gltf_parser.cpp @@ -303,6 +303,9 @@ namespace psemek::gfx if (skin.HasMember("inverseBindMatrices")) target.inverse_bind_matrices = skin["inverseBindMatrices"].GetUint64(); + + if (skin.HasMember("name")) + target.name = skin["name"].GetString(); } if (document.HasMember("animations")) for (auto const & animation : document["animations"].GetArray())