> For the complete documentation index, see [llms.txt](https://docs.otherplanet.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.otherplanet.dev/scripts/op-clothing/tutorials/screenshotting-clothes.md).

# Screenshotting Clothes

## Addon Clothing Screenshots

{% hint style="info" %}
Vanilla GTA clothing already has thumbnails served from the OTHERPLANET CDN, so you only need to capture **addon / streamed** items. The menu works without any images - missing items just show a numbered placeholder.
{% endhint %}

The thumbnail generator spawns a ped in a hidden sky studio, applies one item at a time against a green backdrop, takes a screenshot, then chroma-keys it into a transparent PNG.

## Requirements

* **screenshot-basic** must be started (set in `server.cfg` before `op-clothing`).
* `Config.Thumbnails.Enabled = true`.
* You must pass the admin permission gate (or run it on a player you control).
* Your addon clothing must be **streamed and working** in-game first.

{% hint style="warning" %}
Run the capture on a **test / dev server** with no other players around. The ped is teleported to a sky studio for each shot, so do it on a character you don't mind moving.
{% endhint %}

## Step 1 - Quick test first

Validate framing and the green-screen key on a few items before a full run:

```
/op_clothing_thumbs_test male 3
/op_clothing_thumbs_test female 3
```

This captures only the first 3 drawables per category. Open the clothing menu and check the tiles look correct.

## Step 2 - Full capture

Run a complete batch per gender:

```
/op_clothing_thumbs male
/op_clothing_thumbs female
```

{% hint style="info" %}
With `Config.Thumbnails.SkipCdnCapture = true` (default) the batch **skips every item already on the CDN** and only shoots what's missing - i.e. your addon items. This keeps the run short even on a full wardrobe.
{% endhint %}

## Step 3 - Targeted captures (optional)

| Command                                           | What it captures               |
| ------------------------------------------------- | ------------------------------ |
| `/op_clothing_thumbs_hair [male\|female] [count]` | Hairstyles only (head visible) |
| `/op_clothing_thumbs_wrist [male\|female]`        | Watches + bracelets only       |
| `/op_clothing_thumbs_test [male\|female] [count]` | First N drawables per category |

You can also **re-shoot a single item** from the in-game admin menu (`/clothingadmin` → item → re-capture) when one thumbnail needs a redo.

## Step 4 - Build the hash map

Addon clothing shifts the raw drawable indices whenever packs are added or removed. The hash map keeps existing thumbnails resolving to the right item:

```
/op_clothing_thumbs_map male
/op_clothing_thumbs_map female
```

{% hint style="success" %}
With `Config.Thumbnails.AutoHashMapAfterBatch = true` (default) this runs automatically after every full batch, so you usually don't need to call it by hand.
{% endhint %}

## Step 5 - Serve the new images

Captured PNGs are written to `web/thumbnails` inside the `Config.Thumbnails.StoreResource` (default `op-clothing`). To serve the fresh `nui://` URLs:

```
restart op-clothing
```

If you moved the store to a **separate assets resource**, that resource is remounted automatically and no restart of op-clothing is needed.

## Where files go

| Setting                           | Default                                   | Meaning                         |
| --------------------------------- | ----------------------------------------- | ------------------------------- |
| `Config.Thumbnails.StoreResource` | `op-clothing`                             | Resource the PNGs live in       |
| `Config.Thumbnails.StorePath`     | `web/thumbnails`                          | Folder inside that resource     |
| `Config.Thumbnails.LocalBaseUrl`  | `nui://op-clothing/web/thumbnails/%s.png` | URL template for captured items |
| `Config.Thumbnails.BaseUrl`       | CDN                                       | URL template for vanilla items  |

## Troubleshooting

* **"screenshot-basic is not started"** - add it to `server.cfg` above op-clothing.
* **Green edges on items** - lower `Config.Thumbnails.KeyHard` (more aggressive key).
* **Wrong framing for a slot** - tweak `Config.Thumbnails.CameraSlots['component:X']` (`fov`, `distance`, `zPos`).
* **Thumbnails don't update** - `restart op-clothing` (or reopen the menu) so the new `nui://` files are mounted.
* **Access denied** - check your permissions.
