# Mesh & Vertex Editing

This guide explains the optional Mesh Cutting module for the `Equipment Fit Sculptor`.

The module adds a `Cutting` tab to the sculptor. It lets you paint vertex selections in Scene view, duplicate selected faces into new mesh assets, split selected faces into separate skinned mesh renderers, delete faces from an editable source mesh, and weld vertices by distance.

Use this guide when you want to do topology-level equipment cleanup, kitbashing, region extraction, or small mesh repair directly inside Unity.

For splitting a full character prefab into one equipment prefab per `SkinnedMeshRenderer`, see Equipment Splitter Window. The Cutting tab is different: it edits regions inside one mesh renderer.

<figure><img src="https://2969249530-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZtTcZVS4rNhQ4vRad28t%2Fuploads%2Fj1LU3njtUnLgXSECbL4g%2Fimage.png?alt=media&#x26;token=89626868-e8e8-488c-8527-98d85d3fd927" alt=""><figcaption></figcaption></figure>

### What This Module Does

The Cutting tab is intended for editor-time topology editing.

You can use it to:

* create an editable mesh copy for topology edits
* paint vertex selections directly in Scene view
* select complete submeshes
* grow, shrink, invert, clear, or flood-fill connected selections
* convert vertex selections into face selections through configurable face rules
* duplicate selected faces into a new mesh asset
* split selected faces into a new mesh asset and optional renderer
* optionally remove selected faces from the source while splitting
* delete selected faces from the editable source mesh
* weld selected or all vertices by distance
* preserve skinning, bindposes, materials, UVs, colors, and blendshapes as far as possible during split and weld operations

Typical examples:

* cut a shirt into crop-top and sleeve regions
* remove hidden inner geometry from bulky equipment
* split armor plates from a combined mesh for kitbashing
* duplicate a decorative region into its own editable mesh asset
* delete unwanted mesh regions from an equipment prefab
* weld duplicate seam vertices after import or mesh edits

### What This Module Is Not

This module is not a full modeling package.

Do not treat it as:

* a replacement for Blender, Maya, 3ds Max, or ZBrush
* a full retopology tool
* a boolean cutting system
* an edge loop, knife, bridge, bevel, or fill-hole editor
* a UV unwrapping tool
* a material authoring tool
* a safe way to destructively edit original imported FBX meshes without backups

The module is best used for practical Character Creator cleanup and kitbashing workflows where you need to extract, remove, or weld existing geometry.

### Optional Module Behavior

The `Cutting` tab only appears when the Mesh Cutting add-on module is present in the project.

In source form, the module lives under:

```
Assets/Arawn/CrystalCharacterCreator/Editor/Modules/MeshCutting
```

### Requirements

Before using the `Cutting` tab, make sure:

* the selected object has an `EquipmentManager`
* the Equipment Fit Sculptor can load the target body or equipment renderer
* the target is a `SkinnedMeshRenderer`
* the target renderer has a valid `sharedMesh`
* the mesh can be made readable
* you understand which mesh asset the renderer currently uses
* you have version control or backups before deleting faces or welding vertices

The module can create an editable mesh copy when the current mesh comes from an imported model. If the source mesh is imported from an FBX and Read/Write is disabled, the module attempts to enable Read/Write through the model importer and reimport the asset. If Unity cannot make the mesh readable, the operation fails instead of modifying unsafe data.

### Recommended Workflow

For most equipment editing, use this order:

1. Open the `Equipment Fit Sculptor` from the `EquipmentManager`.
2. Select the equipment mesh in the sculptor.
3. Confirm the preview is aligned with the body.
4. Open the `Cutting` tab.
5. Click `Create Editable Cutting Mesh Asset`.
6. Enable `Paint Selection` and `Show Overlay`.
7. Paint the mesh region you want to edit.
8. Use `Face Rule` to decide which faces count as selected.
9. Use `Grow`, `Shrink`, `Connected`, or `Select Submesh Vertices` to refine the selection.
10. Choose the operation: duplicate, split, delete, or weld.
11. Inspect the result in Scene view.
12. Save the prefab and test in play mode with animations.

Do not skip play mode testing. A mesh can look correct in a neutral pose and still expose holes, bad seams, or skinning problems during animation.

### Data Model

