mirror of
https://github.com/JulianGro/overte.git
synced 2025-05-07 05:09:09 +02:00
Merge pull request #15159 from dback2/jointOffset2RenamingFix
Case 21669: Fix joint renaming with jointRotationOffset2
This commit is contained in:
commit
2cf7462fbc
1 changed files with 11 additions and 10 deletions
|
@ -101,23 +101,24 @@ void PrepareJointsTask::run(const baker::BakeContextPointer& context, const Inpu
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newJointRot) {
|
if (newJointRot) {
|
||||||
for (const auto& jointIn : jointsIn) {
|
for (auto& jointOut : jointsOut) {
|
||||||
|
|
||||||
auto jointNameMapKey = jointNameMapping.key(jointIn.name);
|
auto jointNameMapKey = jointNameMapping.key(jointOut.name);
|
||||||
int mappedIndex = jointIndices.value(jointIn.name);
|
int mappedIndex = jointIndices.value(jointOut.name);
|
||||||
if (jointNameMapping.contains(jointNameMapKey)) {
|
if (jointNameMapping.contains(jointNameMapKey)) {
|
||||||
|
|
||||||
// delete and replace with hifi name
|
// delete and replace with hifi name
|
||||||
jointIndices.remove(jointIn.name);
|
jointIndices.remove(jointOut.name);
|
||||||
jointIndices.insert(jointNameMapKey, mappedIndex);
|
jointOut.name = jointNameMapKey;
|
||||||
|
jointIndices.insert(jointOut.name, mappedIndex);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// nothing mapped to this fbx joint name
|
// 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
|
// but the name is in the list of hifi names is mapped to a different joint
|
||||||
int extraIndex = jointIndices.value(jointIn.name);
|
int extraIndex = jointIndices.value(jointOut.name);
|
||||||
jointIndices.remove(jointIn.name);
|
jointIndices.remove(jointOut.name);
|
||||||
jointIndices.insert("", extraIndex);
|
jointOut.name = "";
|
||||||
|
jointIndices.insert(jointOut.name, extraIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue