texture-driven-mesh-fitting — Claude Code skill: setup & overview
Reshapes 3D mesh boundaries to match texture-atlas or decal silhouettes 1:1 in Blender before material passes. Essential when models do not match their source art.
npx skills add RobLe3/cc-blender-skill --skill texture-driven-mesh-fitting -a claude-codeWhat texture-driven-mesh-fitting does
This skill resolves silhouette mismatches by reshaping mesh boundaries directly against texture masks. Rather than stretching UV layouts over flawed geometry, it adapts the 3D surface to the source artwork in front X/Z projection. The agent executes these edits via a connected Blender MCP backend.
The procedure pairs mesh edges with source contours using landmarks or arc-length metrics. Interior vertices then shift through thin-plate spline deformation or piecewise-affine warping. Local coordinates remap into atlas bounding boxes, which prevents texture bleed without manual UV repainting.
Fitting must occur before adding mesh depth or extrusion. If front silhouette acceptance gates fail, look-dev stops immediately. The bundled script scripts/contour_correspondence_report.py verifies bounding box center, scale, and contour deltas.
What it helps with
- align source-locked mesh boundaries with texture-atlas contours
- stop texture bleed across 3D model silhouettes in front view
- warp interior mesh topology using thin-plate splines or landmarks
- measure contour deltas via
scripts/contour_correspondence_report.py
Example prompts for the agent
- Reshape the current mesh boundary to fit the decal contour in the atlas, using landmarks
base_leftandbase_right. - Deform interior vertices with thin-plate splines to match the source mask and remap UV coordinates.
- Run
scripts/contour_correspondence_report.pyto compare object silhouette deltas against the source mask.
How to install texture-driven-mesh-fitting
1Skills CLI (Vercel)
npx skills add RobLe3/cc-blender-skill --skill texture-driven-mesh-fitting -a claude-code2Manually: put the files in place
~/.claude/skills/texture-driven-mesh-fitting/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/texture-driven-mesh-fitting/
1Skills CLI (Vercel)
npx skills add RobLe3/cc-blender-skill --skill texture-driven-mesh-fitting -a codex2Manually: put the files in place
.agents/skills/texture-driven-mesh-fitting/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add RobLe3/cc-blender-skill --skill texture-driven-mesh-fitting -a cursor2Manually: put the files in place
.cursor/skills/texture-driven-mesh-fitting/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install RobLe3/cc-blender-skill texture-driven-mesh-fitting2Manually: put the files in place
.github/skills/texture-driven-mesh-fitting/SKILL.md1Skills CLI (Vercel)
npx skills add RobLe3/cc-blender-skill --skill texture-driven-mesh-fitting -a gemini-cli2Platform CLI
gemini skills install https://github.com/RobLe3/cc-blender-skill --path plugin/skills/texture-driven-mesh-fittingManually: put the files in place
.devin/skills/texture-driven-mesh-fitting/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add RobLe3/cc-blender-skill --skill texture-driven-mesh-fitting -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about texture-driven-mesh-fitting
How to install texture-driven-mesh-fitting in Claude Code?
Run npx skills add RobLe3/cc-blender-skill --skill texture-driven-mesh-fitting -a claude-code in your terminal. The configuration is stored at ~/.claude/skills/texture-driven-mesh-fitting/SKILL.md.
What does texture-driven-mesh-fitting do?
It reshapes mesh silhouettes to fit texture-atlas regions 1:1, stopping agents from warping UVs to hide geometric errors.
What are the preconditions before running this skill?
The model must be source-locked in front X/Z before depth is introduced, with structural parts segmented and atlas regions mapped. It also requires an active Blender MCP server.
Source text
SKILL.md · MIT
--- name: texture-driven-mesh-fitting description: Reshape source-locked mesh boundaries so the geometry fits texture-atlas or decal contours 1:1 before final UV/material work. Use when textures look off because the model behind them does not match the source texture region, or when the mesh must adapt to the texture instead of stretching the texture onto an approximate mesh. allowed-tools: Read Bash Glob Grep mcp__blender__execute_blender_code mcp__blender__get_object_info mcp__blender__get_objects_summary mcp__blender__get_object_detail_summary mcp__blender__render_viewport_to_path mcp__blender__search_api_docs mcp__blender_official__execute_blender_code mcp__blender_official__get_objects_summary mcp__blender_official__get_object_detail_summary mcp__blender_official__render_viewport_to_path mcp__blender_official__search_api_docs --- ## MCP backend Use when: Texture-driven geometry fitting, mesh boundary fitting to atlas masks, UV-preserving contour correspondence, point/landmark deformation, source mask to mesh repair. Before the first Blender call, read [../text-to-blender/references/mcp-backends.md](../text-to-blender/references/mcp-backends.md). Prefer official MCP for shared capabilities; preserve the selected backend for the whole task. Tool names in recipes are client/legacy examples: map them through that reference and its agent-host guide. # Texture-Driven Mesh Fitting This skill fixes the common failure: a texture is mapped correctly, but the mesh silhouette underneath is wrong. The mesh adapts to the source contour; the texture is not stretched to hide a wrong mesh. ## Preconditions - Structural parts are segmented (`source-part-segmentation`). - Each part has a contour/mask and, if textured, an atlas region (`atlas-uv-fitting`). - The object is source-locked in front X/Z before depth is added. - Canonical view policy is resolved (`multiview-constraint-solver`) if views conflict. ## Workflow 1. Extract source contour from the texture/wireframe region. 2. Extract current mesh boundary in the same projected coordinate space. 3. Build ordered contour correspondence by arc length, named landmarks, or seam/control points. 4. Move boundary vertices to source contour positions. 5. Move interior vertices by smooth interpolation, piecewise-affine warp, or thin-plate-spline style deformation. 6. Preserve UV parameterization by remapping boundary-fitted local coordinates into the atlas rectangle. 7. Re-render overlay; do not proceed to look-dev until texture-region silhouette passes. ## Acceptance gates - Per-part source/product bbox center and size within tolerance. - Boundary maximum sample error below tolerance after normalization. - Texture atlas region does not visibly bleed outside the fitted mesh in front view. - Named landmarks (`leaf_tip`, `base_left`, `base_right`, `face_corner`, etc.) pass `landmark-fit-repair`. ## Hard rules - If a texture crop has a different silhouette than the mesh, reshape the mesh first. - Do not use global UV stretching to hide geometry mismatch. - Boundary fitting must happen before side-depth/crown deformation. - Do not tune material/light to compensate for geometry/UV misfit. ## Scripts - `scripts/contour_correspondence_report.py` reports bbox, centroid, and sampled contour deltas between a source mask and a render/object mask. ## Sources distilled - Piecewise-affine/landmark warping gives a practical mesh deformation model. - Thin-plate-spline style deformation is appropriate for smooth mascot/logo surfaces when landmarks are sparse. - Blender mesh vertices/UV layers can be edited directly; BMesh is useful for cleanup after deformation.
© RobLe3 · MIT · RobLe3/cc-blender-skill