mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 07:12:40 +02:00
Merge pull request #773 from ctrlaltdavid/fix/gltf-crash
Fix handling of missing glTF blendshape target meshes
This commit is contained in:
commit
3a665c6eac
1 changed files with 5 additions and 1 deletions
|
@ -1586,12 +1586,16 @@ bool GLTFSerializer::buildGeometry(HFMModel& hfmModel, const hifi::VariantHash&
|
|||
int targetIndex = weightedIndex;
|
||||
hfmModel.blendshapeChannelNames.push_back("target_" + QString::number(weightedIndex));
|
||||
|
||||
if (!names.isEmpty() && names.contains(keys[weightedIndex])) {
|
||||
if (!names.isEmpty()) {
|
||||
targetIndex = names.indexOf(keys[weightedIndex]);
|
||||
if (targetIndex == -1) {
|
||||
continue; // Ignore blendshape targets not present in glTF file.
|
||||
}
|
||||
indexFromMapping = values[weightedIndex].first;
|
||||
weight = values[weightedIndex].second;
|
||||
hfmModel.blendshapeChannelNames[weightedIndex] = keys[weightedIndex];
|
||||
}
|
||||
|
||||
HFMBlendshape& blendshape = mesh.blendshapes[indexFromMapping];
|
||||
auto target = primitive.targets[targetIndex];
|
||||
|
||||
|
|
Loading…
Reference in a new issue