mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
fix joint out not being renamed with jointRotationOffset2
This commit is contained in:
parent
4add8c1777
commit
f0bf87b3c3
1 changed files with 11 additions and 10 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue