About this mod
A GUI-based Python tool for converting and preparing custom image decals for use in **Cities: Skylines II** mods. Easily convert your PNG/JPG files into properly structured decal assets with adjusted metadata and folder structure.
- Requirements
- Permissions and credits
- Mirrors
# ๐จ CS2DecalBuilder
A GUI-based Python tool for converting and preparing custom image decals for use in **Cities: Skylines II** mods. Easily convert your PNG/JPG files into properly structured decal assets with adjusted metadata and folder structure.
---
## โจ Features
- โ Simple graphical interface (built with `tkinter`)
- ๐ง Automatic resizing and padding of textures to ensure compatibility
- ๐ ๏ธ Automatic mesh size calculation based on image dimensions
- ๐ Batch processes entire folders of `.png`, `.jpg`, or `.jpeg` images
- ๐งพ JSON output generated from included template
- ๐๏ธ Automatically organizes output into CS2-compatible folder structures
- ๐ Saves user preferences for convenience
- ๐งช Optional debug logging for developers or power users
---
## ๐ฅ๏ธ Requirements
- Python 3.8+
- [Pillow](https://pypi.org/project/Pillow/)
```bash
pip install pillow
```
---
## ๐ Getting Started
1. Clone or download the repo
2. Install dependencies (`pip install pillow`)
3. Run the tool
```bash
python CS2DecalBuilder.py
```
---
## ๐งฐ How To Use
1. Launch the tool
2. Select:
- ๐ Source folder (image files)
- ๐ Destination folder (structured output)
- ๐ Template JSON file (base decal format)
- โ๏ธ Prefix (used for folder naming like `tree456`)
- โ๏ธ Choose a **Category** (used to create a subfolder).
3. Click **Start Processing**
---
## ๐งฉ Compatibility with Cities: Skylines II
This tool is designed to generate decal folders compatible with the **[ExtraAssetImporter](https://github.com/AlphaGaming7780/ExtraAssetsImporter)** mod.
### โ Required for in-game usage:
- [Download on GitHub](https://github.com/AlphaGaming7780/ExtraAssetsImporter)
- [Or from Paradox Mods](https://mods.paradoxplaza.com/mods/80529/Windows)
### ๐ Install Decals Here:
```bash
C:\Users\USERNAME\AppData\LocalLow\Colossal Order\Cities Skylines II\ModsData\ExtraAssetsImporter\CustomDecals\CategoryName
```
Replace `USERNAME` with your Windows username.
Make sure to use an appropriate **CategoryName** (see [EAI Wiki โ Category Names](https://github.com/AlphaGaming7780/ExtraAssetsImporter/wiki/Custom-Decals)).
---
## ๐งช Output Example
```
destination_folder/
โโโ tree456/
โ โโโ _BaseColorMap.png
โ โโโ decal.json
โโโ tree901/
โ โโโ _BaseColorMap.png
โ โโโ decal.json
```
---
## ๐ Mesh Size Calculation
Automatically determines mesh values from the texture resolution using rules like:
| Resolution | Mesh Size Output |
|------------------|------------------------|
| 512 x 512 | `"x": 4, "z": 4` |
| 1024 x 1536 | `"x": 6, "z": 9` |
| 2048 x 512 | `"x": 16, "z": 4` |
---
## ๐ Logging Options
The script supports optional logging for both regular use and debugging:
```bash
python CS2DecalBuilder.py --debug --logfile debug_output.log
```
- Default log file: `process.log`
- Debug log includes:
- File processing status
- Mesh size values (`x`, `z`)
- Resize operations
---
## โ ๏ธ Limitations
This script was built and tested for creating **WallDecor** assets.
It may work with other decal categories, but:
> โ It does **not** generate `_MaskMap.png` or `_NormalMap.png` files.
> โ It only creates a `_BaseColorMap.png`.
For best results, use categories that **do not** require those extra maps.
---
## โ Troubleshooting
- **Unity errors?** Small or oddly sized images are padded/resized to avoid texture initialization failures
- **Black images in game?** Ensure you're not using formats or dimensions that Unity can't interpret โ stick to common resolutions like 512x512, 1024x1024, 1024x1536, etc.
- **See also:** [EAI Wiki โ Custom Decals](https://github.com/AlphaGaming7780/ExtraAssetsImporter/wiki/Custom-Decals)
---
## ๐ License
MIT โ use freely, credit appreciated!
---
## ๐ Credits & Support
This project was created to simplify custom decal workflows for **Cities: Skylines II** using [ExtraAssetImporter](https://github.com/AlphaGaming7780/ExtraAssetsImporter).
Feedback and PRs welcome!
```