In spine version 4.1.24, the vertex positions of the exported json are disordered because the bounding box function has been refreshed due to weight. How to solve it?
Bounding box function vertex positions are messed up
biandeyue Do you mean that the position of the vertices of the bounding box is now wrong after the version upgrade? If so, can you tell us which version you upgraded from? Or did you create the bounding box first and then set the weights and it became distorted? It is hard to tell much about your condition from the initial post you made, so please give us some more details.
Here you can find the JSON format documentation. As explained in the "bounding box attachment attributes" section, the vertices
field contains:
For each vertex either an x,y pair or, for a weighted bounding box, first the number of bones which influence the vertex, then for that many bones: bone index, bind position X, bind position Y, weight. A bounding box is weighted if the number of vertices > vertex count.
What do you use to get the vertex position? To get the vertex position, you can use computeWorldVertices
since a BoundingBoxAttachment
is simply a VertexAttachment
. Make sure to provide the worldVerticesLength
parameter, which contains the actual number of vertices.