File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Penumbra/Import/Models/Export Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -214,10 +214,18 @@ uint attributeMask
214214 var morphBuilder = meshBuilder . UseMorphTarget ( shapeNames . Count ) ;
215215 shapeNames . Add ( shape . ShapeName ) ;
216216
217- foreach ( var shapeValue in shapeValues )
217+ foreach ( var ( shapeValue , shapeValueIndex ) in shapeValues . WithIndex ( ) )
218218 {
219+ var gltfIndex = gltfIndices [ shapeValue . BaseIndicesIndex - indexBase ] ;
220+
221+ if ( gltfIndex == - 1 )
222+ {
223+ _notifier . Warning ( $ "{ name } : Shape { shape . ShapeName } mapping { shapeValueIndex } targets a degenerate triangle, ignoring.") ;
224+ continue ;
225+ }
226+
219227 morphBuilder . SetVertex (
220- primitiveVertices [ gltfIndices [ shapeValue . BaseIndicesIndex - indexBase ] ] . GetGeometry ( ) ,
228+ primitiveVertices [ gltfIndex ] . GetGeometry ( ) ,
221229 vertices [ shapeValue . ReplacingVertexIndex ] . GetGeometry ( )
222230 ) ;
223231 }
You can’t perform that action at this time.
0 commit comments