Skip to content
Back to skills

Mesh Texture Paint

ASecurity

Repaint an image-to-3D mesh's texture from concept art, view by view, with a local edit model.

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 12, 2026
ai-agentspythongobashawsapibackend

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 12 files and shows the line behind each finding

Scanned November 16, 2026

npx -y skills add tipoLi5890/unity-dev-skills --skill mesh-texture-paint --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Mesh Texture Paint?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Mesh Texture Paint
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tipoli5890-mesh-texture-paint/badge)](https://www.skillsdirectory.com/skills/tipoli5890-mesh-texture-paint)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
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" (a character) | `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. Nothing is painted by hand and no view is projected unchecked.

## 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 runs under the MiniMax H3 Community License: it excludes the US, the EU, the
  UK and South Korea, outputs included, and a commercial product shows "MiniMax H3" in its UI. For
  those territories, or worldwide, paint with `--backend qwen` (Apache-2.0, worldwide). `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=<repo>/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 `unity-3d-models` | 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. 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`.
- **Unity import** — `unity-3d-models`.

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), `unity-3d-models` (import and budgets), `art-asset-registry` (the ledger record).

Files in this skill

  • SKILL.md7.9 KB
  • reference/concept-match.md7.9 KB
  • reference/gates.md10.4 KB
  • reference/painting.md14.4 KB
  • reference/pipeline.md10.5 KB
  • reference/projection.md9.1 KB
  • reference/troubleshooting.md8.8 KB
  • scripts/concept_match.py47.9 KB
  • scripts/mvtex.py61 KB
  • scripts/paint_loop.py68.9 KB
  • scripts/qwen_paint.py11.5 KB
  • templates/qwen_image_edit_2511_view_paint_api.json2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.