For my b3d exporter i’d need to export the uv coord for each vertex…
I’ve made some tests… but I can’t understand why Blender give me much more than one couple of uv coord per vertex… I have only a cube with only 2 triangles textured with only a uv layer… and when I loop trought the faces verts, for every vert it give me 2 or 3 couple of uv coord…
For b3d format I must save per vertex only one uv coord set and so… with all these coord sets I can’t understand which I need…
I would not write the same vertex for every uv set… increasing the number of vertexes for mesh… because when I will add support for multiuv the situation will be worst…
Can anyone help me… suggesting me some code to solve the problem?
for formats that require each vertex to have a UV, you need to split the verts that have different UV’s
See the Cal3d exporter that comes with blender 2.44.
yes, i’ve seen it but i can’t understand much…
What you mean for “split vertex” ? I must write the same vertex many times how are the couples of uv of that vertex?
yep, this is common for game/realtime formats since OpenGL and DirectX have their UV’s per vert in most (all?) cases.
if you just want to get something working fast export every face with its own verts.
Inefficient of course but it means you can get it working and make sure everything else displays ok.
Then you can look at ways to join them when the UV’s are the same or write in some method of splitting them off (which is faster and uses less ram).