The Cutting tab does not overwrite the original imported FBX mesh directly.

When you click `Create Editable Cutting Mesh Asset`, the module creates a generated editable mesh asset under:

```
Assets/Arawn/CrystalCharacterCreator/Generated/MeshCutting
```

The generated mesh is assigned to the active renderer and, for equipment prefab targets, written back to the prefab renderer.

This means:

* the original imported model asset remains intact
* the generated mesh asset becomes the mesh used by the prefab
* topology changes are stored on the generated mesh asset
* generated split region meshes are also stored under `Generated/MeshCutting`
* generated assets must stay in the project if prefabs reference them
* generated assets are authoring output and are excluded from the core DLL source export

Use version control before large topology edits. Generated mesh assets are safer than editing imported FBX data directly, but deleting faces and welding vertices are still destructive changes to the generated asset.

### Opening The Cutting Tab

1. Select a character with `EquipmentManager`.
2. Expand an equipment entry.
3. Click `Open Equipment Fit Sculptor`.
4. Select the desired target in the sculptor.
5. Click the `Cutting` tab.

The tab can target body meshes and equipment meshes. Equipment meshes are the recommended target. Editing body topology can break body culling, blendshape sync, saved presets, and other systems that expect the body mesh layout to remain stable.

### Scene Controls

When `Paint Selection` is enabled:

* `LMB drag` selects vertices under the brush
* `Shift + LMB drag` removes vertices from the selection
* `Alt` remains available for Scene view navigation
* the brush disc is blue when adding selection
* the brush disc is red when subtracting selection
* symmetry draws a second brush disc on the mirrored side

The tool bakes the current skinned renderer into a temporary hidden selection collider. This lets you paint on the visible posed/skinned surface, not only on the raw bind-pose mesh.

`Show Overlay` draws selected faces and selected vertex points in Scene view. The overlay follows the current face rule, so changing `Face Rule` can change which faces are shown even when the selected vertices stay the same.

### UI Reference

#### Target Mesh

`Target Mesh` chooses which loaded renderer the Cutting tab edits.

Use it when:

* multiple equipment meshes are loaded
* an equipment prefab contains multiple `SkinnedMeshRenderer`s
* you need to switch between a body mesh and an equipment mesh

Do not assume the visible clothing is the active target. Always confirm this dropdown before cutting, deleting, splitting, or welding.

#### Renderer

`Renderer` shows the active `SkinnedMeshRenderer`.

Use it to confirm that the tab is editing the correct renderer in the scene or prefab preview.

#### Mesh

`Mesh` shows the mesh asset being edited.

If the mesh is an imported model mesh, destructive operations are disabled until you click `Create Editable Cutting Mesh Asset`.

#### Create Editable Cutting Mesh Asset

Creates a generated editable mesh asset and assigns it to the selected renderer.

Use this before:

* deleting faces
* splitting and removing source faces
* welding vertices
* making any topology edit that should be saved to the mesh asset

The generated mesh inherits the current sculptor/rendering context, then restores the source base vertex geometry where needed so the editable source is stable. It is assigned to the live renderer and written back to the equipment prefab renderer when the target is equipment.

Do not use this casually on the wrong target. It changes the renderer's `sharedMesh` reference to the generated mesh asset.

### Scene Selection

#### Paint Selection

Enables Scene view brush selection.

When disabled, the overlay can still show the current selection, but the brush will not edit it.

#### Show Overlay

Shows selected vertices and selected faces in Scene view.

Use it while cutting to verify exactly what will be duplicated, split, or deleted.

#### Brush Radius

Controls the Scene view selection brush size.

Use a small radius near seams and dense detail. Use a larger radius for broad regions such as a full sleeve, chest plate, skirt panel, or boot section.

#### Symmetry

Mirrors paint selection across a local mesh axis.

Options:

* `None`
* `Horizontal`
* `Vertical`

Use symmetry for left/right or top/bottom mirrored equipment regions. Symmetry depends on matching mirrored vertices within a small tolerance, so it works best on symmetrical meshes.

#### Face Rule

Controls how selected vertices become selected faces.

