Hello,
I'm currently working on a tool and i'm stuck at understanding how the vertex data works in the json file.
Without getting into too much details, i would like to read data from the json file exported from spine to unity to rebuild the mesh in a 3D software using uv coordinates from the atlas generated by spine.
The goal is to bake several other textures using the same atlas coordinates from spine after the asset is done with animation.
I had no problem creating the card used for rigid parts of the assets and match the uvs but i have difficulties understanding vertices data for skinned geometry.
I seems to me that there is a sequence of 4 or 5 number:
2 int or sometime one which i think are bone influence,
then 2 floats which i think are x and y coordinates
and a float between 0 and 1, which i belive is weight between two bone influences ?
"vertices": [2, 2, -9.8, 103.38, 0.5, 4, 37.82, 27.79, 0.5, 2, 2, -3.82, 100.39, 0.5, 4, 42.16, 22.71, 0.5 ...
By ignoring what i think is bone influence data i can create a mesh that kinda have the expected shape, but there is much more vertices than in spine and triangle index is all wrong.
Is there an example somewhere so i can understand how to import vertex coordinates ? i tried looking into the unity plugin but i couldn't find where vertices are processed (i looked mainly into MeshGenerator.cs )
if i can't make sense of the vertices, i think i can make a simple bounding box with min and max coordinates because i don't need to import the complete animation and deformation, but it would be nicer to have a matching mesh.
Thank you for reading me 🙂
I made a little bit of progress, if i ignore sequences of vertices that start by a single int instead of two i almost have the correct geometry, except a couple random ones out of place.