Organic characters with metaballs¶
Prisms and boxes give a figure hard joints. For a round, friendly character (a belly, puffy sleeves, a beard) metaballs are easier: they are blobs that melt into each other wherever they come close, like clay pressed together. You place a few dozen of them, convert the result to a mesh, and reduce it to a few thousand flat faces.
Download: metaball_character.py · metaball_character.glb (about 6,200 triangles)



1. How metaballs behave¶
Add one in the viewport with Add › Metaball › Ball. Each metaball has a radius of influence; the surface you see is where the combined influence of all nearby balls reaches the threshold. Two balls close together merge with a smooth web between them; far apart they stay separate.
One detail matters when you place them by numbers: at the default stiffness (2) and a
threshold of 0.6, a single ball's visible surface is 0.575 × its radius. The script
divides every size by that, so ball(centre, 0.03) really is 3 cm across the surface:
K = 0.575
e = metaball.elements.new(type="BALL")
e.radius = 0.03 / K
Besides balls there are ellipsoids (egg in the script: a ball with three radii,
good for a belly or a cap) and capsules. A chain of balls with shrinking radii makes a
tapering arm or leg (limb).
2. Families: what melts with what¶
All metaballs in the same object melt together. Things that must stay separate (a beard over a chin, a cap over the head) go into different objects. The character uses four families:
| Family | Shapes | Resolution |
|---|---|---|
| Body | belly, chest, shoulders, turtleneck, hips, 2 legs, 2 feet, 2 arms, 2 hands | 12 mm |
| Head | head, nose, 2 cheeks, 2 ears, neck | 6 mm |
| Beard | ~70 small balls round the jaw, chin, back of the head | 6 mm |
| Cap | a flat egg tipped back, a little stalk | 7 mm |
Resolution is the size of the grid the surface is built on: small parts (a nose) need a fine grid, the body does not. Eyes and mouth are tiny hard spheres, not metaballs.
3. Build the body¶
body = Blob("Body", 0.012)
body.egg((0, -0.03, 1.02), (0.23, 0.19, 0.20), "sweater") # round belly
body.egg((0, 0.00, 0.86), (0.19, 0.14, 0.11), "trouser") # hips
for s in (-1, 1): # left and right
x = 0.10 * s
body.limb([(x, 0, 0.80), (x * 1.05, 0, 0.45), (x * 1.05, 0.005, 0.12)],
[0.10, 0.08, 0.072], "trouser") # a leg
Each shape carries a colour name. It is not used yet; it will paint the faces later.
4. From metaballs to low poly¶
Blob.build() does four steps:
- Convert to mesh. The metaball surface becomes a dense mesh of tens of thousands of faces (step 1 above). Chains of balls leave faint ridges, visible on the legs.
- Smooth (modifier Smooth, 8 repeats) to iron out those ridges.
- Decimate (modifier Decimate, Collapse) to the triangle budget, e.g. 2,600 for the body. This is where the facets appear (step 2).
- Flat shading, then colour.
5. Paint every face by its shape¶
For each face the script finds the nearest shape and takes its colour: faces on
the belly get the sweater's navy, faces on a cheek its pink. One subtlety: where the
colour should change along a straight line (the sweater hem, the boot tops) the
triangles zig-zag across it. The fix is to slice a clean ring of edges in first
(bisect_plane at that height) and colour by height:
def body_colour(p, colour):
if abs(p.x) < 0.25: # trunk and legs, not the arms
if p.z < 0.30: return "boot"
if p.z < 0.92: return "trouser"
return colour
body.build(2600, smooth=8, recolour=body_colour, cuts=(0.025, 0.30, 0.92))
Try next¶
- Exercise: the wrists are still a little ragged where sweater meets skin. Add a cut
plane across each wrist (a tilted
plane_noalong the forearm). - Make him taller or rounder: change the belly
eggand the leg points. - Turn the beard into a moustache by deleting the lower rings of beard balls.
- Lower the triangle budgets for a chunkier look, or raise them for close-ups.