| Rule                       | Meaning                                                          | Use When                                                           |
| -------------------------- | ---------------------------------------------------------------- | ------------------------------------------------------------------ |
| `AllSelectedVertices`      | A triangle is selected only when all three vertices are selected | You need precise cuts and want to avoid edge spillover             |
| `MajoritySelectedVertices` | A triangle is selected when at least two vertices are selected   | Good default for painted selections                                |
| `AnySelectedVertex`        | A triangle is selected when at least one vertex is selected      | Useful when the selection is too sparse or faces are hard to catch |

If the selected face count is too low, try `AnySelectedVertex` or grow the selection. If too many boundary faces are included, use `AllSelectedVertices` or shrink the selection.

#### Selected Vertices / Selected Faces

Shows live counts for the current selection.

`Selected vertices` is the raw selected vertex count. `Selected faces` is computed from the current `Face Rule`.

#### All

Selects every vertex in the target mesh.

Use this carefully. It is useful for all-mesh welding but dangerous before delete or split operations.

#### Clear

Clears all selected vertices.

Use this before starting a new region.

#### Invert

Inverts the current vertex selection.

Use this when it is faster to select the part you want to keep and then invert to delete or split the rest.

#### Grow

Expands the selection to neighboring connected vertices.

Use this to fill small gaps after painting.

#### Shrink

Removes boundary vertices from the current selection.

Use this to pull the selection away from a seam before cutting.

#### Connected

Selects all vertices connected to the current selection island.

Use this after selecting one small part of a separate mesh island, such as a buckle, armor plate, or separated accessory region.

#### Submesh

Chooses one submesh index from the active mesh.

Submeshes usually correspond to material slots, but this depends on how the mesh was authored.

#### Select Submesh Vertices

Selects every vertex used by the chosen submesh.

Use this when you want to extract or delete a whole material region.

### Cut / Split

#### Output Name

Name for the generated region mesh asset and optional split renderer GameObject.

Invalid filename characters are sanitized. Use stable names such as:

* `Sleeves`
* `ChestPlate`
* `SkirtPanel`
* `BootStraps`
* `CutRegion_ArmorTrim`

#### Create Renderer

When enabled, the tool creates a new `SkinnedMeshRenderer` using the generated region mesh.

The new renderer copies important settings from the source renderer:

* materials
* bones
* root bone
* local bounds
* renderer quality
* update-when-offscreen
* shadow and probe settings

For equipment prefab targets, the new renderer is also written into the equipment prefab as a child next to the source renderer.

Disable this if you only want a mesh asset and do not want to add a renderer to the scene or prefab yet.

#### Remove Source Faces

Controls whether `Split Selected Faces To Mesh Asset` also removes the selected faces from the source editable mesh.

When disabled, splitting creates a separate mesh asset/renderer but leaves the source mesh unchanged.

When enabled, the operation behaves like an extraction: selected faces are copied to a new mesh and removed from the source mesh.

This requires the source mesh to be editable.

#### Recalculate Normals

When enabled, the source mesh recalculates normals after face deletion.

Enable it for most cut/delete workflows. Disable it only when you need to preserve imported custom normals and are prepared to fix shading manually if needed.

#### Duplicate Selected Faces To Mesh Asset

Creates a new mesh asset from selected faces but does not remove faces from the source mesh.

Use it when:

* you want to duplicate a region for kitbashing
* you want to create a separate overlay piece
* you want to test extraction without changing the source
* you want a backup mesh asset for the selected region

If `Create Renderer` is enabled, a new renderer is created for the duplicated region.

#### Split Selected Faces To Mesh Asset

Creates a new mesh asset from selected faces and optionally removes those faces from the source depending on `Remove Source Faces`.

Use it when:

* you want to separate sleeves from a shirt
* you want to split armor plates into independent renderers
* you want to extract a mesh island from a combined renderer
* you want to remove the region from the original mesh while keeping it as a separate piece

#### Delete Selected Faces From Source

Deletes the selected faces from the editable source mesh after confirmation.

Use it when:

* geometry is permanently hidden under other equipment
* a mesh has unwanted inner faces
* you want to remove parts that clip through the character
* you are cleaning a combined mesh for modular use

This is destructive to the generated editable mesh asset. Restore from version control if you delete the wrong faces.

### Merge / Weld

#### Selected Only

When enabled, welding only considers selected vertices.

When disabled, welding can merge vertices across the whole mesh.

