I'm trying to write a mesh exporter that can export vertex colors (color attributes). On the default cube, I've found the Blender counts 8 regular vertices wherein it stores 24 color attributes.
I assume the attributes consider the faces in a separate context and a vertex shared between multiple faces as unique within that context. Shown by how painting on one corner will have the value appear three times in the color attributes list.
Vertices
1 1.0 1.0 1.0
2 1.0 1.0 -1.0
3 1.0 -1.0 1.0
4 1.0 -1.0 -1.0
5 -1.0 1.0 1.0
6 -1.0 1.0 -1.0
7 -1.0 -1.0 1.0
8 -1.0 -1.0 -1.0
Colour Attributes
1 [1.0, 1.0, 1.0, 1.0]
2 [1.0, 1.0, 1.0, 1.0]
3 [1.0, 1.0, 1.0, 1.0]
4 [1.0, 0.015996292233467102, 0.02732088789343834, 1.0]
5 [1.0, 1.0, 1.0, 1.0]
6 [1.0, 0.015996292233467102, 0.02732088789343834, 1.0]
7 [1.0, 1.0, 1.0, 1.0]
8 [1.0, 1.0, 1.0, 1.0]
9 [1.0, 1.0, 1.0, 1.0]
10 [1.0, 1.0, 1.0, 1.0]
11 [1.0, 1.0, 1.0, 1.0]
12 [1.0, 1.0, 1.0, 1.0]
13 [1.0, 1.0, 1.0, 1.0]
14 [1.0, 1.0, 1.0, 1.0]
15 [1.0, 1.0, 1.0, 1.0]
16 [1.0, 1.0, 1.0, 1.0]
17 [1.0, 1.0, 1.0, 1.0]
18 [1.0, 1.0, 1.0, 1.0]
19 [1.0, 0.015996292233467102, 0.02732088789343834, 1.0]
20 [1.0, 1.0, 1.0, 1.0]
21 [1.0, 1.0, 1.0, 1.0]
22 [1.0, 1.0, 1.0, 1.0]
23 [1.0, 1.0, 1.0, 1.0]
24 [1.0, 1.0, 1.0, 1.0]
What I want to know is how to map these different color attribute vertices to the main positional vertices.