Sub topic 12
Marking Seams Faster: Sharp Edges and Scripts
This chapter assumes that you can navigate the 3D Viewport, switch between Object Mode and Edit Mode, and select mesh edges. You should also know that seams are cuts Blender uses when it flattens a mesh into UV islands.
Use sharp angles as a starting point
Complex hard-surface models often contain many edges that separate large faces. Marking these edges manually can take time. A sharp-angle workflow finds edges where adjacent faces meet at a steep angle and marks them as seams.
A sharp angle is not automatically a seam. Blender stores “sharp” and “seam” as separate edge properties. The angle is only a useful rule for choosing likely seam locations. You must still inspect the result and remove seams that create unnecessary islands.
| Method | Best use | Main risk |
|---|---|---|
| Manual selection | Important visible edges | Slow on dense meshes |
| Sharp-angle rule | Hard-surface starting point | Too many small islands |
| Scripted selection | Repeatable custom rules | Requires careful mesh context |
The following script marks every edge whose adjacent faces meet at more than 60 degrees. Boundary edges have only one adjacent face, so the script skips them.
import math
import bpy
import bmesh
obj = bpy.context.edit_object
bm = bmesh.from_edit_mesh(obj.data)
threshold = math.radians(60)
for edge in bm.edges:
angle = edge.calc_face_angle(None)
if angle is not None and angle > threshold:
edge.seam = True
bmesh.update_edit_mesh(obj.data)Run this with the target object active and in Edit Mode. In the Scripting workspace, paste the code into a text block and run it. Return to the UV Editing workspace and inspect the resulting islands.
A lower threshold marks more edges. A higher threshold marks only stronger changes in direction. Start with a moderate value, such as 45 to 60 degrees, then adjust it for the model.
Mark only selected edges with a script
You can combine manual judgment with scripting. First select a group of edges in Edit Mode. Then run this script to mark only those selected edges:
import bpy
import bmesh
obj = bpy.context.edit_object
bm = bmesh.from_edit_mesh(obj.data)
for edge in bm.edges:
if edge.select:
edge.seam = True
bmesh.update_edit_mesh(obj.data)This approach is useful when edge selection uses a built-in tool, such as Select Sharp Edges, Select Similar, or a loop selection. You choose the region visually, while the script applies the seam property consistently.
To clear seams from a selected group, change edge.seam = True to edge.seam = False. This lets you correct an automated pass without removing seams from the entire object.
A repeatable seam workflow
Automation works best when followed by visual inspection. A rule based only on angle does not understand which surfaces are visible, which edges should remain continuous, or where a texture pattern must align.
Exercise
Why should you inspect and edit seams after running a sharp-angle script?
Show answer
The script detects geometry changes, but it does not know which cuts are visually hidden, which surfaces should stay together, or where texture continuity matters.