Keep this enabled unless you intentionally want a full-mesh weld. Whole-mesh welding can merge separate parts if they sit close together.

#### Weld Tolerance

Maximum distance between vertices that should be merged.

Start very small:

* `0.00001` to `0.0005` for seam cleanup
* `0.0005` to `0.002` for minor import duplicates
* higher values only when you clearly understand the mesh scale

Too large a tolerance can collapse thin details, merge nearby armor plates, or damage UV seams.

#### Weld Vertices By Distance

Merges vertices whose positions are within `Weld Tolerance`.

The tool:

1. Builds representative vertices.
2. Remaps triangles to the representative indices.
3. Removes degenerate triangles.
4. Removes duplicate triangles.
5. Preserves UVs, colors, bone weights, bindposes, and blendshape frames by representative vertex.
6. Clears current sculpt deltas because topology changed.
7. Refreshes the sculptor preview from the edited mesh.

Welding changes vertex count. Any current sculpt deltas tied to the old vertex count are no longer valid.

### What Data Is Preserved

When creating split region meshes, the module copies data for the selected vertices where available:

* vertex positions
* normals
* tangents
* UV, UV2, UV3, UV4
* vertex colors
* `Color32`
* bone weights
* bindposes
* submesh triangle layout
* blendshape frames

When creating a split renderer, the module copies renderer setup from the source `SkinnedMeshRenderer`, including materials and bones.

Some data may still need manual validation after topology edits:

* custom normals after cuts
* bounds for extreme extracted pieces
* cloth simulation components
* material assignments if submesh structure changed
* blendshape behavior after aggressive welds

### Body Mesh vs Equipment Mesh Editing

The Cutting tab can target body meshes and equipment meshes, but equipment meshes are the safer target.

For equipment meshes:

* generated editable assets are written to the equipment prefab
* split renderers can be written back to the equipment prefab
* topology edits are isolated to that equipment item

For body meshes:

* topology edits can break body blendshape presets
* body culling masks may no longer match
* runtime systems may expect the original body vertex layout
* split renderers are not automatically written to a body prefab by the tool

Only edit body topology when you intentionally want to create a new body mesh variant and understand the downstream impact.

### Addressable Equipment Notes

Addressable equipment prefabs can use generated cutting meshes, but the generated mesh assets must be included as dependencies of the addressable prefab.

Recommended workflow:

1. Open the addressable equipment prefab through the Equipment Manager authoring flow.
2. Create the editable cutting mesh asset.
3. Perform split/delete/weld operations.
4. Confirm the prefab renderer references the generated mesh.
5. If split renderers were created, confirm they exist in the prefab.
6. Save the prefab.
7. Rebuild Addressables.
8. Test in a clean project or play-mode addressable load.

If a generated mesh asset is deleted or excluded from the addressable build, the prefab will lose that mesh reference.

### Difference From Equipment Splitter Window

Use `EquipmentSplitterWindow` when:

* you have a full character prefab with many `SkinnedMeshRenderer` children
* you want one new equipment prefab per existing renderer
* you are preparing modular equipment from a bundled character model

Use the `Cutting` tab when:

* you already have a renderer but need to edit regions inside its mesh
* one renderer contains multiple parts that should be separated
* you need to remove hidden faces or inner geometry
* you need to weld duplicate vertices

These tools can be used together. A common workflow is:

1. Use `EquipmentSplitterWindow` to create a rough equipment prefab from a full character model.
2. Register that prefab in `EquipmentManager`.
3. Open `Equipment Fit Sculptor`.
4. Use the `Cutting` tab to remove, split, or weld smaller regions.
5. Use the regular sculpting tools to refine fit.

### Safe Workflow Checklist

Before cutting, deleting, or welding:

* confirm `Target Mesh` is correct
* create an editable cutting mesh asset
* verify `Show Overlay` matches the intended faces
* check `Face Rule`
* use a clear `Output Name`
* decide whether `Remove Source Faces` should be enabled
* keep `Selected Only` enabled for welding unless a full-mesh weld is intended
* use version control before destructive changes

After editing:

* inspect the mesh in Scene view
* rotate the camera and check both front and back surfaces
* test animation poses in play mode
* inspect blendshape behavior if the mesh has blendshapes
* rebuild Addressables if editing addressable equipment
* keep generated mesh assets in source control

