I need to create a mesh by reading a custom file format.
I have a list of vertices, faces and uvs.
So far I am able to create a mesh with vertices and faces with the following script:
import bpy import bmesh # verts = [...] # uvs = [...] # faces = [...] mesh_data = bpy.data.meshes.new("cube_mesh_data") mesh_data.from_pydata(verts, , faces) mesh_data.update() obj = bpy.data.objects.new("My_Object", mesh_data) scene = bpy.context.scene scene.collection.objects.link(obj) obj.select_set(state=True)
However, I cannot find a way to assign the UV array to the vertices. UV is a list of pair of floats with the same length as verts. I have looked online but couldn't find any solution.
Any tips or resources I could read? Thank you very much!