Hello!
I've come across an error with a certain spine skeleton when using a SkeletonPartsRenderer to display it in Unity, with tangents enabled. Unity errors due to a tangent array being assigned to the mesh which has a different size to the verts.
In this skeleton certain slots/images have been keyed as 'off' in some of the animations, and the draw order is being manipulated per-animation (I'm not sure which of these factors is the actual cause, but I believe it's one of them). The error is occuring when swapping animations in Unity (even in editor when not playing).
Having looked into the code, it seems to me that issue lies in SkeletonPartsRenderer.cs : RenderParts().
When it applies the geometry information to the mesh, it checks to see if the mesh generator has no verts, and, if so, it triggers a mesh.Clear(). However, after this it then calls meshGenerator.FillLateVertexData() which applies a tangent array (the size of the vert buffer) to the mesh. However, with the mesh being cleared, it has zero verts, and Unity errors because the size of the tangent array does not match that of the vert buffer applied to the mesh. (Even in the case where there are no verts, the vert buffer, and therefore the tangent buffer, have non-zero size).
I have managed to resolve this by moving the call to meshGenerator.FillLateVertexData() up into the else before it, meaning it only runs when the mesh has not just been cleared.
I would appreciate getting a more experienced perspective on the issue / my fix as I've not spent a huge amount of time in the Spine code and could be missing something here.
Thanks!