TailorKit / Documentation

Sewn garments (sew and drape)

TailorKit 0.2.32 added a third way to make clothes, next to Body-fitted basics and Conform. It's the Marvelous Designer method done in plain Blender, as in Bad Normals' "You can now make clothes in Blender!" (2026-10-23, https://www.youtube.com/watch?v=6qNM8rdjcDA): flat pattern panels are sewn together and dropped onto the body with cloth physics.

Module: src/weftsmith/sew.py. Add-on: Outfit source → Sewn garments → Sew and Drape Garments.

Separate neck and head skin

In 1. Character, set Skin to a collection containing the separate skin meshes, excluding the main body and clothing. Sewing uses their neutral Basis geometry in the body's coordinate frame for collision. It measures exact neck sections between the mapped neck and head joints and records the result in neck_measurement. This prevents a shoulder-only body Neck region from sizing an oversized collar. Without additional skin, the existing body/proxy route is retained. Check the assembled neck and collar afterward; measurement completion is separate from a fit pass.

Supplied neck skin must contain a closed, nonbranching section enclosing the mapped neck/head axis. Girth is measured from that connected loop's convex hull. Open, partial or offset-only skin is rejected; disconnected patches are never joined to invent a neck. Neck pieces split across separate objects require a topology adapter and are currently unsupported.

Python callers can supply additional_skin=[head_mesh] to sew.sew_garment or sew.measure. Scene-based calls use the Skin collection by default. Sources, their control values, materials and transforms remain untouched. This supports the existing upright, region-labelled body and mapped-joint contract.

What happens

  1. Measure the body at its neutral shape (Basis key): waist, hip, chest and neck girths (convex hull of the trunk slice), landmark heights from the UE mannequin bones, arm radius along the bent arm, and the front-to-back depth under the shoulder.
  2. Cut each pattern's flat panels in centimetres from those measurements (pattern_skirt, pattern_dress, pattern_sweatshirt). Seams name pairs of outline segments. Both sides of a seam get the same number of points, and the inside is a staggered grid triangulated by constrained Delaunay. Spacing comes from the triangle budget.
  3. Place the panels around the body without stretching them:
  4. Trouser panels sit on the body above the crotch and on a per-leg LevelWrap below it, blended over 8 cm.
  5. Body panels go on a LevelWrap, a stack of horizontal sections 2 cm apart. Each section is the trunk outline plus a 2 cm gap, widened wherever the garment is wider, so a skirt starts as an A-line cone.
  6. Back panels sit 1.2 cm further out.
  7. Sleeves are rolled into tubes around the bent arm (wrist → elbow → shoulder), so their underarm seam starts closed.
  8. Front and back panels reach over (half the shoulder depth plus the gap) above the shoulder line, so the shoulder seams close over the top. Without that, they pull the whole garment up by 10-20 cm.
  9. Sew and drape in a temporary metre-scale scene. Sewing springs are loose edges between seam pairs. The cloth collides with a copy of the body (plus a stand-in head on headless bodies). Elastic edges (grip: waistbands, cuffs, hems) shrink by 8-12%. Fabrics: cotton, jersey, fleece, chiffon, pique.
  10. Freeze: the seams are welded at their mean position, the sewing threads removed, the drape noise relaxed (2 smoothing rounds), the cloth pushed 0.5 cm outside the skin and the faces turned outward. The flat pattern is kept as UV set UVMap (named Pattern before 0.2.36; the game's re-import check wants UVMap), so fabric textures run along the grain.
  11. Clay and folds (the default path for anything shown in game, 2026-10-25). Give a garment clay=N (sew_clay in a wardrobe entry) and the frozen drape is clay-smoothed (Taubin rounds, a hang pass, the spine bridge) into the clean shape the game ships. The sim's folds are not thrown away: the unsmoothed drape is frozen too, and how far it stood out of the clay shape at each vertex (cm along the normal) is stored as the tk_fold attribute. bake.bake_detail paints it into the detail map: creases darken R/B, folds rise in the G relief. This is the dense-sim-to-light-mesh step of game character workflows (Foxcoder's Marvelous-to-Unreal video), done inside our tools. folds=False on the garment skips the attribute; fold_bake=False skips the bake. Lathe (rule-based shape, round 3c, 2026-10-25). A pattern can return lathe=dict(...) and sew.lathe replaces the trunk's drape with a shape made by rules: the cloth radius round the trunk axis as a field over direction and height, kept to a few waves round each row and blurred down the rows. The cloth spans valleys (it may draw in only LATHE_TAPER cm per cm), never comes within fit_gap (bodice) or gap (from loose_below down, room for jeans) of the body's convex hull, and below flare_below it is an A-line (widens LATHE_FLARE cm per cm). The hem is levelled dead flat. follow (0-1) keeps that share of the drape's own extra room. The drape's detail still goes into tk_fold (it is carried along by the lathe's shift). The Sundress uses it: Alex found the clay-only dress lumpy with a wavy hem. options['lathe']=False turns it off. The shape option on sweatshirt-cut tops is EXPERIMENTAL and off: lathe picks vertices by position, so the A-posed sleeves were pulled into the body. It must skip sleeve panels by name first.
  12. Conform (on by default): weights, every body key, BodyUV and covered regions, as for any modelled garment.

The body's own data is never changed.

Garments (2026-10-24)

Style Slot Panels Budget
SewnSkirt (A-line skirt) Bottom front, back 2000
SewnDress (sundress) FullBody front, back, straps over the shoulders 3500
SewnLeggings (leggings) Bottom front and back per leg; crotch extension, centre front/back curves, inseams, outseams; rise at the natural waist, 8% negative ease, seat and knee ease, elastic waist and ankle cuffs on a Trim slot; laid snug (0.5 cm) on the skin after the drape 2000
SewnSweatshirt (loose sweatshirt) Top front, back, 2 sleeves; V neck, dropped shoulders, elastic cuffs and hem 3500
SewnPolo (polo shirt, 0.2.34) Top the sweatshirt cut closer: short open sleeves, shallow neck, straight hem, turned-down collar 3200
SewnScrubs (scrubs top, 0.2.34) Top boxy, deep V neck, short open sleeves, straight hem past the hips 3000
draft PyjamaShirt, SleepTee (0.2.39) Top loose sleepwear: pattern_pyjama_shirt (long open sleeves, collar, contrast cuffs and hem), pattern_sleep_tee (short sleeves, neck binding, contrast cuffs) 3400 / 3000

bands={'neck'|'hem'|'cuff': cm} puts contrast bands on the Trim slot. Keep them at least ~1.3x the grid spacing (3 cm at budget resolution) or they catch half a row of triangles and read as a sawtooth; along a slanted neckline they still do, so round necks get a binding instead: collar=1.6, collar_lip=0.0 (a stand with no fall).

Short sleeves (sleeve_cm) are the top of the full sleeve: the tube starts that far up the bent arm and its open end hangs off the upper arm. Collars (collar, cm) are not sewn in the sim: a 3 cm strip has too little mass to stand and crumpled down the back, so add_collar builds a stand and a turned-down fall on the draped neckline after freezing (material 1, the trim).

The draft wardrobe can use any pattern: a draft.GARMENTS entry with sew='pattern_polo' (plus sew_fabric, sew_tris) is sewn and draped instead of lofted, then goes through the same clearance over bottoms, Conform and bake as the drafted pieces. LifeShare's polo and scrubs top are made this way.

options={'hood': True} adds a two-piece hood. It is experimental: hung down the back by default, or over the head with hood_up. Both still drag the top upward in the drape, so it is off.

On the real Silhouette bodies (silhouette_v3_reach Manny and Quinn, 60 frames) all three garments drape as one piece with seams under 2 cm before welding, Conform binds all 23 body keys, and tools/check_garments.py --budget lifeshare passes.

Run it

About 1-2 minutes per garment on a laptop CPU.

Adding a pattern

Write pattern_<name>(m, o) returning dict(panels, seams, z, slot, covers):

Then add it to GARMENTS with a fabric, a tint and a triangle budget.

Curved edges: ctrl={segment: (u, v)} on a panel bends that outline segment into a quadratic curve through the control point (the loose sweatshirt's round crew neck uses it). The inner grid follows the curved outline.

Patterns from GarmentCode (2026-10-25)

weftsmith.garmentcode reads GarmentCode's pattern JSON (MIT; edges can be straight, quadratic, cubic or circular arcs) and turns it into a pattern for this module: edges sampled into outline segments (stitched pairs get equal counts), stitches as seams, torso and skirt panels rolled onto the body wrap at their own height, sleeve halves rolled along the bent arm (the roll placement), and panel tops curled over the shoulder before the sim (fold_above). tools/garmentcode_fit.py measures the body, runs GarmentCode in its own Python (tools/garmentcode_patterns.py, numpy < 2) and sews the designs named in garmentcode.DESIGNS.

Status: the tee, V-neck tee, tank and long-sleeve tee sew cleanly on Quinn and Manny (the long sleeve hangs open like a bell: it needs a gripping cuff). The flared skirt, pencil skirt and dress still slide below the waist and are not ready.

Known limits

Skirt gate (2026-10-24, fit_live with a Skirt style)

The draped SewnSkirt was clean at rest and never touched shoes, but its waistband stood proud of every top's hem (59-92 cases per top over all poses), and seated, stand-to-sit and sit-to-stand poses showed thigh skin through it (worst 1.6-4.6 cm). 0.2.37: snug_above lays a garment snug only above a height, fading back to the drape over SNUG_FADE cm. The skirt is laid 0.5 cm on the skin from the waist to 2 cm under the tee hem (thigh joint - 5 cm), as the body-fitted bottoms the tops are built around are, and flares only below (cloud: 0.5 cm median, 0.64 cm max over that yoke on both rigs). Its waistband is on M_SewnSkirt_Trim. Seated poses are still open: exact skin weights did not help in a cloud sit test, and the gate's own clearance pass made skirts worse, so do not run it on them.

Seated corrective (0.2.40, weftsmith.corrective)

Seated poses failed the skirt gate whatever the pattern did (exact skin weights, calf weights moved onto the thighs and a shorter hem were all tried). corrective.bake_seated(body, garment, arm) (add-on: Sewn garments > Bake Seated Correctives) seats both legs (thighs 85 degrees forward, knees 90), runs 20 frames of cloth on the skinned cloth over the seated body, and stores where the cloth went as the shape key Seated, carried back to the rest pose through the garment's own weights (exact for linear skinning: tested to 1e-5). The game drives Seated from hip flex, the smaller leg's angle between the thigh and the pelvis's down axis: 0 standing, 1 at 85 degrees. On Quinn the skirt then hangs from the knees in a seat instead of lying on the thighs with skin through it; on the test mannequin skirt skin-through in the seat fell from 87 to 13 vertices. The push method (no sim) and per-leg keys (sides=('l', 'r')) are there for one-legged poses. Run it after Conform. Test: tests/corrective_blender.py.