texture-driven-mesh-fitting — скилл для Claude Code
Подгоняет контуры 3D-сетки под атлас текстур или декали в Blender до настройки материалов. Выручает, когда силуэт модели не совпадает с рисунком на текстуре.
npx skills add RobLe3/cc-blender-skill --skill texture-driven-mesh-fitting -a claude-codeЧто делает texture-driven-mesh-fitting
Скилл перестраивает базовую сетку так, чтобы её внешние границы повторяли контур текстуры один к одному. Вместо растягивания развёртки ради маскировки кривой геометрии агент меняет саму форму модели в плоскости X/Z. Для выполнения операций в сцене необходим подключённый MCP-сервер Blender.
Процедура сопоставляет контур маски и рёбра меша по длине дуги или контрольным точкам вроде leaf_tip и face_corner. Следом внутренние вершины сдвигаются через сплайны тонкой пластины (thin-plate spline) либо кусочно-аффинную деформацию. Координаты вершин автоматически приводятся к границам прямоугольника в атласе, что сохраняет развёртку.
Подгонку необходимо завершить строго до выдавливания толщины и боковой глубины детали. Скрипт scripts/contour_correspondence_report.py сверяет габариты и дельты контуров между мешем и маской. Если силуэты не совпали с допуском, переходить к материалам и свету запрещено.
Какие задачи решает
- подогнать силуэт трёхмерной сетки под контур текстурного атласа
- устранить вылезание текстуры за границы модели на фронтальном виде
- деформировать внутренние вершины сетки через контрольные точки
- проверить отклонения геометрии скриптом
contour_correspondence_report.py
Примеры запросов агенту
- Подгони контур сетки под маску декали в атласе, ориентируясь на контрольные точки
leaf_tipиbase_left. - Выровняй границы объекта по фронтальной текстуре через сплайны тонкой пластины и пересчитай UV.
- Запусти
scripts/contour_correspondence_report.py, чтобы проверить дельты между мешем и маской источника.
Как установить texture-driven-mesh-fitting
1Через Skills CLI (Vercel)
npx skills add RobLe3/cc-blender-skill --skill texture-driven-mesh-fitting -a claude-code2Вручную: положить файлы
~/.claude/skills/texture-driven-mesh-fitting/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/texture-driven-mesh-fitting/
1Через Skills CLI (Vercel)
npx skills add RobLe3/cc-blender-skill --skill texture-driven-mesh-fitting -a codex2Вручную: положить файлы
.agents/skills/texture-driven-mesh-fitting/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add RobLe3/cc-blender-skill --skill texture-driven-mesh-fitting -a cursor2Вручную: положить файлы
.cursor/skills/texture-driven-mesh-fitting/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install RobLe3/cc-blender-skill texture-driven-mesh-fitting2Вручную: положить файлы
.github/skills/texture-driven-mesh-fitting/SKILL.md1Через Skills CLI (Vercel)
npx skills add RobLe3/cc-blender-skill --skill texture-driven-mesh-fitting -a gemini-cli2Командой платформы
gemini skills install https://github.com/RobLe3/cc-blender-skill --path plugin/skills/texture-driven-mesh-fittingВручную: положить файлы
.devin/skills/texture-driven-mesh-fitting/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add RobLe3/cc-blender-skill --skill texture-driven-mesh-fitting -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о texture-driven-mesh-fitting
Как установить texture-driven-mesh-fitting в Claude Code?
Выполните в терминале команду npx skills add RobLe3/cc-blender-skill --skill texture-driven-mesh-fitting -a claude-code. Файл навыка сохранится в ~/.claude/skills/texture-driven-mesh-fitting/SKILL.md.
Зачем нужен скилл texture-driven-mesh-fitting?
Он деформирует границы полигональной сетки под форму текстурного атласа, исключая растягивание UV ради скрытия неточной геометрии.
Что требуется подготовить до запуска деформации?
Модель должна быть зафиксирована во фронтальном виде X/Z до добавления глубины, а для деталей нужны сегментация и регион в атласе. Также потребуется запущенный MCP-бэкенд Blender.
Исходный текст
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