# Editing .ytd files with CodeWalker

> Edit GTA 5 texture dictionaries in CodeWalker: open a .ytd, export to DDS, replace textures keeping names and formats, +hi dictionaries and pink fixes.

Source: https://fam-tools.com/guides/codewalker-ytd-editing · FAM Tools · published 2026-09-11 · updated 2026-09-11 · about 9 min

**Short answer.** Open the `.ytd` in CodeWalker, export the textures you want to change, edit them at the same size, save them as DDS with the right compression and mipmaps, then use Replace on each texture (the name must stay identical) and save the dictionary. Weapons often have a `+hi.ytd` high-detail dictionary as well — edit both. Stream the `.ytd` in a resource and restart it.

## Key points

- Texture names must stay exactly the same.
- Keep power-of-two sizes; compress with mipmaps.
- Many weapons have `name.ytd` and `name+hi.ytd` — update both.
- Keep the original file as a backup before saving.

Every weapon skin ends the same way: new textures going into a `.ytd` texture dictionary. CodeWalker is free, handles DDS import and export, and is the tool most FiveM texture artists use for it. The editing is simple; the details that matter are names, sizes and formats.

## Step 1: open and export

1. Open CodeWalker’s RPF Explorer (or open the loose file) and double-click the `.ytd`.
2. The texture list shows each texture’s name, size and format — note them.
3. Export the textures you will edit (DDS keeps the original data; PNG is easier to paint on).

## Step 2: edit

Paint at the same resolution (or a power-of-two change you intend), and save as DDS with a suitable format and a full mip chain. Formats: [DDS formats](https://fam-tools.com/guides/fivem-dds-texture-formats-dxt-bc7); mipmaps: [mipmaps explained](https://fam-tools.com/guides/fivem-mipmaps-explained).

## Step 3: replace and save

1. Select the texture in the dictionary and choose Replace, then pick your DDS.
2. Check the name in the list is unchanged — the model looks textures up by name.
3. Save the `.ytd` (to a new file first, keeping the original).

> **Adding versus replacing** — Adding a texture with a new name does nothing unless the model’s shader references that name. For retextures, always replace.

## The +hi dictionary

Many weapons come with a high-detail model (`_hi.ydr`) and texture dictionary (`+hi.ytd`) that the game uses up close, for example in first person. If you only edit the normal `.ytd`, the skin appears in third person and vanishes when you aim in first person. Edit both.

## Step 4: stream it

*Resource layout*

```text
my_weapon_skins/
  fxmanifest.lua
  stream/
    w_pi_pistol.ytd
    w_pi_pistol+hi.ytd
```

Files in `stream/` are streamed automatically. Restart the resource and reconnect if the old texture is cached. Pink or checkerboard textures mean a name mismatch — see [pink weapon textures](https://fam-tools.com/guides/fivem-weapon-pink-textures).

## Questions

### How do I edit a YTD file?

Open it in CodeWalker, export the textures, edit them, and replace each one with a DDS of the same name, then save.

### Why is my retexture only visible in third person?

The weapon also has a `+hi.ytd` used up close. Replace the textures there too.

### Can I change texture sizes?

Yes, keep them power-of-two; the UVs still map correctly.

### Why does my weapon turn pink after editing?

A texture name changed or a texture is missing. Names must match exactly.

## Related

- https://fam-tools.com/guides/ytd-texture-dictionary
- https://fam-tools.com/guides/fivem-dds-texture-formats-dxt-bc7
- https://fam-tools.com/guides/fivem-weapon-pink-textures
- https://fam-tools.com/guides/make-a-fivem-weapon-skin
