Making 3D heads with AI: I tried many ways, and the one that stuck was having AI write Blender Python

Over a little more than a month I tried many ways to make the people's heads in Ranse Biyori. Here are the failures, with pictures, and the method that stuck: Codex writing Blender Python.

Heads that Codex built with Blender Python, next to the drawings they were made from

Ranse Biyori is a life simulation set in Owari province in 1560. It is built in Unreal Engine 5, and most of the code is written by Claude Code and Codex.

The people’s heads have always been the weak spot. From October 11 to November 18, a little more than a month, I tried many ways to make them. Broadly there were four: image-to-3D, carving from outlines, an outside service, and having AI write Blender Python. This is the record. (The labels inside the pictures are in Japanese; the captions say what each shows.)


1. October 11, evening to midnight: four attempts, all failed

On the evening of October 11, each type’s hair was one smooth shape and the faces were still blank. The ink lines and flat colours, like a picture scroll, were much stronger than now; the people looked closer to “something drawn”.

People on the evening of 10/11. Strong ink lines and flat colours

The background was different too. Back then I was trying to push an ukiyo-e feel across the whole screen. The sky was a band of deep indigo fading downwards, and the ground was a flat, paper-coloured plane. Today the ground keeps the grain of real soil and grass, with ink lines on top.

That evening, wanting “more head-like heads”, I tried four methods:

  • An image-to-3D model (TripoSR): a woodblock-style picture gave a flat board; a shaded picture gave a rough lump
  • Carving from front and side outlines with UE’s Geometry Script: stripes across the face, and the front and back mirrored
  • A visual hull from the outline pictures in Blender: a box
  • Hair projected from pictures onto an ellipsoid in Blender: jagged edges, and a ball-shaped topknot on every type

A head carved from outlines

None of them beat the original simple head. Two lessons came out of it:

  • Write down the bar first. Decide whether you are judging readability at play height or likeness up close
  • Never judge from one direction. Always lay out front, side, back and top

After dropping all four, I put in types based on the head from MPFB2, a Blender add-on. Just before it went in, the edges looked like dry brush strokes; next to today’s screen you can see how much stronger the ink feel was then.

A trial with hair parts on the MPFB2 head (10/12, 20 minutes before it went into the game). Edges like dry brush strokes

After that I also tried several hair thicknesses. The hair stayed a shell, like a cap.

Hair thickness trials on the MPFB2 head (10/12)

This is the hero’s head in the game today. It has a face, but the hair is a single cap-like shell with a tube-shaped tail at the back.

Today’s in-game head (back, side, front, side)

2. Image to 3D: TripoSG (11/17)

Next I used TripoSG, which runs on the local GPU.

The shape from the side silhouette (2.58 million faces, decimated to 6,000) matched the outline. But the neck and shoulders came with it. From the front picture, the hair came out full of grooves.

TripoSG ronin. Middle: from the front picture. Bottom: from the side picture

Laid out type by type, some faces broke down.

Today’s heads and five TripoSG types

I also tried building the shape from a three-view drawing and painting the colours on. With beards and eyes, it was the round that looked most human. Up close, though, the colours bled, seams doubled, and the top of the head had holes. Changing the method three times in one day never got it to a showable line.

One more thing: the drawings I worked from were themselves a little off. The hero still had a blue headband I have since dropped, and parts of the faces were odd. So part of the failure was the source pictures, not just the method. Redoing the three-view drawings later also helped the Codex results in section 5.

Heads shaped by TripoSG from three-view drawings and painted (11/17). Ronin, samurai, townsman

3. An outside service: Tripo

I also tried Tripo, an outside 3D generation service, on its free tier: one chicken, for comparison. The shape is fine and smooth. But it has 320,000 faces, and with this game’s ink lines on it, it came out covered in black dots. I had already decided that nothing made on the free tier goes into the game, so using it would mean deciding first about uploading assets to an outside service, and about money.

Tripo’s chicken

4. Narrowing it to “Claude and Blender only”

At this point I set a rule: heads are made with AI and Blender only, with no 3D-generating AI, local ones included. Blender hair add-ons (HairMesh and others) were on the list, but the next method turned up before I tried them.

5. Codex (GPT-6.2 Astra) writing Blender Python (11/18)

GPT-6.2 Astra, released on November 17, was said to be better at 3D. So I asked Codex:

  • Inputs: the side silhouette, the front picture and boards of today’s head (a three-view drawing attached as a reference)
  • Build it with Blender Python only. No other generators, no downloads
  • After each build, render front, side, back, top and play size (on a 1920-wide screen the head is under 30 px; a calculation) and look. At most 6 rounds of fixes

Codex writes a script, runs Blender headless, looks at the renders, and fixes it again. The first round took about 19 minutes and about 93,000 tokens.

Round 1: today’s head, the silhouette, Codex

For round 2 the main reference was a three-view drawing (front, side, back) made with ChatGPT. The hair volume, beard and facial structure all moved closer.

Round 1, round 2 and the side of the three-view

That settled the method.

6. Making the three-view drawings match

The three-view drawings for Codex came from two sources:

  • Ronin, samurai, townsman: ChatGPT
  • Named people and unnamed types: Qwen-Image-Edit, running locally (ComfyUI)

One thing I learned: when given a reference picture, local Qwen copies the reference person’s looks too (ask for a woman and you get a man). For the named people I gave no reference and described them in words only.

Once the drawings were ready, I ran Codex on them side by side. With eight running, they were all done in about an hour.

Eight Codex heads

Eleven Codex heads

7. Fitting them to the game

Codex’s heads are in metres, face towards −Y, origin at the chin. The game’s heads are in centimetres, face towards +Y, origin at the base of the neck. I made this conversion a Blender tool:

  • Scale the head to match today’s head’s skin
  • Make the beard a separate part, so each role can have it or not
  • Check whether hats, headbands and hoods fit the new hair, and resize only the ones that don’t

The ronin in the game: top is today’s head, bottom is Codex’s

Once fitted, the neck looked wrong: whiter and flatter than the face, with a blurred edge from the jaw down to the collar. Measuring showed it was not a colour difference. The heads were aligned to today’s head at the bottom of the neck, so a Codex head with a longer neck had its face raised by 1.7 cm, and a tube of neck showed between jaw and collar. Fixing the tool to put the chin at a set height brought it back to the same short neck as today’s head. The fix works for all eleven heads.

The neck fix. Top: today’s head. Middle: before. Bottom: after

Last, I tried drawing eyes and brows as ink lines. The lines didn’t come out well, and the expressions looked worse, not better. At play height they can’t be seen anyway, so I dropped them.

Ink-line eyes and brows (a trial, dropped)

8. Does it fit 1560?

I also checked the hairstyles. The shaved pate (sakayaki) became everyday among warriors during the long wars of the Sengoku period, but it is said to have spread widely to commoners only in the Edo period. Up to the Tenshō era (1573–92), the hair is also said to have been plucked rather than shaved (Nihon Daihyakka Zensho).

Checked against that, the townsman’s shaved pate, the farmer’s short crop and the girl’s two buns did not fit 1560. I am redoing those three from new three-view drawings. With Codex, a redo takes a little over 20 minutes per head (with eight side by side, the longest took 55).


Summary

Method Result
Image to 3D (TripoSR, TripoSG) The outline comes out, but the hair and colours don’t become usable game surfaces
Carving from outlines, projecting onto an ellipsoid Boxes, stripes, jagged edges
Outside service (Tripo) Fine shapes, but not usable as-is, and it needs decisions about uploading and money
AI writing Blender Python (Codex, GPT-6.2 Astra) With a three-view drawing, 20–50 minutes per head to a head worth comparing

This is where I stopped. Ranse Biyori is not a game that asks for realism. You walk through a world drawn in ink, and at play height a head is under 30 px. What matters is that hair and headwear tell you at a glance who someone is and what their station is, not the detail of a face. Every head can now get hair, beard and headwear that match its drawing. For this game, that is enough.

The heads are not in the game yet. When they go in is still to be decided.