mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 17:24:24 +02:00
Conditionally apply ReadyPlayerMe synonyms
This commit is contained in:
parent
a6d8e150f0
commit
f4af0be95b
1 changed files with 22 additions and 9 deletions
|
@ -1571,17 +1571,30 @@ bool GLTFSerializer::buildGeometry(HFMModel& hfmModel, const hifi::VariantHash&
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Augment list of blendshapes from synonyms in model.
|
// If an FST isn't being used and the model is likely from ReadyPlayerMe, add blendshape synonyms.
|
||||||
QMap<QString, QPair<QString, float>>::const_iterator synonym = READYPLAYERME_BLENDSHAPES_MAP.constBegin();
|
auto fileTargetNames = _file.meshes[node.mesh].extras.targetNames;
|
||||||
while (synonym != READYPLAYERME_BLENDSHAPES_MAP.constEnd()) {
|
bool likelyReadyPlayerMeFile =
|
||||||
if (_file.meshes[node.mesh].extras.targetNames.contains(synonym.key())) {
|
fileTargetNames.contains("browOuterUpLeft")
|
||||||
auto blendshape = BLENDSHAPE_LOOKUP_MAP.find(synonym.value().first);
|
&& fileTargetNames.contains("browInnerUp")
|
||||||
if (blendshape != BLENDSHAPE_LOOKUP_MAP.end()) {
|
&& fileTargetNames.contains("browDownLeft")
|
||||||
blendshapeIndices.insert(synonym.key(),
|
&& fileTargetNames.contains("eyeBlinkLeft")
|
||||||
WeightedIndex(blendshape.value(), synonym.value().second));
|
&& fileTargetNames.contains("eyeWideLeft")
|
||||||
|
&& fileTargetNames.contains("mouthLeft")
|
||||||
|
&& fileTargetNames.contains("viseme_O")
|
||||||
|
&& fileTargetNames.contains("mouthShrugLower");
|
||||||
|
if (fileTargetNames.count() == 0 && likelyReadyPlayerMeFile) {
|
||||||
|
QMap<QString, QPair<QString, float>>::const_iterator synonym
|
||||||
|
= READYPLAYERME_BLENDSHAPES_MAP.constBegin();
|
||||||
|
while (synonym != READYPLAYERME_BLENDSHAPES_MAP.constEnd()) {
|
||||||
|
if (fileTargetNames.contains(synonym.key())) {
|
||||||
|
auto blendshape = BLENDSHAPE_LOOKUP_MAP.find(synonym.value().first);
|
||||||
|
if (blendshape != BLENDSHAPE_LOOKUP_MAP.end()) {
|
||||||
|
blendshapeIndices.insert(synonym.key(),
|
||||||
|
WeightedIndex(blendshape.value(), synonym.value().second));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
++synonym;
|
||||||
}
|
}
|
||||||
++synonym;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create blendshapes.
|
// Create blendshapes.
|
||||||
|
|
Loading…
Reference in a new issue