3
$\begingroup$

I'm currently writing an import script/addon.

The file format is one vertex per line: x, y, z, u, v With 3 lines for each triangle (no quads).

So far I've got vertex's, edges and faces all importing correctly.

Now I just need to import the UV coordinates for each vertex.

However I'm having trouble trying to find a way to do this.

The best result so far was copying code from the UV operator template, which gave me a UV Map, but it puts the whole model at one point.

$\endgroup$
  • $\begingroup$ You'll probably find looking at other import scripts helpful - in the obj script I see me.tessface_uv_textures.new() blender_tface = me.tessface_uv_textures[0].data[i] and blender_tface.uv1 = verts_tex[face_vert_tex_indices[0]] $\endgroup$ – sambler Dec 18 '13 at 11:48
  • $\begingroup$ I posted an example on blenderartists.org, which assumes you use polys/loops for your mesh import: Importing UV coordinates $\endgroup$ – CoDEmanX Dec 18 '13 at 15:11
  • $\begingroup$ @CoDEmanX this is a rather good question. perhaps your post on BA could be summarized here. $\endgroup$ – ideasman42 May 16 '14 at 14:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.