Creating UV seams using the Blender Python API

We can mark and clear UV seams on the mesh geometry either manually, with the Mark Seam/Clear Seam operator, or using the Blender Python API.

To create a UV seam along the desired edges, first let’s create a BMesh object and copy the geometry of the active object into it.

These commands must be executed when the object is in edit mode.

Whether each edge is part of a UV seam is determined by its “seam” property. If the edge’s seam value is True, the UV seam passes along this edge, if it is False, there are no UV seams on this edge.

We can get a list of all edges on which the UV seams are marked.

The value of the “seam” parameter can be edited directly, to mark or clear a UV seam on the current edge.

For example, let’s assign a UV seam to all selected edges, and remove it from all other edges.

Now transfer the changes made back to the geometry of the active mesh, and clear the BMesh object to see the result.

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comment
Inline Feedbacks
View all comments