3D pre-rendered rooms (Blender)
The classic adventure games built every room as a 3D model, then rendered each view to a still picture. That is why every view of a room agreed, why a drawer could open in place, and why a close-up matched the wide shot. This kit does the same with Blender. An AI painting can serve as the concept the model is built to match.
Rooms so far: the Wynn study (night) and the Wynn living room (morning) in Where There's a Will.... Both are built from
samples/gen/mantel_clock/blender/wynn_house.py, which holds what the house's rooms share: materials, panelling, sash windows
with lace and drapes, doorways, the front door, the candlestick telephone, photographed carpets, and stand-ins for people.
That shared module is why the rooms read as one house. A new room in another building gets its own module of the same kind.
The study is the first room built. Its concept painting is
samples/gen/mantel_clock/blender/concepts/wynn_study_concept.webp; the model is samples/gen/mantel_clock/blender/wynn_study.py.
Running it#
make mantel-clock-3d ROOM=wynn_study PREVIEW=1 # half-size, 24 samples, ~30 s: for layout and lighting
make mantel-clock-3d ROOM=wynn_study # 1920×1080, 256 samples, ~5 min on Apple silicon; puts it in the game
Running samples/gen/blender/render.sh <game> <room> [--preview] does three things:
- It fetches the room's CC0 assets with
fetch.py. - It runs the room script headless.
- It leaves these in
samples/gen/<game>/blender/out/<room>/(gitignored):- the picture
- a patch for each state
- a report
apply.mjs then puts them into the built game:
- the background as WebP
- each state as an overlay
- every hotspot's rectangle
- the picture's provenance
The art layer (--keep-art) carries all of it across story rebuilds.
What the kit gives a room script (samples/gen/blender/kit.py)#
- Materials:
pbr()takes Poly Haven texture sets, box-projected in object space so a scaled box never stretches. Usegray=Truewithtintto recolour a texture.striped_wallpaper()is a procedural period wallpaper.image_material()puts a picture on a mesh, for a photograph or a clock face.
- Geometry:
box,cylinder,sphere,plane(with real UVs), andprism(an extruded outline, for a pediment or a crescent moon). - Models:
model()imports a fetched glTF.instance()makes a linked copy.isolate()keeps one piece of a set.tint_material(..., random_ramp=…)gives each copy its own colour, so a shelf of identical books varies.
- Foliage:
foliage(emitter, colours, leaf=…, count=…, shape=…)clothes any mesh in instanced leaves: a box for a clipped hedge, a lumpy ball for a lilac, a plane for grass. Each instance is a sprig of 18 leaves (oval,heart) or a tuft of 12 blades (blade), so a bush needs thousands of instances, not millions. About 40 sprigs per square metre covers a bush; about 450 tufts per square metre makes a lawn. A vertex group (vertex_group_density) keeps grass off the gravel. - Outdoors:
sky()is a cloud backdrop that casts no shadow.curve()andribbon()lay a walk, a lane or a rut along a bent path. - Several trees in one file: some models ship several trees side by side (Poly Haven's
fir_tree_01andpine_tree_01each hold three).variants()splits such a model into one root per tree, soinstance()can plant them. The imports are heavy (minutes), so import each model once and instance it. - Boats:
mantel_clock/blender/boats.pylofts a hull from stations, giving lapstrake lines and a waterline colour change. Camp Wyndmoor and the launch scene build the same launch from it, as the roadster is shared throughcars.py. - One model, many views: the launch (
boats.py) is seen from the camp dock and from its own cockpit.launch(close=True)adds what only the close view needs: the engine's puzzle parts and the varnished planking inside the hull. The camp's render is untouched by them. The Haverford bungalow (bungalow.py) is built once and seen across the lake now, and from its yard later. - Lights:
pointandareatake colour temperatures in kelvin;worldsets the background light. - Camera: keep it level and use
shift_yto frame more floor, so vertical lines stay vertical as they did in the classic renders. - Hotspots from 3D:
project_rect(objects)projects every vertex through the camera. The clickable area is wherever the object is drawn, so nothing has to be lined up by eye. - States:
render_patch(path, objects, rect)renders the room again with an object added, cropped to its rectangle. This is the classic pre-rendered state change: the patch carries its own shadows and reflections and matches the background pixel for pixel around them. - Debugging:
probe(x, y)names the object seen at a point in the picture. The room script's--probe=x,y;x,yflag uses it.
Lessons from the first room#
bmesh.ops.create_grid(calc_uvs=True)writes UVs only into a layer that already exists. Without one, an image on a plane samples a single corner pixel.Cycles blocks direct light behind refractive glass. Turn off
visible_shadowon window panes and clock glass, or whatever sits behind them goes black.An area light emits along its local −Z. Check which way it faces: the first fire light was lighting the inside of the firebox.
Build a rotated box at the origin and then move it. A box built at its world position turns about the world origin.
In the AgX view, bright saturated emission goes white. Fire reads best as overlapping flame cards (soft teardrop shapes) at modest strength, with the firebox kept dark.
A texture's name is not its look: the "quatrefoil jacquard" texture is a plain red cloth. Look at a thumbnail first, or draw the pattern in the shader.
A light outside a window must be hidden from transmission rays as well as camera rays. Otherwise it is seen through the glass as a white card.
kit.areanow hides every area light from the camera, from rays through glass and from reflections.A sky backdrop plane blocks the sun unless it casts no shadow (
visible_shadow = False), and a tree can block it as well. Check where the sun patch should land, and place outdoor scenery out of the sun's path.People are not painted into rooms.
house.person()is an invisible stand-in whose projection becomes the character's hotspot, and the engine draws the figure itself as an actor.Hair particles scale each instance by hair length × particle size, so
foliagesets the hair length to 1. The rotation modes turn the instance's +Y to the axis (global Z forGLOB_Z), so a grass tuft is built standing on +Y. Both were found by printing the evaluated instances' matrices (depsgraph.object_instances). That is quicker than guessing from renders.An object's
matrix_worldis stale untilbpy.context.view_layer.update(). A grass mask built from world positions before that update lands in the wrong place. At the Kittredge farm it left a bare patch beside the lane.A sun lamp makes a glint on glossy water even when the sun is out of sight. Put a visible sun disc exactly along the lamp's direction (
camera − direction × distance), in front of the sky plane, or the lake shines under an empty sky.Pick a hotspot's objects by exact name, not by substring:
"wheel" in namealso caught the flywheel and the wheel post, and the wheel's hotspot swallowed the engine.Don't wait on a render with
pgrep -f <script>: the waiting command's own command line contains the name, so it waits forever. Wait on Blender's process ID instead.kit.cylinder(..., axis="X")reads its arguments as (y, z, x0, x1), andaxis="Y"as (x, z, y0, y1). A rod built as if they were (x, y) floats into the middle of the room. Pass the arguments in that order; don't move the rod afterwards.To show a room through a doorway, trace the sight lines first: through the bedroom door only a strip of the living room's back wall shows, so its window and torn drapery belong there.
A dark room (the bungalow closet) is lit by what leaks into it. An emissive plane behind the door shows through real gaps (4 mm at the sides, 22 mm under it), and a thin hidden area light lying in the gap under the door throws the sun onto the floorboards. Each state sets its own exposure: the dark picture and the match-lit one are separate full frames, so they need not match.
Fur made from hair strands (
render_type = "PATH") rendered as streaks right across the closet. A fur cap iskit.foliage(..., shape="blade")tufts on a squashed sphere instead.A story overlay with the same id as a rendered state wins on rebuild:
art_layer.mjscarries over only the overlays the story does not define. Remove the drawn placeholder (the closet'smatch_glow) from the story, and delete its SVG and manifest entry, when a render replaces it.Two boxes whose faces share a plane (a casing upright running into the head casing) render as dark squares where they overlap. Stop one where the other starts.
To turn a door about an axis (the closet door hanging from its bolt and bottom hinge), check the rotation's sign with the cross product of axis × corner offset first. The first try swung the top corner into the closet, where nothing showed.
A low sun through a window behind a desk never reaches the floor: the desk's own shadow covers exactly where the patch would fall (the Granton jail). Ray-cast from the floor toward the sun (
scene.ray_cast) before turning the sun up. The jail lets the sun light the desk top, and throws the visible shaft through the cell's high window instead: a narrow spot light outside the window, so the bars cast sharp shadows on the cell floor.An emissive backdrop seen through a small window must be big enough for the camera's line of sight through it too, not only for the light. The cell window showed black until its "sky" plane was widened.
At dusk (the Red Fox) a grass field read as frost. The cause was not the grass: the yard's gravel plane ran under the verge, and its pale stones showed between the blades.
--probenamed it at once. Keep a ground plane to its own patch. Backlit blades also glow iftranslucencyis left on, and a low sun behind them makes that worse.A gabled roof built from two slabs: a slab rotated about Y by +θ drops its +X end, so the left slab (sx = −1) needs
sx * atan(rise/run). The wrong sign gives an M-shaped roof.Doors that open toward the camera hide what they open on. The van's rear doors at 112° stood between us and the load. Real van doors fold right back against the sides (about 170°), so the load shows.
A light slit "between the boards" must sit on the inner face of the wall, or the wall hides it. Even there, thin emissive slits read as glowing tubes, not gaps: the stable does without them.
To lift a part about one of its own edges (a seat cushion pulled up), build it with its origin on that edge and place it by
location. A box built at its final coordinates turns about its parent's origin instead.A round doorway in a thick wall (the bank vault) is a Boolean difference with a cylinder,
solver = "EXACT"andmaterial_mode = "TRANSFER", so the tunnel's faces take the cutter's polished steel while the wall keeps its paint.Hundreds of numbered parts (the vault's 310 deposit box doors) need one picture, not one each: draw an atlas (one cell per door,
deposit_doors.html) and point each door face's UVs at its own cell. One material, every number different.A person standing behind a table gets the table's clicks below its top edge: clip each stand-in's hotspot to above the projected top (the jail's marshal, the bank's Mr. Abernathy and Father).
pbr(..., gray=True)keeps the texture's own brightness, so a grey plank texture tinted white still paints grey walls (the autumn farmhouse looked dirty pink). Fresh white paint is a flat colour with the laps drawn as a bump of horizontal bands (painted_boardsinbascom_farm_autumn.py).Autumn trees from summer models: a Hue/Saturation node on the leaf colour, its hue picked per tree from Object Info › Random. Dark green leaves only turn maroon; lift Value (×1.9) as well, or the maples read as dried blood.
A corn shock is a straw cone with
foliage(shape="blade")stalks standing out of it; a bare cone reads as a cypress.Shutters of neighbouring windows that overlap in one plane render as black slots: space the windows or narrow the shutters.
One leaf per particle never covers a bush. At first the park's hedges rendered as smooth dark boxes, because the leaves were real but far too sparse.
360° rooms (panoramas) — plan them from the start#
Every room in Where There's a Will... is a single fixed picture. The player can't turn round, and the rooms feel static next to the classic games. Converting a finished room later is expensive: the unseen half has to be built, every hotspot moves, and the figures standing in it must be rendered again. So a new game plans its 360° rooms from the first room on. Use one for every interior the player stands in the middle of (offices, parlours, kitchens, cabins, shops), and for outdoor spots worth looking round (a park bench, a lakeshore). Keep flat pictures for approach shots from a road, vehicles, tight closets and close-ups.
The kit supports it (docs/SPEC.md "Panoramas"):
kit.panorama_camera(loc, look_at)sets a level equirectangular camera where the player stands. The picture's middle is thelook_atdirection, and the left/right seam is straight behind it. Put nothing clickable on the seam:project_rect/project_hullprintMF_PANO_SEAMwhen an object crosses it.kit.setup_render(*kit.pano_size(), …)sets the size: 8192 × 3072 for a full circle and 135° vertically (PANO_PX_PER_DEG,PANO_V_SPAN). At a start field of view of about 80° that is about as sharp as a 1920-wide flat room.kit.project_rect,project_hull,probeandview_rayhandle both camera types. People rendered into the room (people.render_in_room/room_motion) crop throughproject_rect, so they follow.- The report carries
"panorama": kit.pano_report("<room>.png", yaw=…, fov=80)instead of"background".apply.mjsinstalls it asgame/assets/panoramas/<room>.webpandscene.panorama, and removes the flat picture. The art layer carries it across story rebuilds. - Build all four walls and dress the side behind the start view as carefully as the front. A turn-around is where a bare corner shows.
- Expect a render of about 12 times the pixels of a flat room, so tens of minutes each. State patches stay cropped and cheap.
Not yet tested in a render. The code was written in November 2026 and has not produced a room yet. Before the first real room, render a test scene with coloured markers left, right, ahead and behind. Check two things:
- Cycles' equirectangular left/right matches
view_point(yaw positive to the right). - An actor's
heightin a panorama sits right in the engine.
People (3D characters)#
The classic games' casts were 3D models rendered ahead of time, like their rooms. Hester Pell is the first
(samples/gen/mantel_clock/blender/people/hester.py, shared code in samples/gen/blender/people.py).
- The body is MakeHuman, built with MPFB (MakeHuman for Blender).
fetch_mpfb.shdownloads MPFB (GPL-3, an authoring tool that never ships) and MakeHuman's CC0 system assets intosamples/gen/blender/.mpfb/(gitignored), and installs MPFB into a Blender settings folder of its own there (BLENDER_USER_RESOURCES), so the user's Blender is never touched.render_person.shruns a character script with it;kit.reset()drops add-ons, sopeople.svc()re-enables MPFB. - A character is a phenotype and a face:
people.build()takes MakeHuman's sliders (age, weight…) and face targets (head-age-incr,l-cheek-volume-decr…), a CC0 skin, eyes, brows, hair and clothes. MakeHuman's clothes are modern; the blouse-and-skirt with a drawn calico (calico_blue.html) passes for 1930, and a period piece is modelled (the shawl, the blanket). - The face moves with MakeHuman's own expression units (
mouth-open, eye closure, the smile's corner puller, brows), loaded as shape keys and carried onto lashes, brows, teeth and hair through each part's.mhclofitting, so a blink shuts the lashes too.people.express(body, mouth_open=0.4, blink=1)is a talking frame or a blink. - The portrait is a 1024² render with a transparent background, scaled to 512: rest and two talk frames.
- The figure is rendered inside its room's own scene: the character script runs the room script (
--report-only), sits the figure on the couch it finds by casting rays, turns every room object into a shadow catcher and renders with a transparent film. The room hides what is in front of her and keeps only the shadows she throws on it, and her light is the room's light. Every pose is cropped to one rectangle, so the engine places it exactly: feet at the bottom centre,height= the crop's height.apply_person.mjswrites the portrait, the poses, theactorblock and the scene'sactorsentry; the art layer carries a scene'sactorsacross story rebuilds.
Lessons from the first one:
- A ray cast to find furniture hits the character first (her own dress): cast against the room's objects only (
room_ray). - Names collide: the cottage already had a
blanket. Deleting "blanket" by name removed the room's throw, and her own blanket took the free name and became an invisible shadow catcher that hid her lap. Give a character's parts unique names. bmeshdoes not keep vertex indices up to date: callbm.verts.index_update()before reading.index, or every UV is (0, 0) and a crochet texture becomes a flat translucent sheet.- Bones bend about their local X; on the MakeHuman default rig
upperleg01−82° andlowerleg01+70° sit a figure down, spine bones +X lean forward. A deep daybed seats her by the knees (just over the front rail), not by the back rest. - A shawl that follows the body: rays from every direction round the upper chest onto the dress, a max filter to bridge
the gap between arm and side the way cloth would, then a blur. That shell only hugs her: it starts loose and flared
instead (a few centimetres off, more at the hem), and a cloth simulation (
drape: the neckline pinned, her body and dress as colliders, limp heavy wool, 90 frames stepped withframe_set, then the modifier applied) lets it fall into folds. Open it only ±15° at the front with the neckline sloping into a V, or the ends stand up under the chin. - MPFB's procedural eyes render as black pits in Blender 5.2 (their node groups use sockets that changed; MPFB logs
Found an input name which didn't exist as socket). Use MakeHuman's painted eyes (eye_material="lightblue", which sets the eyes' alternative material by the asset's uuid). Black eyes were most of the first pilot's doll-like look. - The skin is a node group (
Roughness,Clearcoat,Pore strength…), not a Principled BSDF: set those inputs to take the plastic sheen off. - Hair: MakeHuman's
short04is combed straight back from the forehead — the base for an old woman's pinned-up hair, with a knot added at the back. Dark hair needs a strong lift (recolour(lift=0.07)) to become white. - Tune a face with a row of close-ups (
--faces): a smile alone narrows the eyes;wide(MakeHuman's eye-opened-up units) keeps them open. - Old skin is a shader, placed by the face bones (
people.age_skin): forehead lines, crow's feet, lines under the eyes, the nose-to-mouth and mouth-to-chin folds, lines round the lips, neck rings, crepe, age spots, less colour. It reads arestattribute (each vertex where it sits with the face targets applied, before pose and expression), so the lines stay on the face as she talks; a little noise (wob) makes them wander instead of ruling them. It is built inside MPFB's skin node group, onto its own Principled BSDF. - Real hair over the shell (
people.comb_hair): ~14,000 strands as a Curves object, each started at a random point of the MakeHuman hair shell and walked along it toward the knot (closest point on the shell each step, a hair's breadth off it), a few lifting as wisps; parented to the head bone. White or silver hair takes the Principled Hair BSDF's direct colour: low melanin turns glassy and warm, and reads blond under lamplight. - One character, many rooms:
looks(docs/SPEC.md "Looks"). A figure rendered in a room is lit by that room, so Walter Wynn has a render per room: his office is his base poses, the living room, the bank and the study are looks, and each scene's actor entry names its look.people.render_in_roomdoes the room part for any character (load the room, turn it into a shadow catcher, crop every pose to one rectangle);apply_person.mjs --base=officewrites the looks. - A shadow catcher leaves a faint haze over the whole crop (the room lit a hair differently with the figure in it), which
shows as a pale box round the figure on the room's picture:
people.clear_faintclears alpha under 0.06. - Find the floor under a standing figure with a ray from waist height: from 3 m it found the bank vault's 2.9 m ceiling and stood Father on it (and an out-of-frame crop then fails with Blender's "Image too small").
- MakeHuman's painted eyes came out red under a warm key light; giving the eye material a clear coat of our own fixed it
(
people.builddoes it for every character). Spectacle lenses read as fog over the eyes at portrait size: rims only. - Arms at ease on the MakeHuman default rig:
upperarm01(−8, ±20, ∓40) andlowerarm01(−6, ±20, 0). Past about 45° the arms cross the body and the hands meet in front. - Relaxed hands: curl every finger joint about 22° (
finger2-1…finger5-3, the thumb half that). Flat open fingers are what make a standing figure look like a mannequin. Weight on one leg: bend that knee about 12°. - Greying temples: comb a dark layer of strands over the top only and a grey one over the sides only (
comb_haircentre_only/sides_only), and grey the shell toward the sides (people.grey_sides). Centre both on the eyes' middle line: the MakeHuman head bone sits 1.5 cm off it, and an asymmetric shell (short04's side parting) averages further off still. Keep that shell dark (recolour(lift=1.0)): lifting it greys short04's lighter parting streak. - A grey temple on the far side of a 3/4 portrait sits in shadow, so the grey reads mostly on the lit side. That is how a lamp lights a face; don't chase symmetry there.
- Period clothes over MakeHuman's modern ones (Hilda Brandt):
people.long_skirtputs a mid-calf skirt over the short one (an oval cone measured to the hips by rays), andpeople.panellays a flat garment over the front (an apron's bib, skirt, band and straps), each point pushed back onto the dress by a ray. Build the skirt first and give the apron it as something to lie on, or the apron's hem finds the shins and goes jagged. - MakeHuman's brown eyes still read red after the coat fix: desaturate them (
people.adjust(eyes, saturation=0.45)). - Close an open blouse neck by laying a panel of the dress fabric on the skin (
panel(..., wearers=[body])): the lapels then overlap its edges and the V closes without a seam. Laid on the blouse it reads as a patch sewn on top. - A room's invisible stand-in may stand where furniture is (Ruth's in the living room was on the footstool): the
floor ray then stands the figure on top of it. Check the room's furniture before taking a stand-in's spot, and move the
stand-in to match.
apply_person.mjssets the character's hotspots to where the figure was actually rendered. - A 1930 bob from MakeHuman's hair:
short02(ear-length, close to the head, a short fringe) with waved strands combed down from the crown.bob01/bob02hang a modern fringe over one eye. - An open cone of cloth (a skirt) needs its normals recalculated outward, or it shades as if lit from inside.
- A room that changes (the Bascom farmhouse in the storm and after it) gets a look per state:
people.load_roomkeeps the room script's globals (people.ROOM), so a character script calls the room's ownstate(storm_over=True)before rendering. Each look carrieswhen(the state's condition), and two looks in one room get ids of their own (clara_house,clara_sun) fromapply_person.mjs. worry(MakeHuman's inner-brow raise) reads as a frown on some faces: check a kind face without it. A face whose brows slope down to the nose looks stern whatever the mouth does: theeyebrows-angle-uptarget levels them (Clara, 0.7).- A Poly Haven fabric (
kit.pbr, box-mapped in object space) shows a different weave on a MakeHuman garment (object scale 0.1) than on our own pieces, so a yoke panel reads as a patch:people.world_mapped(mat)maps it in world space. - Lipstick follows MakeHuman's own
lipsvertex group (copied to alipmaskattribute for the shader:age_skin(lipstick=(colour, strength))). A box guessed from the eyes landed on the chin. - A print shared by MakeHuman clothes and our own pieces must be mapped in world space: MakeHuman's clothes carry a 0.1 object scale, so object space printed the flowers ten times smaller on the blouse than on the skirt.
- Shaped panels (
panel(keep=…)) cut a grid to a shape: two discs meeting at the throat make a Peter Pan collar. - A check (gingham) on a body can't be banded across X and Y like a tablecloth: Y is depth, so on a curved bodice its
bands come out as contour lines. Band the height (Z) and, across, X where the cloth faces the camera and Y on the
sides (chosen by the normal) — Elsie's
gingham(). Three colours (base, mid, deep) need the summed bands halved into the ramp, or the deepest never shows. - MakeHuman's
short03andbraid01sweep a fringe across the forehead too;short04with strands combed back reads as hair pulled back from the face (Elsie).eyebrow010is a soft, unplucked arch for a young face. - MakeHuman's suit is a jacket over a short skirt, so a skirt cone from the hips shows the jacket's hem as a waist seam.
For one garment from the waist down (a dress, a slicker),
people.cut_below(suit, waist, half_width)cuts the jacket away below the waist (sleeves, out at the sides in the rest pose, are kept) andlong_skirt(…, waist_z=)lofts rings from a snug waist over the hips to a flared hem. The natural waist is thespine02joint (spine05is the pelvis). - Measure a body by its own vertices in a thin slice, not by rays from outside: rays hit the hands beside the hips and the rest pose's elbows beside the waist (a lampshade skirt). And switch the body's MASK modifiers off while measuring — MakeHuman clothes delete the body under them, so the torso isn't there in the evaluated mesh.
- A belt panel wider than the waist folds round onto the arms; keep it to the waist's half-width.
--figurerenders each outfit full length in a plain studio (front and three-quarter): the place to judge clothes, since a figure in a room is too small to see them.- Don't guess arm angles:
people.reach(rig, side, wrist, elbow=)solves the upper arm and forearm so the wrist lands on a point with the elbow drawn toward another (hands on hips: Vera, first try). It runs forward kinematics on the bones' rest matrices, so the search re-evaluates no mesh. - A hat sized from bone positions cut through the forehead and the hair: size it from the head's own vertices above the brow (body and hair, evaluated) plus a margin for the felt (Vera's cloche).
- MakeHuman's shoes all come with white socks in the same texture:
recolour(shoes, stocking_colour, lift=1.0)turns the socks into stockings and leaves black shoes black. - A necklace placed by rays onto MakeHuman's suit follows its lapel edges like two rows of buttons. Smooth the bodice
with a front panel over
[suit, body]first, then space the beads by arc length along the curve (a U from the neck sides), so they touch like a strung rope (Vera's pearls). - A cloche sized over the hair sits on it like a bucket. Cut the hair away above the brow (the hat hides it) and size the crown from the scalp; a brim that bells out and dips at the back reads as 1930, straight sides don't.
- A sheen tinted white turns dark silk and felt pastel; tint the sheen in the cloth's own colour.
- A panel cast onto the body alone, with its clothes masks on, falls through the holes the masks cut and comes out as
odd tabs and ribbons (the "suit's bow" on Lorraine was her own yoke). For a plain bodice: cut the suit's lapels and bow
away below a neckline, turn only the body's
Delete.*masks off (keepHide helpers), cast one front panel over[suit, body]withtop=the neckline (akeepcuts a sloped edge into stair steps) andfeather=5(its border comes down flush with the suit round it, so no step shows as a seam), and cut the suit a little inside it (±0.11 under a ±0.155 panel, 0.045 below the neckline) — a panel only as wide as the cut leaves a dark gap when an arm lifts. - A panel laid on the body clings to every point of it.
people.drape(panel, give=…, pin_edges=True)smooths its depth again and again without letting it sink back (more thangive), so silk bridges the hollows and hangs from the bust; lay it that much further off (pin_edgeskeeps a feathered border flush). Thenpeople.bind(panel, body, rig): a panel parented to the rig stays put while the suit's shoulder moves with a raised arm; bound, it takes the body's nearest bone weights and moves with her. To lower the gaze, turn theeye.*bones about their local Y (about X or Z they turn sideways, and mirrored: one in, one out), with the lids half down. Rounding a bodice's top corners uncovers the suit's lapel notch (a dark hole); the corner is what hides it. - An object's
matrix_worldis identity until the view layer updates: update before copying it to parent a new prop. A flat glove cut to its outline and hung from a hand reads as a napkin;people.glove(body, rig, side, mat)copies the hand's own skin (tocuffpast the wrist) a hair off it, weighted to the same bones, so a worn glove bends with every finger and reads at any size. Call it in the rest pose. - MakeHuman's eyebrows are a sparse, mostly see-through texture: darkening them (
recolour) changes nothing you can see.people.opacity(parts["eyebrows"], 2.5)after the recolour makes the 1930 pencil-thin dark arch. Along_skirtstands like a lampshade;people.folds(skirt, count=11, depth=0.024, from_z=hip)ripples each ring in and out, deepening to the hem, for the loose flutes of bias-cut silk. MakeHuman ships no pump or T-strap (shoes01–06are oxfords and sneakers);shoes04recoloured is the closest to a 1930 lady's shoe. - A Peter Pan collar is a shaped
panel, butkeepcuts its circles in stair steps:people.snap_round(collar, centres, radius, below_z=…)puts its edge on true circles. Lay it wholly on the bodice: where its top edge passed the bodice's neckline the rays landed on her throat, 5 cm behind, and the collar folded in at the corners (horns at the top, drips at the bottom).people.cuff(rig, side, mat)is a turned-back cuff at a sleeve's end, riding the forearm. Better:people.peter_pan(name, rig, wearers, cx, top, mat)— seen from the front a Peter Pan collar is two half-moons (a quarter-circle front, a foot sweeping up in a quarter ellipse to the neckline), its free edge snapped to that outline. Give ittop = people.cloth_line([bodice, suit], cx, half, z_lo, z_hi), the measured line where the cloth meets the neck: a collar hung from a drawn neckline floated a dark band below the throat, and one that followed the measured line up the stand collar at the sides grew pointed tabs (the collar caps its rise atrise). Where it passes from the bodice onto the stand collar behind,drapeit and lay it ~6 mm off, or the step shows through. - MakeHuman ships no facial hair:
people.moustache(body, rig, colour)grows one from strands, rooted from just under the nostrils (thelevator06bones) down to the lip's edge — found as the sharpest crease in the face's profile, since theorislip bones sat 1.3 cm above the floor manager's real mouth and the first try floated under his nose. Keep it wider than the mouth (half_foot≈ 0.034) with its ends turned down (droop) and some grey in it: one only as wide as the nose is a toothbrush moustache, which no character should wear — and even a mouth-wide black one under slicked dark hair read as one at game size. Hair-BSDF colours render far darker than they read: a brown that shows as brown needs ~0.3–0.45, not 0.1.people.carnation(at)is a buttonhole flower;adjust(…, keep_light=(0.28, 0.45))darkens a suit to black and leaves its white shirt alone (a plainvalue=0.34turned the shirt grey). MakeHuman stands a man with his feet apart: turnupperleg01in ~3.5° (and the feet back out) for heels together. - A bald crown with a fringe: cut
short02's shell away over the forehead and crown (higher toward the back), smooth andtuck_edgethe cut, thenpeople.hug(shell, body, gap=0.007)— the style's volume otherwise leaves the fringe standing out in wings above the ears. Grey hair from a dark shell:recolour(…, lift=0.3)(lift 1.0 keeps a dark texture dark whatever colour multiplies it).spectacles(…, metal=True, wire=0.0009)makes gold wire rims; passbody=and the temples follow the side of the head to the ears and hook behind them (straight back from the rims they sat inside a broad face and the frames seemed to float). A bald fringe's temples: widen the cut as it rises (|dx| < 0.062 + 0.45·(z − eye − 0.035)) and smooth the edge ~24 passes — a vertical cut reads as a hairpiece, and a cut sloping back took the whole fringe away. - Judge cloth colour under daylight: a portrait key light at 4200 K (a desk lamp) turned a grey suit brown — sample the pixels before blaming the material.
- A 1930 farmer:
male_worksuit01's bib overalls overmale_casualsuit03's shirt. Drop the work suit's white T-shirt by its texture (people.drop_by_texture, protecting the bib's front so its white label stays), cut the shirt's jeans and tails away and its front under the bib (cut_where),push_outthe overalls 1 cm, and turn off both garments' body masks (the shirt's open neck showed a black void where they had deleted the chest).recolour(…, floor=0.55)softens bold stripes into a hickory work shirt;paint_by_texturegives the strap clips (dark grey ~0.1 in the texture, not black) a brass material. MakeHuman has no flat cap:people.flat_cap— a crown flat on top (a sphere's top half raised to the power 0.35) sloping down over a short peak, placed by rays at the skull. A positive rotation about X pitches a figure's front down (it faces −Y): the first cap sat back like a baseball cap with its peak cocked up. Its crown must spread wider than its band toward the top (a straight-sided one reads as a bucket), andpeople.tweed()gives it flecked wool — with no sheen, which washed the dark cap pale grey. Plastic strap clips are replaced, not repainted:drop_by_texturereturns where the dropped faces were, and a small brass slide plate and button go there (metallic 0.8 — fully metallic brass reads dark brown in a dark portrait world, half-metallic reads as beige paper). - A waistcoat over a shirt (no MakeHuman outfit has one): a
panelwith a V neck that narrows to straps over the shoulders and drops away at the armholes (top), pointed fronts at the hem (keep), draped and bound — no wider than ±0.165, or its edge lands on the arms hanging beside the chest and follows them. Buttons and apeople.starbadge go on by rays at it. One garment's texture can carry two cloths:paint_by_texture(shirt, any, wool, near=below the waist)makes the casual suit's jeans dark trousers (keep the shirt cuffs by the hips out of it). Light sandy hair from MakeHuman's dark shells needsrecolour(…, lift≈0.12). A light moustache needsmoustache(…, plain=True): under the nose the hair BSDF went dark brown even at colour 0.95. Sleeve garters arecuff(…, bone="upperarm02.L", at=0.075, fit=[shirt]): sized by rays from the bone outward (the middle hit, not the largest — rays from outside found the chest and made hoops). - A patterned garment piece is picked by where it lies on the texture, not by its colour: a colour test on
male_casualsuit05's red-black-white striped shirt split it into a checkerboard (some stripes read as the jacket's grey).paint_by_texture(suit, None, mat, uv=lambda u, v: …)takes whole pieces;cut_by_uvdeletes them (its turned collar, for a collarless shirt — keep the box off the jacket pocket lining beside it, or the pocket shows a hole). Recolour the garment before painting pieces, sincerecolourtouches every material slot. Close-cropped, tightly curled hair:hug(afro01, gap=0.004)thenpeople.cropped(shell, dark, light, grey=…)(Voronoi coils, bumped, salt and pepper) — a plain recolour of the hugged shell reads as a smooth painted skullcap. For an older Black man,old_african_maleskin withage_skin(saturation=0.7, tint=(0.58, 0.5, 0.47)),race african 1.0plus wider nose and fuller lip targets;browneyes atadjust(value=0.35)(they rendered pale grey-blue untouched). - A waistcoat under an open jacket is not a panel: laid on the body it stood out over the jacket's lapels as two
dark flaps, and painting the shirt's faces below a V left a stair-stepped edge. Draw it in the shirt's own shader
instead (amos.py
_waistcoat): the garment's rest positions stored as arestattribute, the V tested on them, a 2 mm blend — a clean edge that stays put as he moves; buttons and a watch chain go on by rays at the garment. A figure backlit by a room's window (the jail cell) gets an extra area light in the person script withuse_shadow = False: it lights him and throws no second shadow onto the shadow-catching room. - A frock coat from a lounge suit:
people.let_down(suit, knee_z, where, flare, uv_fill=…)extrudes the jacket's hem (the outermost horizontal boundary chain, not a shirt tail under it) down in rows that copy its weights, so the skirts are the coat's own cloth and move with him;uv_fillmaps the new rows onto a plain spot of the texture (the hem's row stretched draws its stitching as streaks). A separatelong_skirtcone failed: a stiff barrel that swallowed the arms and never matched the textured black. White hair from strands needscomb_hair(…, plain=True); pince-nez arespectacleswith the temples removed and a cord_rodto the lapel. - A bow tie on
male_elegantsuit01: there is no shirt modelled under its long tie (cutting the tie leaves a hole onto the masked body), so paint the tie and the shading painted round it white (paint_by_texture(uv=tiebox, near=…)) and press its raised strip flat onto the chest withhug(suit, body, select=those faces' vertices)— the body'sDelete.masks switched off for the call, or the chest is not there to press onto; then build the bow (stroud.pybow_tie: two flared, pinched wings, solidified and subdivided, and a small knot). Two spheres for a bow read as a moustache. - Stubble and scars are
age_skin(…, stubble=0..1, scars=[((x0, z0), (x1, z1), width)]): specks over a shadow on the beard's ground with a soft upper edge (a hard one reads as a pasted-on patch), the lips kept clear; a scar is a pale line from the face's rest shape (cut the eyebrow mesh where it crosses). A squarer head is shorter above the eyes:flat_cap(size=0.8)or the cap covers them, andband_scale≈0.985when lit from below (a proud band reads as a ring). - MakeHuman's painted
browneyes render red under warm light;brownlightdesaturated (adjust(saturation=0.45, value=0.6)) is hazel-brown. Black cloth needs a near-black base (0.012) and a grey sheen to show its folds — at 0.03 it renders grey-brown under AgX. - A figure behind a counter needs no cutting: the room is a shadow catcher in
render_in_room, so the counter hides her. Her hotspot must still stop at the counter top (as the room script clipped the stand-in's) — read the room'speople.ROOM["report"]["hotspots"]afterload_roomand cliphotspot_rectto it. - MakeHuman's
bob02is the jaw-length 1930 bob, but its fringe sweeps over one eye: delete the shell's vertices in front of the face below a hairline (high at the centre, lower at the temples), smooth the cut's boundary vertices (bmesh.ops.smooth_vert, a few passes — the coarse cards leave it stepped like a cap's rim) and comb the waves back from the parting. Pulling the edge into the scalp instead opened a notch at the crown. A shell that stands off the head (short02) shows its dark inside at the temples once its fringe is cut:people.tuck_edge(shell, body, select)lays the cut's border onto the nearest skin (the ring inside it half way), so the hairline meets the forehead. A quick look at a change:--portrait --preview --rest-only(one frame). In zsh,$optsholding several flags is passed as one argument — spell them out. - A
--previewrender is at 50%: its PNGs are half the size of the 1920×1080 frame theMF_CROPnumbers are in, so scale a preview figure 2× before laying it over the room picture (or it seems to float). - A comment written into the middle of an argument line silently drops the arguments after it (Ruth's eyebrows): keep one argument group per line in character scripts.
- MakeHuman's spine bones count up from the pelvis:
spine05is the bottom,spine01the top. Measure a neckline fromneck01. - Soft, fuller hair:
comb_hair(volume=…, wave=…)lifts strands off the shell and waves them in step (the phase is the distance to the knot). Grey over brown needs the grey layer lifted above the brown one, or the brown covers it. - Copy
matrix_worldonly afterview_layer.update(): the brooch built just before was copied as the identity and parented at the world origin, inside her feet (the same stale matrix as the Kittredge farm's grass mask). - A waistcoat on a broad man is not a
paneleither: kept within ±0.165 so it missed the arms, it left the shirt showing all down his sides and read as a flat bib. Draw it in the shirt (waistcoat_in,half_widthpast the sides,armholecurving in to the shoulder straps) withlapel=0.017(a turned-back band along the V: darker roll, stitched edge),raised=0.0012(the cloth's edges stand up off the shirt) andpoints=0.03(pointed fronts); buttons by rays at the shirt. - A hand held out in front of the chest, flat to the camera with its fingers fanned, reads oversized at portrait distance:
rest it on the lapel's edge, turned (wrist about its own Y) with the fingers curled over the cloth, and scale the
wristpose bone ~0.85 if it still reads large (stroud.pypose_hand, tuned with--hands). - An eyeshade is worn low: the band just above the brows (over the ears' tops at the sides), the visor only over the front ±54° and projecting forward, not splayed along the ring's normals — or it is wider than the head.
- A seated figure's shawl: rays steep enough to reach her lap stretch one end down onto it. Reject hits below her waist and carry the row above on (capping the distance instead cuts it off over the arms, which lie further out).
- Eyes that look drawn on are the lashes, not the skin. Close-ups with parts hidden (
eyelashes/eyebrowshide_render) showed it: MakeHuman'seyelashes01hangs a lower fringe as long, dense and black as the upper one, so at 512 px the eye is ringed like eyeliner (worse once a script darkens the lashes withadjust(value=0.4)). The skin texture's lid line and the painted eye are not it.people.soft_lashes(lashes, upper=(0, 0.7), lower=0.6)gives the lower lashes (the lower half of the lash texture's UVs) a material of their own and thins both sets by an alpha threshold (keeps the strands' cores, drops the spread), the upper set a little denser, tinted soft brown-black. Multiplying alpha down does not work: the denoiser wipes thin see-through strands out and the lashes vanish at once. A shape key added byshape_key_addstarts at value 1 in Blender 5.2 — any test render must callexpress()first or the carried blink keys shut the lashes down over the cheek. - The light, jagged rim between a bob's hair and the forehead (Clara, Minnie) was the strands, not the shell: rendered
alone, the cut shell has a smooth hairline, but strands combed down onto its cut edge pile up there at full lift, and
the layer's edge, seen end-on and lit, reads as an orange stepped band.
comb_hair(…, edge_fade=0.012, edge_stop=0.006, edge_where=<the front edge>)brings strands down onto the shell as they near the hairline and ends them 6 mm short, so the shell's own edge makes the hairline. - A sleeve garter as a circular
cuffsized by rays stands off an elliptical sleeve as a dark bar:cuff(…, wrap=shirt)shrinkwraps it onto the sleeve (a narrow nickel spring band, the marshal). - MakeHuman's eyebrow textures are near black:
recolourmultiplies the texture andadjust(value=…)scales it, so both leave a dark pencilled bar whatever colour is asked.people.flat_colour(parts["eyebrows"], rgb)sets one flat colour and keeps the texture's alpha (the brow's shape): soft brown or grey brows that read as hair (Hilda, Ruth, Garrow, Howard, the floor manager, Silas). Theeyebrows-angle-uptarget did not visibly level eyebrow004/007 on Hilda or Ruth: pick another brow asset instead (eyebrow011 for an older woman; Ruth kept eyebrow006, soft brown). - A pomaded shell recoloured at
lift=1.0stays black whatever the colour: the floor manager's brown hair neededlift=0.2on the shell under brown strands.flat_cap(flat=0.45, size=0.7)is a lower, flatter cap than the default dome. - MakeHuman's hair shells are made of cards: their boundary edges run all over the head, not only round the hairline.
So
comb_hair(edge_where=…)and the newpeople.feather_edge(shell, width, select=…)(the shell's alpha fades into the skin over its last few millimetres, broken up by noise — a close-cropped shell's hard rim read as a knitted cap's) must be limited to the hairline, e.g.p.z < _hairline(p.x) + 0.01: unlimited, Mrs. Petersen's strands lay flat over the whole top and a feathered shell left a bald head. The cut's border lies a few centimetres behind the eyes' plane (p.y < eye.y + 0.07, not + 0.03, or nothing is selected —MF_FEATHERprints the count). - A dark line round a bald forehead and down the far temple (Abernathy) was the close-hugged shell's own shadow on the
skin under its see-through edge, not its texture:
shell.visible_shadow = False(the strands still shade the head). - A collarless shirt's open V can't be closed with a panel on the skin when a waistcoat is drawn in the shirt's material (the panel takes the waistcoat's charcoal and its lower edge stands out as a plate): Amos keeps the open neck.
- A flat cap's crown can't be lowered below the skull top it covers; a cap that reads tall is fixed by
tilt(~9°),flat=0.45andsize≈0.7(Mulloy), not by a shorter crown (the hair pokes through). - Living portraits (
people.portrait_motion,pack_portrait_motion,motion_preview;walter.py --motion): an idle loop and two talk loops rendered with the portrait's own camera and lights at 512², every curve keyed per loop (MOTION_IDLE/MOTION_TALK) through a Catmull-Rom spline that leaves and returns to the neutral pose with zero slope, so loops switch at frame 0 without a jolt (idle_000andtalk*_000are the same picture). Bones are turned by rotations in the armature's space (_Poser.turn: basis @ M⁻¹RM), never guessed local axes; the head's turn is shared byneck01/neck02/head, and the eyes take back 85% of it so he keeps looking at the player (that, more than anything, makes it read as a person rather than a turntable). A breath is the chest tipping back with the clavicles lifting, the head kept level. - Lip-sync patches: MakeHuman's
mouth-openalone parts the lips over the teeth like a grimace (mouth-retractionworse); an open "ah" needs thejawbone dropped (~8°, half-open ~3.5°) with the smile eased off.--motion-study='[[name, {unit: v, "jaw": deg}], …]'renders candidates side by side. The patch is a Cycles border render 12 px larger than the crop (the denoiser's edge never reaches it), its outer 3 px faded in alpha: over the closed-mouth frame no box shows. 48 samples, 4 bounces, no adaptive sampling and a fixed seed look like the still and don't shimmer frame to frame.render_person.shpipes Blender through a bufferinggrep— a long run shows nothing until it ends, and killing the script leaves Blender running: kill Blender itself. - The 3:4 waist-up shot (
people.motion_frame, 480×640): the character's own square portrait camera, backed off along the line from the face and its lens shifted down (not tilted), until the frame runs from 5 cm over the head bone's tip to the belt (the top ofspine05). The face is seen exactly as in the still and stays about its size (MF_MOTION_SHOT … face 1.03); hands hanging at rest fall just out of the bottom, hands at the chest are well in. The sensor is fitted to the height (sensor_fit = VERTICAL), or the square shot's field of view would shrink. Measure through the camera only after aview_layer.update(): a camera made a moment ago still has an identity matrix. - Hand gestures (
_Armin people.py; a loop'shandsspec +m_*/o_*channels;motion_cli(…, hands=)):- The arm is placed by its own IK with a hinge elbow (the forearm turns only about the axis of the rest's bend),
not
reach.reachtreats the forearm as ball-jointed: the upper arm's twist and the forearm's roll trade off freely, so neighbouring frames landed in different solutions (forearm twist +126° then −108°) and the sleeve wrung. - The forearm's twist is judged anatomically — the palm's turn about the forearm from facing the body's middle, supination positive, kept within −80..+100° — and solved by a scan over every twist, not a greedy descent from 0 (which fell into whichever valley was nearer: two ways to face a palm up, one of them a broken wrist).
- The wrist bends only a little (±60° flexion, ±25° to the side) and costs more than turning the forearm.
- Paths go forward first, then up (a Bézier through a point in front of the target at a quarter of its height): a straight line from a hanging hand to the chest passes through the coat. Targets ride with the torso (breath, lean).
- Every channel is a
curve()that is 0 at both ends, and the arm bones are reset to the still's basis when all of them are 0 — talk frame 0 is pixel-identical to idle frame 0. - A hand near the mouth is fine for the patches (they are re-renders of the whole region, a hand in it is drawn
again), but a hand over the lips hides what the patch changes: the box pass prints
MF_MOTION_HAND_NEAR_MOUTHand the report keepshand_near_mouth.--motion-pick='talk3:12,21'prints the hand's top against the patch's bottom, in pixels, for each frame it renders. - A still that poses a hand (at a collar, holding a case) gestures only with the other: Ida
("L",)(her right hand is at the brooch; the left, at her waist, gestures from there), Orrin("L",)(right finger in his collar), Stroud("R",)(left at the lapel), the lawyer("R",)(left holds the brief case). Hands clasped in front (Harriet, Abernathy, Minnie, the floorman'sclaspedlook) →hands=()or unclasp the still; Garrow's are behind his back (gestures would start from there: check them). Look at each still before rendering its gestures. Their scripts pass these; only Walter's gestures have been rendered and reviewed. - Checked on Walter (
--motion-check, then each patch laid over its closed frame against the full open-mouth render): no box shows, placement right on the 3:4 frame (size/atare fractions per axis), PSNR 33–48 dB over the box.talk*_000andidle_000are the same pose (arm bones reset to the still's basis), but Cycles on the GPU leaves a few hundred pixels 1–5 levels apart between two renders of one pose: identical to the eye, not tomd5. - The whole set (40 idle + 3×30 talk frames, 180 patches) at 480×640, 48 samples: 38 minutes on an M2.
- The arm is placed by its own IK with a hinge elbow (the forearm turns only about the axis of the rest's bend),
not
Open work#
Set dressing (done for the study). The study now has:
- a real 16th-century Persian carpet: a public-domain photograph from the Met's Open Access collection (CC0), cropped as a texture
- pleated velvet drapes over the lace
- a log basket and fire irons, and a bronze horse on the mantel
- a fern on a stand
- a blotter, inkstand and magnifying glass on the table
- an ottoman, and Father's pedestal table with his book and spectacles
- a tighter camera and moodier fill
Museum open-access collections are a good source of period textures (carpets, wallpaper, fabrics). Check each object's public-domain flag, and credit it in
textures/CREDITS.md.Pleats. Build curtains with
pleat(), not a displace modifier: a displacement texture on a plane does nothing visible.A hotspot hidden behind furniture. Trim the hotspot to the part that can be seen. The study trims the doorway where Father's chair stands in front of it.
An optional AI finishing pass. Give the render to the image model as the structure, so the layout, states and hotspots stay exactly as rendered.
More views of the same model: close-ups (the mantel, the clock on the table), turn-around nodes, and 360° panoramas (see "360° rooms" above: the next game plans them from the start). That is the main payoff of building rooms in 3D.
The second state of the clock (its face hanging open), and an animated fire as an overlay frame sequence.
This page as Markdown: /docs/3d-rooms.md · Engine 0.101.0