Look at the
.itemSize property of the
skinWeights attribute. It’s probably four (4). This means that each 4 sequential entries in the underlying array provide bone indices and bone weights for a single vertex. The BufferAttribute helper methods make it easier to manage those in the correct groupings. To get the skin indices and weights for the Nth vertex in your geometry, you would call:
const vertexIndex = 40; // 40th vertex in `geometry.attributes.position`
const skinIndex = new Vector4()
.fromBufferAttribute( mesh.geometry.attributes.skinIndex, n );
const skinWeights = new Vector4()
.fromBufferAttribute( mesh.geometry.attributes.skinWeights, n );
With that code,
skinIndex.toArray() will give the indices of up to four bones that influence the Nth vertex. And
skinWeights.toArray() will give the weights for each of those bones. Some weights may be zero, if the vertex is affected by fewer than four bones.
This also means that bones are not bound to any particular vertex — it’s the opposite. A single bone could influence any number of vertices, but vertices are only affected by 1-4 bones.