-
Notifications
You must be signed in to change notification settings - Fork 3
JSON Migrator to EAI2 (Python Script)
Triton Supreme edited this page Oct 9, 2025
·
8 revisions
This Python script allows you to migrate old importer folders (used by the ExtraAssetsImporter for Cities: Skylines II) into the new split format, using template-based overrides.
It can:
- Convert legacy
surface.json,decal.json, andnetlane.jsonfiles to the newPrefab.json+Material.jsonstructure. - Automatically fix pink Normal Maps for surfaces.
- Optionally convert textures to 8-bit to reduce file size (Enabled by default).
- Share identical textures across assets by replacing duplicates with a small JSON reference.
- The script automatically looks for
_DefaultJsontemplates locally or in the default Cities: Skylines II LocalLow path. - If templates are missing, it will raise an error and skip conversion for that format.
- The texture sharing step creates small
.jsonfiles containing only apathproperty pointing to the shared texture location, to reduce disk usage.
# Install dependencies
pip install pillow numpy imagequantPlace the script next to your old importer folders (e.g. CustomSurfaces, CustomDecals, CustomNetLanes) and run :
python JsonMigratorToEAI2.pyMake sure you have Python 3.8+ installed, then run:
# Install required libraries
pip install pillow numpy imagequantRemove the script from your hard drive and then run:
pip uninstall pillow numpy imagequant -yPlace the script next to your old importer folders (e.g. CustomSurfaces, CustomDecals, CustomNetLanes) and run:
python JsonMigratorToEAI2.py| Argument | Required | Description |
|---|---|---|
--format {surfaces,decals,netlanes} |
β
if using --input-dir or --output-dir
|
Specifies which asset type to process. |
--input-dir DIR |
β | Path to old importer folder (processed recursively). |
--output-dir DIR |
β | Output base directory. Defaults to Surfaces, Decals or NetLanesDecal depending on format. |
--fail-fast |
β | Stop the script on the first error instead of continuing. |
--force-8bit / --no-force-8bit
|
β | Enable or disable automatic conversion of textures to 8-bit. Enabled by default. |
--force-8bit-types {_BaseColorMap,_MaskMap,_NormalMap} |
β | Specify which texture types to apply 8-bit conversion to. Defaults to all three. |
python JsonMigratorToEAI2.pypython JsonMigratorToEAI2.py --format surfacespython JsonMigratorToEAI2.py --format surfaces --input-dir "C:\path\to\CustomSurfaces"python JsonMigratorToEAI2.py --format decalspython JsonMigratorToEAI2.py --no-force-8bitpython JsonMigratorToEAI2.py --force-8bit-types _BaseColorMap _NormalMapMyModFolder/
ββ JsonMigratorToEAI2.py
ββ CustomSurfaces/
β ββ Category/AssetName/surface.json + textures
ββ CustomDecals/
β ββ ...
ββ CustomNetLanes/
β ββ ...
After migration, the output will look like: ( NOTE : I removed the old folder, but the script doesn't remove them)
MyModFolder/
ββ Surfaces/
β ββ Category/AssetName/Prefab.json + Material.json + textures
ββ Decals/
β ββ ...
ββ NetLanesDecal/
β ββ ...
MIT License β Feel free to modify and distribute this script.