From f0bf87b3c33fe27a6e1c5d6ae1c2a42811abb05c Mon Sep 17 00:00:00 2001 From: David Back Date: Mon, 11 Mar 2019 17:59:48 -0700 Subject: [PATCH] fix joint out not being renamed with jointRotationOffset2 --- .../src/model-baker/PrepareJointsTask.cpp | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/libraries/model-baker/src/model-baker/PrepareJointsTask.cpp b/libraries/model-baker/src/model-baker/PrepareJointsTask.cpp index b8bcdb386e..a746b76c1f 100644 --- a/libraries/model-baker/src/model-baker/PrepareJointsTask.cpp +++ b/libraries/model-baker/src/model-baker/PrepareJointsTask.cpp @@ -101,23 +101,24 @@ void PrepareJointsTask::run(const baker::BakeContextPointer& context, const Inpu } if (newJointRot) { - for (const auto& jointIn : jointsIn) { + for (auto& jointOut : jointsOut) { - auto jointNameMapKey = jointNameMapping.key(jointIn.name); - int mappedIndex = jointIndices.value(jointIn.name); + auto jointNameMapKey = jointNameMapping.key(jointOut.name); + int mappedIndex = jointIndices.value(jointOut.name); if (jointNameMapping.contains(jointNameMapKey)) { - // delete and replace with hifi name - jointIndices.remove(jointIn.name); - jointIndices.insert(jointNameMapKey, mappedIndex); + jointIndices.remove(jointOut.name); + jointOut.name = jointNameMapKey; + jointIndices.insert(jointOut.name, mappedIndex); } else { // nothing mapped to this fbx joint name - if (jointNameMapping.contains(jointIn.name)) { + if (jointNameMapping.contains(jointOut.name)) { // but the name is in the list of hifi names is mapped to a different joint - int extraIndex = jointIndices.value(jointIn.name); - jointIndices.remove(jointIn.name); - jointIndices.insert("", extraIndex); + int extraIndex = jointIndices.value(jointOut.name); + jointIndices.remove(jointOut.name); + jointOut.name = ""; + jointIndices.insert(jointOut.name, extraIndex); } } }