keijiro/meshslicer/blender-make-sliceable
Claude Code and agent skill by keijiro/meshslicer
- community
Checking that the SKILL.md file is still in the repository.
Prepare a mesh from this Unity project's `Assets/Models/` (typically a `.glb`) for the runtime mesh slicer in `Assets/MeshSlicer/Runtime`. Converts arbitrary input (self-intersections, poke-through geometry, open shells, non-manifold edges) into a closed, manifold, outward-oriented mesh that can be safely bisected by an arbitrary plane and capped at runtime. Invoke when the user asks to make a model "sliceable" / "slicer-ready", or when the runtime slicer produces broken caps on a model. Pipeline: import .glb → Voxel Remesh → Decimate → Data Transfer (UVs) → bisect-and-cap probe → export .glb back to Unity. Requires the Blender MCP server (configured in `mcp.json`); runs via `mcp__blender__execute_blender_code`.
Install
npx vskill@latest install keijiro/meshslicer/blender-make-sliceableSKILL.md
blender-make-sliceable
Prepare an arbitrary mesh from this Unity project for the runtime slicer. Output is a closed, manifold, outward-oriented .glb written back into Assets/Models/..., with a runtime-friendly face count and UVs approximately preserved. Verification empirically confirms the mesh can be bisected with an arbitrary plane and cleanly capped with bmesh.ops.holes_fill.
When to invoke
Use this skill when the user wants to make a model under Assets/Models/ safe for the project's runtime slicer (BurstMeshSlicer / NaiveMeshSlicer in Assets/MeshSlicer/Runtime). Typical triggers:
- "Make
<Asset>sliceable" / "Prep this for the slicer." - The runtime slicer produces visibly broken caps on a model — see
Project_Overview.md§8 ("the slicer assumes manifold input"). - A new
.glbwas added underAssets/Models/<Name>_Assets/and needs a sliceable variant.
Before running: verify the Blender MCP server is reachable with a trivial call (e.g., mcp__blender__execute_blender_code running import bpy; print(bpy.app.version)). If not connected, ask the user to start it — do not attempt workarounds.
Pipeline
- Import the source
.glbinto Blender; capture the imported object's name. - Duplicate target; hide original as UV reference and rollback target.
- Voxel Remesh — rebuild a watertight surface (drops UVs).
- Decimate (COLLAPSE) — reduce to a runtime-friendly face count while preserving topological closure.
- Data Transfer (loop UV,
POLYINTERP_NEAREST) — project UVs back from the original. - Shade smooth — set
polygon.use_smooth = Trueon every face; without this, glTF export bakes face normals per corner and Unity renders the result flat shaded. - Verify — watertight + manifold + outward normals + no degenerate faces + slice-and-cap probe + UV present.
- Export
<source>_sliceableas.glbnext to the input so Unity re-imports it.
Result object is named <source>_sliceable. Original stays hidden in the Blender scene.
Execution (via MCP)
Three discrete mcp__blender__execute_blender_code calls: load → prepare → export.
Step 1 — Resolve / load the source object
Pick exactly one of:
- Importing a Unity `.glb` (typical entry point). Substitute
GLB_PATHwith the absolute path of the asset (e.g.,…/MeshSlicer/Assets/Models/Barrel_Assets/selected.glb):
```python import bpy GLB_PATH = "<absolute path to .glb>"
before = set(bpy.data.objects.keys()) bpy.ops.import_scene.gltf(filepath=GLB_PATH) imported = [bpy.data.objects[n] for n in (set(bpy.data.objects.keys()) - before) if bpy.data.objects[n].type == 'MESH'] assert len(imported) == 1, f"Expected 1 mesh, got {[o.name for o in imported]}" print("SRC_NAME=" + imported[0].name) ```
Capture the printed SRC_NAME and use it in Step 2. If the glTF unpacks into multiple meshes, ask the user which to prepare (or join them first if that matches intent).
- Already loaded in the current Blender scene. List candidates and disambiguate:
``python import bpy meshes = [o.name for o in bpy.data.objects if o.type == 'MESH' and not o.hide_get()] active = bpy.context.view_layer.objects.active print({"meshes": meshes, "active": active.name if active else None}) ``
If there is exactly one mesh, or the active object is a mesh, use that as SRC_NAME. Otherwise ask the user. Never guess from a partial name match.
If <SRC_NAME>_sliceable already exists in bpy.data.objects, remove it before Step 2 — leftover state from a previous run breaks the duplicate step.
Step 2 — Prepare the mesh
Substitute SRC_NAME with the value resolved in Step 1. VOXEL_SIZE is auto-computed from the source bbox; only override DECIMATE_RATIO per the Tuning section.
Pass condition: result["pass"] == True. Inspect each sub-block on failure — any single failed check means the mesh is not slicer-ready. Do not proceed to Step 3 unless pass == True (or the user explicitly accepts the failure).
Step 3 — Export back to Unity
Write the prepared object next to the source as a sibling .glb. Default naming: <input_stem>_sliceable.glb (e.g., Assets/Models/Barrel_Assets/selected_sliceable.glb). If that path already exists, confirm with the user before overwriting.
Unity re-imports the .glb on next editor focus. No special importer settings are required for slicing itself, but if the runtime path mutates the mesh at edit time, the importer's Read/Write Enabled flag must be on.
Tuning
- `VOXEL_SIZE` is auto-set to
max_bbox_dim / 100. To override, edit the computed value before theREMESHblock: - Corners or thin plates collapse too much → halve it (face count grows ~4× before decimate).
- Too slow / face count explodes → double it.
- Safety floor: do not go below
max_bbox_dim / 1000without confirming — Blender can hang on extremely small voxel sizes. - `DECIMATE_RATIO`: 0.3 keeps silhouette well in most cases. Lower for lighter assets, but watch the slice probe — aggressive decimation can introduce zero-area faces or break manifoldness. Raise toward 1.0 if
pass == False. Set to1.0to disable decimation if face count is not a constraint. - Recovery on verify failure: delete
<SRC>_sliceable, unhide source (hide_set(False)), adjust parameters, rerun Step 2. The source.glbon disk is never touched until Step 3.
Limitations
- glTF round-trip splits vertices at UV seams and sharp normals. After Unity imports the exported
.glb, the mesh will appear non-manifold even though it remains topologically closed in 3D space. The runtime slicer must perform a merge-by-distance / weld pass on import (tolerance ≈1e-5of model scale) before computing cap geometry. Without this, the slicer will see spurious boundaries along the seams and produce broken caps. This is an export-format limitation, not a defect of the prepared mesh. - Cap-face UVs are out of scope. The runtime slicer must generate UVs for the newly created cap polygons (typically by planar projection in the cut plane).
- UV continuity at voxel boundaries. Where Voxel Remesh boundaries cross original UV island seams, small UV discontinuities remain on the surface. If unacceptable, follow this skill with a Smart UV Unwrap + texture bake into the new UVs.
- Only material slots and UVs are preserved. Vertex colors and other loop/poly attributes are dropped unless
data_types_loops/data_types_polyson the Data Transfer modifier are extended. - Inputs already closed with sharp detail to preserve are better handled by Boolean Union — out of scope here.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingDemo/Assets/Skills/blender-make-sliceable/SKILL.md
Popularity
- Repository stars
- 84
- Repository forks
- 5
- 7-day trend score
- 22
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/keijiro/meshslicer/blender-make-sliceable)