# Garment support from scratch

## Summary

Created on: 29. 12. 2023 by [mana vortex](https://app.gitbook.com/u/NfZBoxGegfUqB33J9HXuCs6PVaC3 "mention")\
Last documented update: Nov 10 by [Martin Blecker](https://app.gitbook.com/u/uTg0IPgQKfba7RsC4EVdUSMuJqv2 "mention") and [mana vortex](https://app.gitbook.com/u/NfZBoxGegfUqB33J9HXuCs6PVaC3 "mention")

This guide will teach you how to add garment support to a mesh that doesn't have any.

### Wait, that's not what I want!

* To learn what garment support is, check [](https://wiki.redmodding.org/cyberpunk-2077-modding/for-mod-creators-theory/3d-modelling/garment-support-how-does-it-work "mention")
* For general Blender editing tips, check [blender-getting-started](https://wiki.redmodding.org/cyberpunk-2077-modding/for-mod-creators-theory/3d-modelling/blender-getting-started "mention")

### Difficulty

You should know what [garment support does](https://wiki.redmodding.org/cyberpunk-2077-modding/for-mod-creators-theory/3d-modelling/garment-support-how-does-it-work), because it won't be explained here.

This guide assumes that you know your way around in WolvenKit. If you don't and you want to mess with this, kudos — I salute your frustration tolerance. In this case, the wiki's search function will be your new best friend.

## Prerequisites

* [ ] A [WolvenKit project](https://app.gitbook.com/s/-MP_ozZVx2gRZUPXkd4r/wolvenkit-app/usage/wolvenkit-projects)
* [ ] One or more [meshes as .glb](https://wiki.redmodding.org/cyberpunk-2077-modding/modding-tools/wolvenkit-blender-io-suite/wkit-blender-plugin-import-export#meshes)

<table><thead><tr><th width="180"></th><th width="179"></th><th></th></tr></thead><tbody><tr><td>Wolvenkit<br><a href="https://github.com/WolvenKit/Wolvenkit/releases">Stable</a> | <a href="https://github.com/WolvenKit/WolvenKit-nightly-releases/releases">Nightly</a></td><td>>= 8.15</td><td>You can't make mods without Wolvenkit</td></tr><tr><td><a href="https://www.blender.org/download/releases">Blender</a></td><td>>= 4.2</td><td>3d editing software</td></tr><tr><td><a data-mention href="../../modding-tools/wolvenkit-blender-io-suite">wolvenkit-blender-io-suite</a></td><td>>= 1.6.0 (download tags <a href="https://github.com/WolvenKit/Cyberpunk-Blender-add-on/tags">here</a>)</td><td>The Wolvenkit Blender Addon. You can't import/export to Blender without it.</td></tr></tbody></table>

## Step 0: export and join the base

As a preparation for our garment support, we need a base that we'll shrinkwrap to. For this guide, we'll be using **the full player body in a single mesh**.

You need the following files:

#### Female body gender

```
# default head
base\characters\head\player_base_heads\player_female_average\h0_000_pwa_c__basehead\h0_000_pwa_c__basehead.mesh
# arms
base\characters\common\player_base_bodies\player_female_average\arms_hq\a0_000_pwa_base_hq__full.mesh
# base body
base\characters\common\player_base_bodies\player_female_average\t0_000_pwa_base__full.mesh
```

#### Male body gender

```
# default head
base\characters\head\player_base_heads\player_man_average\h0_000_pma_c__basehead\h0_000_pma_c__basehead.mesh
# arms
base\characters\common\player_base_bodies\player_man_average\arms_hq\a0_001_pma_base_hq__full.mesh
# base body
base\characters\common\player_base_bodies\player_man_average\t0_000_pma_base__full.mesh
```

[Import](https://wiki.redmodding.org/cyberpunk-2077-modding/modding-tools/wolvenkit-blender-io-suite/wkit-blender-plugin-import-export#importing-into-blender) all those meshes to Blender, then join them all into a single mesh:

1. In the viewport, click anywhere to deselect everything
2. Press `A` to select everything visible again
3. Shift-click on something (e.g. the head) to deselect it
4. Shift-click again to re-select it (you need a most recent selection)
5. Press `Ctrl+J` to join all those meshes together

Optional: Clean up

* In the outliner on the right, delete all empty collections
* Double-click on your mesh and rename it to something, e.g. `body`

You should be looking at something like this:

<figure><img src="https://1427525421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4gzcGtLrr90pVjAWVdTc%2Fuploads%2Fgit-blob-b9b52e8698718824afa3b18f4f184195392f2325%2Fcustom_garment_support_step1.png?alt=media" alt=""><figcaption></figcaption></figure>

This is the base that your items will shrink to, thus not-clipping. Neat, isn't it?

### Step 0.5 (optional): activate garment support

{% hint style="info" %}
You only need this if you're layering garment support — for example, shrinking a custom-made decal under a jacket. Don't do this with the base body, it will shrink on its own to stay underneath the clothes!
{% endhint %}

If you're using a custom mesh as the base, you need two prerequisites:

1. Join everything, so that you have only **one** mesh. This mesh must cover everything that yours can potentially shrink to - if you fit the Netrunnner suit without the head mesh as part of the body, the collar will clip into the neck when you're wearing a coat
2. You need to **activate** garment support on the mesh. You do this by switching to the Data tab and setting its `Value` to 1:

   <figure><img src="https://1427525421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4gzcGtLrr90pVjAWVdTc%2Fuploads%2Fgit-blob-20d2e65f5a73ca6358d4f06df92fa5aba34c30e3%2Fblender_enable_garment_support.png?alt=media" alt=""><figcaption></figcaption></figure>

## Step 1: Add garment support

Import a mesh that needs garment support. In Object mode, **select** it by clicking on it so that it has a yellow outline like the body in the picture above, and switch to the `Data` tab on the right:

<figure><img src="https://1427525421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4gzcGtLrr90pVjAWVdTc%2Fuploads%2Fgit-blob-9b994ecff8ab44f1e8b822d7dbe79daaa75b8cbe%2Fcustom_garment_support_step2.png?alt=media" alt=""><figcaption></figcaption></figure>

The `Shape Keys` dropdown should be empty. (Otherwise, hit the `-` button until it is).

1. Click on the `+` button to create a shape key with the name `Basis`. This is the garment's original shape and will tell Cyberpunk how it looks when it's *not* squished.
2. Repeat this process for every submesh (`submesh_01_LOD_1` and `submesh_02_LOD_1` on the screenshot above)
3. Switch to the `Modifiers` tab (the blue wrench icon, it's active in the first screenshot)
4. Add a `shrinkwrap` modifier
5. Target it to the mesh from the previous step (e.g. `body`):

<figure><img src="https://1427525421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4gzcGtLrr90pVjAWVdTc%2Fuploads%2Fgit-blob-a4df6a676297c956bed290af07d40c9018f89559%2Fcustom_garment_support_shrinkwrap.png?alt=media" alt=""><figcaption></figcaption></figure>

6. **optional**: Add a small `offset` (e.g. `0.001`) to make it not-clip. If the mesh you're shrinking to has garment support and you haven't enabled it, this isn't necessary.
7. You will now see that the garment has shrunk down to the body's dimensions — this is how the game avoids clipping.
8. Apply the modifier as shapekey:

<figure><img src="https://1427525421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4gzcGtLrr90pVjAWVdTc%2Fuploads%2Fgit-blob-e84b9c2a846576031cd1c77015d999955cc2a218%2Fapply_as_shapekey.png?alt=media" alt=""><figcaption></figcaption></figure>

9. You will now see that the garment un-shrinks itself: that is because the shapekey isn't active.
10. Switch to the `Data` tab again (the green triangle). There is a new shapekey now; it's called `Shrinkwrap`.
11. If you want to see it in action, set its `Value` to 1.
12. Rename it to `GarmentSupport` (capital G and S, no spaces — double-click on the name):

<figure><img src="https://1427525421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4gzcGtLrr90pVjAWVdTc%2Fuploads%2Fgit-blob-44c842d5ec32a4fa6a781f97c126b616b24c1622%2Fcustom_garment_support_rename_shapekey.png?alt=media" alt=""><figcaption></figcaption></figure>

That's it, your mesh has now garment support. Rinse and repeat the process with the other submeshes, then export everything back.

## Troubleshooting

### My garment support isn't working!

You still need to use [component name prefixes](https://wiki.redmodding.org/cyberpunk-2077-modding/for-mod-creators-theory/3d-modelling/garment-support-how-does-it-work/..#component-prefixes) for garmentSupport to become active. If that wasn't it, check your shapekey names for typos or trailing spaces.

The component must of a type that supports morphing e.g. entGarmentSkinnedMeshComponent; if your component is of entSkinnedMeshComponent garment support wont work.

### My garment support is clipping into the body!

Try re-doing the shrinkwrap, but with a higher offset instead. Try something like 0.002 or so, whatever works for you.

### My garment support looks messy or clips a lot with other clothes!

Try making some garment support parameters! Check out [Painting garment support parameters](https://wiki.redmodding.org/cyberpunk-2077-modding/for-mod-creators-theory/3d-modelling/garment-support-how-does-it-work/painting-garment-support-parameters) for guidance.


---

# 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://wiki.redmodding.org/cyberpunk-2077-modding/for-mod-creators-theory/3d-modelling/garment-support-how-does-it-work/garment-support-from-scratch.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.
