From 20605f5a3e9a2f2c8b7b45cd6d2244b3952a0388 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Arnaud?= Date: Wed, 22 Oct 2025 20:58:37 -0700 Subject: [PATCH] glTF import plugin preserves joint names simply use the USD node name instead of creating new names --- gltf/src/gltfImport.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gltf/src/gltfImport.cpp b/gltf/src/gltfImport.cpp index 32742f0..8570fc3 100644 --- a/gltf/src/gltfImport.cpp +++ b/gltf/src/gltfImport.cpp @@ -1579,7 +1579,7 @@ importMeshes(ImportGltfContext& ctx) // Import skeletons from gltf. // First traverses all glTF nodes in the scene, to construct names appropriate for UsdSkel API // consumption (for the Skeleton::joints attribute), of the form: -// n0/n1/n2... +// rootJoint/childJoint1/childJoint2... // Then traverses all glTF skins and assembles skeleton data in the Usdata cache. // This doesn't specify instantiation of any skeletons, which is done by importNodes. // It's ok that importNodes runs before this one, because the skins and skeletons counts are @@ -1591,7 +1591,7 @@ importSkeletons(ImportGltfContext& ctx) std::function buildSkeletonNodeNames; buildSkeletonNodeNames = [&](int parentIndex, int nodeIndex) { const tinygltf::Node& node = ctx.gltf->nodes[nodeIndex]; - std::string name = "n" + std::to_string(nodeIndex); + std::string name = node.name; ctx.skeletonNodeNames[nodeIndex] = parentIndex >= 0 ? ctx.skeletonNodeNames[parentIndex] + "/" + name : name; for (size_t i = 0; i < node.children.size(); i++) {