mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-13 12:14:17 +01:00
Skip degenerate triangles targeted by shape keys
This commit is contained in:
parent
c1cdb28bb5
commit
1cee1c24ec
1 changed files with 10 additions and 2 deletions
|
|
@ -214,10 +214,18 @@ public class MeshExporter
|
||||||
var morphBuilder = meshBuilder.UseMorphTarget(shapeNames.Count);
|
var morphBuilder = meshBuilder.UseMorphTarget(shapeNames.Count);
|
||||||
shapeNames.Add(shape.ShapeName);
|
shapeNames.Add(shape.ShapeName);
|
||||||
|
|
||||||
foreach (var shapeValue in shapeValues)
|
foreach (var (shapeValue, shapeValueIndex) in shapeValues.WithIndex())
|
||||||
{
|
{
|
||||||
|
var gltfIndex = gltfIndices[shapeValue.BaseIndicesIndex - indexBase];
|
||||||
|
|
||||||
|
if (gltfIndex == -1)
|
||||||
|
{
|
||||||
|
_notifier.Warning($"{name}: Shape {shape.ShapeName} mapping {shapeValueIndex} targets a degenerate triangle, ignoring.");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
morphBuilder.SetVertex(
|
morphBuilder.SetVertex(
|
||||||
primitiveVertices[gltfIndices[shapeValue.BaseIndicesIndex - indexBase]].GetGeometry(),
|
primitiveVertices[gltfIndex].GetGeometry(),
|
||||||
vertices[shapeValue.ReplacingVertexIndex].GetGeometry()
|
vertices[shapeValue.ReplacingVertexIndex].GetGeometry()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue