Skip to content

Recipes

m4bwav edited this page Oct 12, 2026 · 1 revision

Real tasks, each run on 2026-10-11 on Windows 11 with Blender 5.2.1 and an RTX 5060 Ti 16 GB. The commands that go beyond the verification program say so; their numbers come from the development log, not from a rerun.

A real park into a game and a print

python pw.py place --bbox 40.0000,-75.0000,40.0010,-74.9987 --dem flat --res 2 --out park --print-mm 60

On real coordinates, drop --dem flat, and use --center LAT,LON --size-m 400 instead of a box. For the README's Central Park image the run was place --center 40.7740,-73.9712 --size-m 400 --print-mm 150 --exaggerate 2: USGS 1 m lidar, 17 m of relief, the Lake hydro-flattened, 35 trees, and a watertight 150 mm tile (not rerun by the wiki's program: it asks public servers). Then render the scene and compare it with an aerial photo:

python pw.py render park/print.stl --out park/renders --views front,top,iso --size 256

Flat places need --exaggerate 2 to 5 to show any relief; buildings and roads narrower than --min-feature-mm (1.2) are left off the tile. Credit OpenStreetMap on anything you ship, and on the base or packaging of a print.

From a photo to a game prop and a print

The README's fountain, as run:

  1. A reference image from an image model on white, flat light, three-quarter view (the polywright-references skill has the prompt).
  2. pw.py gen --image ref.png --out raw.glb --seed 7: Hunyuan3D-2 on ComfyUI in about 100 seconds, 405,434 triangles, 3,048 non-manifold edges.
  3. pw.py convert raw.glb game.glb --size-m 1.0 --ground --center --max-tris 15000 --uv: 14,998 triangles, then check --target game-roblox --real-size-m 1.0 passed.
  4. pw.py printable raw.glb print.stl --size-mm 80 --size-axis height: one watertight 80 mm solid of 45.8 cm3.
  5. pw.py 3mf print.stl --out print.3mf; Bambu Studio's CLI re-exported it with "Success."

TRELLIS.2 and Pixal3D from ComfyUI's template

ComfyUI 0.38 ships the template 3d_pixal3d_trellis2_image_to_model.json in its install's comfyui_workflow_templates_json/templates folder, and the nodes are built in; the seven model files (14.5 GB, from Comfy-Org on Hugging Face) are a separate download. Pass the template as it is:

python pw.py gen --image ref.png --workflow 3d_pixal3d_trellis2_image_to_model.json --out pixal3d.glb
python pw.py gen --image ref.png --workflow 3d_pixal3d_trellis2_image_to_model.json --out trellis2.glb --set 316.value=true

pw.py converts the editor-format template with the host's node definitions. The template's switch, node 316, picks Pixal3D when false (the default) and TRELLIS.2 when true. On the 16 GB card, in GPU time from ComfyUI's history: TRELLIS.2 took 377 seconds and gave an upright, one-part model of 699k triangles with 4096 px PBR textures, the best detail of the three models tried. Pixal3D took 329 seconds for a similar model that stands in the camera's frame: it leans by the camera's elevation, so rotate it level before finishing. Hunyuan3D-2 took 99 seconds for an untextured shape.

Your own Blender script

hello_bpy.py:

import bpy, sys
args = sys.argv[sys.argv.index("--") + 1:]
bpy.ops.wm.read_factory_settings(use_empty=True)
bpy.ops.mesh.primitive_cylinder_add(radius=0.3, depth=float(args[0]))
print("[pw] height", round(bpy.context.active_object.dimensions.z, 3))
python pw.py bpy hello_bpy.py -- 2.5
{
 "ok": true,
 "exit_code": 0,
 "seconds": "<s>",
 "blender": "5.2.1",
 "output": [
  "[pw] height 2.5"
 ],
 "errors": []
}

Exit code 0.

Print [pw] lines for the numbers you want back. The polywright-blender skill has ten more scripts, each run by the test suite: reference images at scale, modifiers, booleans with a fallback, remeshing, UVs, baking, a 5.x material, turntables, depth and normal passes, exports per engine.

Quick texture maps

python pw.py texture bricks.png --out tex --seamless
{
 "ok": true,
 "maps": {
  "albedo_seamless": "tex\\bricks_seamless.png",
  "height": "tex\\bricks_height.png",
  "normal": "tex\\bricks_normal_opengl.png",
  "roughness": "tex\\bricks_roughness.png"
 },
 "convention": "opengl",
 "note": "luminance-derived approximations (the classic CrazyBump trick), fine for props and terrain, wrong for measured materials; OpenGL = glTF, Blender, Unity; DirectX = Unreal"
}

Exit code 0.

The maps are luminance tricks, fine for props and terrain. Use --convention directx for Unreal.

Clone this wiki locally