vpenades / SharpGLTF

glTF reader and writer for .NET Standard
MIT License
454 stars 72 forks source link

System.ArgumentException: ' Parameter name: _Slicer' - No Items on the IndexAccessor #151

Closed gotoarchi closed 1 year ago

gotoarchi commented 1 year ago

https://github.com/vpenades/SharpGLTF/blob/fdcd1b2a453472358ee3f5aa4c6edb0f329dd21d/src/SharpGLTF.Core/Memory/MemoryAccessor.cs#L428

When we load the following sample GLTF https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/Buggy/glTF we are getting an exception on L428 when trying to access the Items of the IndexAccessor for most of the LogicalMeshes. Please look on the image under:

SharpGLTF

vpenades commented 1 year ago

What was failing was the debugger proxy that was incorrectly displaying index data as vertex data. This has no effect in production code.

In case you want to get the index data from an accessor, use .AsIndicesArray();