### Common Mistakes

#### Deleting The Wrong Region

Symptom:

* a visible part of the equipment disappears after delete.

Cause:

* `Target Mesh`, `Face Rule`, or selection overlay did not match what you intended.

Fix:

* restore from version control or Undo if available
* repaint the selection
* use `AllSelectedVertices` for stricter cuts near borders
* use `Show Overlay` before pressing delete

#### Extracted Region Still Exists In The Source

Symptom:

* the split region appears twice.

Cause:

* `Remove Source Faces` was disabled, or `Duplicate Selected Faces To Mesh Asset` was used instead of split extraction.

Fix:

* enable `Remove Source Faces`
* use `Split Selected Faces To Mesh Asset`
* or delete the same region from the source after verifying the duplicated mesh

#### Weld Damaged Details

Symptom:

* thin parts collapse or nearby pieces merge.

Cause:

* `Weld Tolerance` was too high or `Selected Only` was disabled.

Fix:

* restore from version control
* select only the seam vertices
* lower `Weld Tolerance`

#### Selection Does Not Catch Faces

Symptom:

* selected vertices are visible but `Selected faces` stays low.

Cause:

* `Face Rule` is too strict for the painted selection.

Fix:

* switch from `AllSelectedVertices` to `MajoritySelectedVertices`
* use `Grow`
* use `AnySelectedVertex` for broad captures

#### Runtime Mesh Is Missing After Addressable Load

Symptom:

* an addressable equipment prefab loads but its edited mesh or split renderer mesh is missing.

Cause:

* generated mesh assets were not included as dependencies or Addressables were not rebuilt.

Fix:

* confirm the prefab references the generated mesh asset
* keep the generated asset in the project
* rebuild Addressables

### Troubleshooting

| Problem                                  | Likely Cause                                                | Fix                                                                                          |
| ---------------------------------------- | ----------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| `Cutting` tab is missing                 | Optional module DLL/source is not installed                 | Install the Mesh Cutting module under `Editor/Modules/MeshCutting` or include its editor DLL |
| Destructive buttons are disabled         | Target mesh is not editable                                 | Click `Create Editable Cutting Mesh Asset` first                                             |
| Paint brush does not affect selection    | `Paint Selection` is disabled or raycast misses the mesh    | Enable `Paint Selection`, move the camera, and paint on the visible mesh surface             |
| Overlay does not show expected faces     | `Face Rule` does not match the vertex selection             | Change `Face Rule`, use `Grow`/`Shrink`, or repaint                                          |
| Selected face count is `0`               | Selected vertices do not form faces under the current rule  | Use `Grow` or switch to `AnySelectedVertex`                                                  |
| Split creates a mesh but no scene object | `Create Renderer` is disabled                               | Enable `Create Renderer` before splitting                                                    |
| Split object deforms differently         | Source renderer bone/root setup changed or was not valid    | Verify source `SkinnedMeshRenderer` bones and root bone before splitting                     |
| Delete changes shading                   | Normals changed after cutting                               | Toggle `Recalculate Normals` based on whether you want recalculated or imported normals      |
| Weld says no vertices were close enough  | Tolerance too small or wrong vertices selected              | Increase tolerance slightly or select the seam vertices                                      |
| Sculpt deltas disappear after weld       | Topology changed                                            | Expected behavior; welding clears old topology-dependent sculpt deltas                       |
| Body culling masks no longer line up     | Body or equipment topology changed after masks were painted | Repaint or regenerate culling masks after topology edits                                     |

### Related Docs

* Equipment Fit Sculptor
* Equipment Splitter Window
* Bone Skinning and Weight Painting
* Blendshape Creation and Editing
* Body Culling and Mask Painter
* EquipmentManager

### Related Files

* `Assets/Arawn/CrystalCharacterCreator/Editor/Modules/MeshCutting/EquipmentMeshCuttingSculptorTab.cs`
* `Assets/Arawn/CrystalCharacterCreator/Editor/EquipmentFitSculptor.cs`
* `Assets/Arawn/CrystalCharacterCreator/Runtime/EquipmentManager.cs`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://arawn-software-publishing.gitbook.io/character-creator/add-on-modules/mesh-and-vertex-editing.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
