Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Mesh Texture Paint?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/tipoli5890-mesh-texture-paint-game-studio)
---
name: mesh-texture-paint
description: "Repaint an image-to-3D mesh's texture from concept art, view by view, with a local edit model."
---
# mesh-texture-paint — keep the mesh, repaint the colour
Image-to-3D gives a good shape and a dull, blotchy, guessed texture. This skill keeps the mesh, its
UVs, normal and occlusion maps, and repaints only the base colour: render the mesh from a camera,
have a local image-edit model paint that view to match the concept art, register and gate the
result, project the painted pixels into the UV texture, pick the next camera, repeat.
## Start here — request / symptom → where to look
| Request or symptom | Go to |
|---|---|
| "Repaint this dull Pixal3D texture from the concept art" | `reference/pipeline.md` §1–4 |
| The same for a prop (the courier backpack, a parcel crate, a cone) | `reference/pipeline.md` §1, §4 (`--kind object`) |
| Repaint a game mesh's texture after remeshing (S5b: the courier runner's `_game.glb`) | `reference/pipeline.md` §7 (`--write-texture`) |
| The game ships in the US, the EU, the UK or South Korea, or worldwide | `reference/painting.md` §8: `--backend qwen` |
| The face is blurry, the shoes the wrong colour | `reference/projection.md` §7 (`--detail head,feet`; a chibi: `head` only) |
| A collage of several small figures in one view | `reference/painting.md` §3; `reference/gates.md` §2 |
| Dark hair or fabric came back silver or grey | `reference/painting.md` §5; `reference/troubleshooting.md` |
| A purple or olive tint spreading | `reference/painting.md` §5 (rejected markers) |
| A colour the concept never has (a pink braid on a blue coat, a navy palm) | `reference/gates.md` §2 (the blob, `--max-off-blob`; off palette, `--max-off-palette`) |
| A green fringe on the edges | `reference/painting.md` §6 (despill) |
| Side views rejected | `reference/troubleshooting.md` (Cameras); `reference/gates.md` §5 |
| Low-angle or top-down views rejected | `reference/projection.md` §1 (pitch band) |
| Zoomed views of a thin prop fail | `reference/projection.md` §5 (thin meshes) |
| One view keeps failing | `reference/gates.md` §2, §5; `reference/troubleshooting.md` |
| A view came back as its guide, unchanged (`unchanged` in `fails`) | `reference/gates.md` §2; `reference/troubleshooting.md` |
| The front's face or buttons painted onto a back view | `reference/painting.md` §3; `reference/troubleshooting.md` |
| Coverage stops early | `reference/projection.md` §6; `reference/troubleshooting.md` (The loop) |
| Resume an interrupted run | `reference/pipeline.md` §5 (`--resume`) |
| The server names the model files differently | `reference/painting.md` §7 (`--models`) |
| How close is the mesh to its concept views (S3, S3b, S3c, S5; `scripts/concept_match.py`) | `reference/concept-match.md` |
> **A painted view is evidence, not paint.** Every view is registered to the render and passes every
> gate before a pixel reaches the texture; a view that fails is re-tried with another seed or
> reference, then dropped.
## Rules the route is built on
- **The mesh stays.** Geometry, UVs, normal and occlusion come out of the image-to-3D GLB
untouched; the finished GLB differs only in its base-colour image.
- **P-H3-Image is the default edit model** (`--backend p-h3`). Picture 1 is the guide render (its
layout is kept), then one or two references (`<Picture 2>`, `<Picture 3>`) and a one-sentence
`Edit <Picture 1>: …` prompt; the prompt upsampler stays off unless `--upsample`.
- **Qwen-Image-Edit-2511 (`--backend qwen`): two images per call, never three.** Picture 1 the
guide, picture 2 one reference; a third makes Qwen leave the guide almost unpainted. The 4-step
Lightning LoRA, latent = the guide's own VAE encoding, denoise 1.
- **Unpainted surface: flat grey on P-H3, a prior on Qwen, never a colour marker.** Shown the
prior, P-H3 often hands the guide back as it came; on grey it paints (`--context flat`, its
default). Qwen reads grey as grey material (silver hair), so it gets the mesh's own image-to-3D
texture, brightness-matched with one gain/offset (`--context fill`). Magenta bleeds into purple,
per-channel matching tints greys olive.
- **The sheet first, the nearest single view as fallback** (P-H3: that view with the sheet as
picture 3). A sheet can produce a collage, a single view can copy its own facing; a failed outline
switches reference. A back camera starts with the back view: given the sheet, either model paints
the front onto a back render.
- **A view handed back unchanged is refused** (`unchanged`, every backend; a detail pass at its own,
higher limit): projected, it would write the prior back as if it were paint.
- **Steep cameras are not used.** Pitch stays in −40…50°; steeper views come back drawn at eye
level. Undersides keep the prior.
- **Licences:** P-H3's licence excludes some territories, outputs included; for a game sold in one,
or worldwide, paint with `--backend qwen` (Apache-2.0, worldwide). The terms: `art-asset-registry`
→ `reference/licences.md`. `report.json` and `gates.json` carry the licence source, so the
territory travels with every texture. No non-commercial rasteriser (projection is numpy); table in
`reference/painting.md` §8.
## Files
| Path | Role |
|---|---|
| `scripts/paint_loop.py` | the loop: cameras, context renders, paint tries, gates, projection, outputs |
| `scripts/mvtex.py` | geometry core: GLB read/write, camera, rasteriser, alignment, gates, back-projection |
| `scripts/ph3_paint.py` | one P-H3 paint call (guide + references) on ComfyUI through `comfyui-asset-generation`'s client; `--models` |
| `scripts/qwen_paint.py` | one Qwen paint call (guide + one reference), the same way |
| `templates/p_h3_image_view_paint_api.json`, `templates/qwen_image_edit_2511_view_paint_api.json` | the two paint graphs as API templates |
| `reference/pipeline.md` | concept → background removal → Pixal3D → paint → hand-off, with commands |
| `reference/painting.md` | the two graphs, the prompts, the references, the context prior, despill, licences |
| `reference/projection.md` | cameras, visibility, weights, refine, colour match, NBV, zoom, coverage |
| `reference/gates.md` | each gate, its default and what it catches; `report.json` |
| `reference/troubleshooting.md` | symptom → cause → fix |
```bash
S=<skills>/mesh-texture-paint/scripts # python3 with numpy, scipy and Pillow
python3 "$S/mvtex.py" --selftest && python3 "$S/paint_loop.py" --selftest
python3 "$S/ph3_paint.py" --selftest && python3 "$S/qwen_paint.py" --selftest
```
The self-tests need no server. A paint run needs a ComfyUI server with the backend's model files
(`reference/painting.md` §1) and `comfyui-asset-generation` installed beside this skill.
## The route
| Stage | Run | Gate before the next stage |
|---|---|---|
| 1. Concept | `codex-visual`: three-quarter hero, then a 4:1 FRONT / LEFT / BACK / RIGHT sheet on black; `turnaround_to_views.py` | a person approves the hero; `audit_3d_source.py --views` exit 0; `left.png` faces left |
| 2. Background removal | `comfyui-asset-generation` `four_view_background_removal_api.json` | the black composites show the whole subject; skipping it gives black slabs |
| 3. Mesh | `pixal3d_multiview_to_model_api.json` | `inspect_glb.py` exit 0; the GLB has UVs and a base-colour image |
| 4. Paint | `paint_loop.py` | `turntable.png` looked at; `coverage.png`; `report.json` |
| 5. Check | `inspect_glb.py --require base,normal,occlusion` on the painted GLB | exit 0 |
| 6. Hand on | a character to `game-character-pipeline` S4 (Blender normalise); a prop to the engine plugin | then `/free` on the server |
| S5b (optional) | `paint_loop.py <name>_game.glb --prior self --compare <name>_game.glb … --write-texture textures/<name>_BaseColor.png` | `inspect_glb.py` at the game budget; `turntable.png` looked at (never `game_mesh.py` again: it rebakes over the repaint) |
## Quick start
```bash
python3 "$S/paint_loop.py" out/runner_r01/runner.glb \
--concept views/runner --sheet runner_sheet.png --out paint/runner \
--kind character --subject "courier runner" --detail head,feet --server "$COMFYUI_SERVER_URL"
```
That paints with P-H3; add `--backend qwen` for a game sold in the US, the EU, the UK or South
Korea, or set stage `texture_repaint` in the project's `.game-assets/config.toml`
(`comfyui-asset-generation` → `reference/backends.md`). A prop: `--kind object --subject "courier backpack"`, no `--detail`. A chibi: `--detail
head` (Qwen redraws a feet close-up as a whole small figure; P-H3 often hands it back unchanged). A character paints its anchors, then next-best
cameras until the target, the view budget or a run of refusals once past its coverage floor, then
the detail passes; a prop's underside often stays on the prior. Thin props (a flat sign, a thin frame) paint without zoom and with
a lower IoU around holes.
## Outputs
In `--out`: `basecolor.png` (the new texture, gutter filled), `<glb-stem>_painted.glb` (the input
GLB with only that image replaced), `coverage.png` (white painted, grey seeable but unpainted),
`turntable.png` (eight yaws, `--compare` adds a before row), `report.json` (`reference/gates.md`
§6), `views/` (each view's `_guide.png`, raw `_s<seed>.png` and `_aligned.png`) and `state.npz`
(for `--resume`).
## Scope — what this skill does NOT do
- **New geometry** — the mesh, its UVs and its faces come from `comfyui-asset-generation`; a wrong
shape goes back there. Remeshing and retopology: `blender-character-rig`.
- **PBR beyond base colour** — roughness, metallic, normal and occlusion are kept as generated, not
painted.
- **Rigging and animation** — `character-autorig`, in the order `game-character-pipeline` sets.
- **The concept art** — the hero image, the sheet, the style: `codex-visual`.
- **Running the server** — uploads, queue, model loading, `/free`: `comfyui-asset-generation`.
Related: `codex-visual` → `reference/image-to-3d-input.md` (the turnaround), `comfyui-asset-generation`
→ `reference/image-to-3d.md` (the mesh and its gate), `game-character-pipeline` (where a character
goes next), `art-asset-registry` (the ledger record).
## Hand-off to an engine
Outputs here are engine-neutral files. An engine plugin (`unity-dev`, `godot-dev`, `unreal-dev`)
imports them: `reference/engine-handoff.md`.