source-part-segmentation — скилл для Claude Code: маски частей
Разбивает пересекающиеся части исходного изображения на именованные маски до того, как из контуров начнут строить меш.
npx skills add RobLe3/cc-blender-skill --skill source-part-segmentation -a claude-codeЧто делает source-part-segmentation
Скилл нужен на шаге перед contour-to-mesh, когда маскот, логотип или шаблон состоит из соприкасающихся деталей. Он выбирает самую чистую модальность — альфу, края, тёмные линии, яркое на тёмном, цветовые полосы или область атласа — и вытаскивает контуры с иерархией, чтобы найти объекты, дырки и вложенные детали.
Если компоненты касаются друг друга, первым идёт маркерный watershed по distance transform. Когда он делит слишком мелко или слишком грубо, включается сегментация по сидам: вы задаёте именованные части через bbox, polygon или seed_point с допуском по HSV, а скрипт scripts/seeded_part_masks.py превращает манифест в детерминированные маски и инвентарь частей. Маски помечаются как structural, decorative, face_feature, aura_context или validation_only, и дальше структурные уходят в contour-to-mesh, признаки лица — в landmark-fit-repair, области атласа — в atlas-uv-fitting.
Перед первым вызовом Blender скилл требует прочитать ../text-to-blender/references/mcp-backends.md и до конца задачи держаться выбранного бэкенда. Это повод проверить, что у вас уже настроен MCP-бэкенд для Blender: без него шаг сегментации останется набором масок. Симметрию скилл игнорирует намеренно — повторяющиеся части он не достраивает, а сегментирует то, что видно на источнике.
Какие задачи решает
- разделить слипшиеся части маскота на отдельные маски
- вытащить структурные детали из текстурного атласа
- пометить неоднозначные пересечения вместо того, чтобы их склеить
- получить инвентарь частей с ожидаемым числом до построения меша
- отделить штрихи вайрфрейма от залитых областей
Примеры запросов агенту
- Разбей этот логотип на структурные части и сохрани по маске на каждую
- Компоненты касаются друг друга — прогони watershed, а если переделит, собери сиды из манифеста
- Сделай инвентарь частей из атласа и отметь неоднозначные пересечения
Как установить source-part-segmentation
1Через Skills CLI (Vercel)
npx skills add RobLe3/cc-blender-skill --skill source-part-segmentation -a claude-code2Вручную: положить файлы
~/.claude/skills/source-part-segmentation/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/source-part-segmentation/
1Через Skills CLI (Vercel)
npx skills add RobLe3/cc-blender-skill --skill source-part-segmentation -a codex2Вручную: положить файлы
.agents/skills/source-part-segmentation/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add RobLe3/cc-blender-skill --skill source-part-segmentation -a cursor2Вручную: положить файлы
.cursor/skills/source-part-segmentation/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install RobLe3/cc-blender-skill source-part-segmentation2Вручную: положить файлы
.github/skills/source-part-segmentation/SKILL.md1Через Skills CLI (Vercel)
npx skills add RobLe3/cc-blender-skill --skill source-part-segmentation -a gemini-cli2Командой платформы
gemini skills install https://github.com/RobLe3/cc-blender-skill --path plugin/skills/source-part-segmentationВручную: положить файлы
.devin/skills/source-part-segmentation/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add RobLe3/cc-blender-skill --skill source-part-segmentation -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о source-part-segmentation
Как установить source-part-segmentation в Claude?
Выполните npx skills add RobLe3/cc-blender-skill --skill source-part-segmentation -a claude-code. Скилл появится в ~/.claude/skills/source-part-segmentation/SKILL.md.
Что делает source-part-segmentation?
Сегментирует пересекающиеся и соприкасающиеся части исходного изображения в именованные маски и классифицирует их по роли. Структурные маски затем идут в contour-to-mesh, признаки лица — в landmark-fit-repair, области атласа — в atlas-uv-fitting.
Что нужно, чтобы скилл заработал?
Перед первым вызовом Blender он просит прочитать ../text-to-blender/references/mcp-backends.md и сохранять выбранный бэкенд на всю задачу. Инструменты, которые ему разрешены, — Read, Bash, Glob, Grep.
Исходный текст
SKILL.md · MIT
---
name: source-part-segmentation
description: Segment overlapping visual parts from source images, wireframes, texture atlases, and decals before mesh reconstruction. Use when a mascot/logo/template contains touching or overlapping components and exact structural part masks are needed before contour-to-mesh, UV fitting, or landmark repair.
allowed-tools: Read Bash Glob Grep
---
## MCP backend
Use when: Overlapping part extraction, component masks, marker/watershed segmentation, contour hierarchy analysis, atlas part isolation, manual seed fallback for source-locked Blender reconstruction.
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.
# Source Part Segmentation
Use this before `contour-to-mesh` when a source image contains overlapping or touching designed parts.
The output is not “nice masks”; it is a **source-of-truth part inventory** that downstream geometry must obey.
## Inputs
- source image, wireframe, decal, or texture atlas;
- optional manual seed manifest with named parts, polygons, seed points, rough rectangles, or HSV/color ranges;
- source manifest with structural/decorative/context classification and expected part count.
## Workflow
1. Choose the cleanest modality: alpha, edge, dark-line, bright-on-dark, color-band, or atlas region.
2. Extract contours and hierarchy to identify candidate objects, holes, nested details, and strokes.
3. If components touch, run distance-transform marker watershed first.
4. If watershed over/under-splits, switch to **seeded segmentation**:
- create named part seeds (`bbox`, `polygon`, or `seed_point` + optional flood/HSV tolerance);
- save one mask per named structural part;
- mark ambiguous overlaps explicitly instead of merging them.
5. Classify masks as `structural`, `decorative`, `face_feature`, `aura_context`, or `validation_only`.
6. Pass structural masks to `contour-to-mesh`; pass feature masks/landmarks to `landmark-fit-repair`; pass atlas regions to `atlas-uv-fitting`.
## Hard rules
- Do not infer repeated parts from symmetry; segment what the source shows.
- Do not merge overlapping components if the manifest expects separate structural meshes.
- Do not proceed to final modeling when part count differs between source images; write a conflict report or canonical policy.
- If automatic segmentation is ambiguous, write an ambiguity report and require or create manual seed rectangles/points.
- Keep stroke/line masks separate from filled-part masks; wireframe strokes are guides unless explicitly used as the contour boundary.
## Seed manifest schema
```json
{
"schema": "source_part_seed_manifest.v1",
"image": "path/to/source.png",
"parts": [
{"name":"leaf_top", "class":"structural", "bbox":[x,y,w,h], "mode":"non_background"},
{"name":"face_shell", "class":"structural", "polygon":[[x,y],[x,y],...], "mode":"polygon"}
]
}
```
Allowed `mode` values: `polygon`, `bbox`, `non_background`, `dark_lines`, `bright_on_dark`, `hsv_range`.
## Scripts
- `scripts/segment_source_parts.py` produces component masks and a JSON report from an image, with optional watershed.
- `scripts/seeded_part_masks.py` converts a named seed manifest into deterministic named masks and a part inventory.
## Sources distilled
- OpenCV contours/hierarchy/moments are the base measurement layer.
- OpenCV distance transform + marker watershed is the first automated split method for touching components.
- Active contour refinement can improve a rough mask boundary after segmentation.
© RobLe3 · MIT · RobLe3/cc-blender-skill