Python

How to create a new mesh UV with the Blender Python API

To make a new UV with the Python API and set coordinates to its points, we need:

First – create a new UV with the desired name:

Next, to specify the coordinates of its points, we need to cycle through all the “loops” of the mesh:

How to get a list of UV coordinates

You may need to get a list of coordinates of the mesh’s UV, for example, when exporting a mesh from Blender’s internal format to any external formats.

A list of the mesh UV-s can be got by accessing the “uv_layers” structure: