Sub topic 6
Checking for Stretching with a UV Test Grid
This chapter assumes you can move around the Blender 3D viewport, switch between Object Mode and Edit Mode, select vertices, edges and faces, and attach a basic material. You should also have marked seams and run an unwrap, which earlier chapters covered. Here you will learn to judge whether that unwrap is any good.
Why an unwrap can look fine and still be wrong
An unwrap flattens a 3D surface into 2D. Most surfaces cannot be flattened without some change. A sphere is the classic case: you cannot flatten an orange peel without tearing or stretching it. Every unwrap therefore trades one kind of error for another.
Two kinds of error matter for textures:
- Stretching means a face in the UV Editor is a different shape from the same face on the mesh. A square on the model becomes a long thin rectangle in UV space, and the texture smears along that direction.
- Scale mismatch means one face covers more image area than another face of the same size on the mesh. Detail looks sharp in one place and blurry in another. The next chapter covers this under texel density.
The UV Editor shows you island outlines, but a bare outline does not tell you whether a stretched face is a problem. You need a texture with a known pattern. If the pattern looks regular on the model, the unwrap is good. If it looks smeared, pinched or uneven, the unwrap has a fault.
The test grid
Blender can generate an image with a known pattern, so you do not need an external file. The UV Grid generated type draws a grid of squares with a color gradient. The Color Grid type adds letters and numbers in each cell, which helps you tell which direction is up and whether any part is mirrored.
This script creates the image:
import bpy
img = bpy.data.images.new("UVTestGrid", width=1024, height=1024)
img.generated_type = 'UV_GRID'The same result is available in the interface. In the Image Editor, open the New Image panel, set the width and height, and choose Generated Type UV Grid or Color Grid.
A few details about generated images:
- A generated image lives only in the file's data until you save it. If you close Blender without saving the .blend file, it is lost. This is fine for a test grid, which you can recreate in seconds.
- Use a square size such as 1024 by 1024. A non-square image changes how squares appear on the model and makes the test misleading, because the grid squares become rectangles on a stretched aspect ratio.
UV_GRIDandCOLOR_GRIDare the values you set in Python. You can switch an existing generated image between them by changinggenerated_typeagain.
Applying the grid to the mesh
The grid helps only when the model displays it. This requires an Image Texture node connected to the material's Base Color. The earlier chapter on the Image Texture node covered this wiring, and the steps are short:
- Select the object and open the Shader Editor.
- Add an Image Texture node with Shift+A.
- In the node, choose
UVTestGridfrom the image selector. - Connect the node's Color output to the Principled BSDF's Base Color input.
- Switch the 3D viewport to Material Preview shading, or to Rendered, so the texture is visible.
In Solid shading, the viewport can also show image textures if you set Color to Texture in the shading popover. Material Preview is the more reliable choice for this check, since it shows exactly what the material produces.
If the model appears one flat color, check that the object has a UV map. Without one, the node has no coordinates to read. Also check that the material is assigned to the faces you are looking at.
This script does the same job from Python:
import bpy
obj = bpy.context.active_object
img = bpy.data.images.get("UVTestGrid") or bpy.data.images.new(
"UVTestGrid", width=1024, height=1024
)
img.generated_type = 'UV_GRID'
mat = bpy.data.materials.new("UVTestMaterial")
mat.use_nodes = True
nodes = mat.node_tree.nodes
links = mat.node_tree.links
bsdf = nodes["Principled BSDF"]
tex = nodes.new("ShaderNodeTexImage")
tex.image = img
links.new(tex.outputs["Color"], bsdf.inputs["Base Color"])
obj.data.materials.append(mat)The or expression reuses an existing image with that name instead of creating UVTestGrid.001 each time you run the script.
Reading the grid on the model
Look at the model and compare the grid squares across different areas. Use this table to interpret what you see.
| What you see | What it means | Likely cause |
|---|---|---|
| Squares are square and about the same size everywhere | The unwrap is low in distortion and consistent in scale | Good seams and a suitable method |
| Squares are long and thin in one direction | Stretching along that axis | The island is too narrow or too long for the surface it covers |
| Squares are much larger on one part than another | Scale mismatch between islands | Islands were scaled differently |
| Lines bend or fan out near a point | Pinching | A pole or a vertex where many faces meet, with too few seams |
| Pattern changes abruptly along an edge | A seam | Expected at seams, but check it is in a hidden place |
| Letters appear mirrored or upside down | Island is flipped or rotated | Normal for some islands, but a problem for text-like detail |
Rotation of an island does not harm a plain pattern. Stretching and scale do.
Also check the seam lines. At a seam, the grid on one side usually does not line up with the grid on the other. This is expected, because the two sides are different islands. What matters is that the seam sits where the break is hard to see, such as the underside or an inner edge.
The stretch overlay in the UV Editor
You do not need to rely on the model alone. The UV Editor can color faces by how much they differ from the 3D surface.
- Open the UV Editor with the object in Edit Mode.
- Open the Overlays popover in the UV Editor header.
- Turn on Stretch.
- Choose a display type: Angle or Area.
The colors run from blue to red:
- Blue means little or no distortion.
- Green and yellow mean moderate distortion.
- Red means heavy distortion.
The two types measure different things:
| Display type | What it measures | Use it to find |
|---|---|---|
| Angle | How much each face's corner angles differ from the 3D face | Shear and skew, where squares turn into diamonds |
| Area | How much each face's UV area differs from its 3D area | Faces that are too large or too small compared with the others |
A face can have a good angle reading and a poor area reading. Conformal unwrapping aims to preserve angles, so such an unwrap shows blue under Angle even when island sizes differ. This is why you should check both modes.
Fixing what you find
The test grid tells you where the problem is. The fix depends on the cause.
- Long thin stretching on a tube or limb: add a seam along the length so the surface can open flat. A closed tube has no way to flatten without stretching.
- Pinching at a pole: add seams that radiate from the pole, or accept the pinch if it sits in a spot the viewer will not see.
- Uniform scale mismatch between islands: the shape is fine but the sizes differ. Select the islands and scale them. The next chapter handles this.
- Skewed faces in a thin region: try a different method. Angle Based keeps angles close to the original. Conformal can work better for organic shapes. Both can be run again after changing seams.
- A distorted island you cannot fix with seams: pin vertices with P in the UV Editor and unwrap again. Pinned points stay where they are, which gives you control over how the island opens.
After each change, run the unwrap again. This script repeats the unwrap on the entire mesh and respects existing seams:
import bpy
obj = bpy.context.active_object
bpy.ops.object.mode_set(mode='EDIT')
bpy.ops.mesh.select_all(action='SELECT')
bpy.ops.uv.unwrap(method='ANGLE_BASED', margin=0.001)
bpy.ops.object.mode_set(mode='OBJECT')Common errors
- Checking in the wrong shading mode. In Solid shading with a plain color, the grid does not appear. Switch to Material Preview.
- Using a non-square image. The grid then looks stretched even on a perfect unwrap. Compare your result using a square image first.
- Reading seams as a fault. A visible change in the pattern at a seam is normal. Judge the seam by position, not by existence.
- Ignoring the object's scale. If the object has non-uniform Object Mode scale, such as 1, 1, 3, the model looks stretched even though the UVs are fine, and the unwrap may be computed against the wrong proportions. Apply scale with Ctrl+A, then choose Scale, and unwrap again.
- Trusting one overlay mode. Check Angle and Area. Each hides a kind of error the other shows.
- Forgetting that UVs belong to face corners. Two faces sharing a vertex can have different UV positions at that vertex. Each face corner (loop) stores its own U,V pair. This is why a seam can exist without splitting the mesh geometry. You can see the values directly:
import bpy
obj = bpy.context.active_object
uv_layer = obj.data.uv_layers.active
for i, loop_uv in enumerate(uv_layer.data[:6]):
print(i, tuple(loop_uv.uv))When the grid passes
You can call the unwrap acceptable for a first pass when these hold:
- The grid squares look roughly square across the model.
- Square sizes are close to each other, or you have a plan to even them out.
- The stretch overlay is mostly blue in Angle mode.
- Seams sit in places the viewer will rarely see.
You do not need a perfect result. Even a well-made model has small distortion in tight areas. The aim is to find distortion that would visibly spoil the final texture, and fix that.
Exercise
Your model shows the test grid with squares that look correct in shape but are twice as large on the head as on the body. Which stretch overlay mode shows this problem most clearly, and what is the next step?
Show answer
The Area mode shows it most clearly, because it compares each face's UV area with its 3D area. Angle mode may stay blue since the shapes are right. The next step is to select the head island in the UV Editor and scale it down, or scale the body island up, until the squares match in size. This is a texel density fix, which the next chapter covers.
Exercise
You unwrap a cylinder with no seams. The grid on the side wall shows long thin streaks, and the stretch overlay is red. What is the cause and what do you do?
Show answer
A closed tube cannot be flattened without heavy distortion, because the unwrap has to squeeze the whole wall into a region with no opening. Mark a seam along the length of the cylinder, then unwrap again. The wall opens into a rectangle, and the grid squares become even.