mirror_map.py does following with a Supreme Commander map file and it's corresponding _save.lua
- Mirrors every embedded image (e.g. preview, height map, stratas, normal maps, ...)
- Mirrors decals including albedo and normal files
- Mirrors props and rotate them to look somewhat more "mirrored"
- Mirrors markers and units
Mirror refers to mirror from center along x axis or y axis or mirror along one of both diagonals.
The script uses lupa to open _save.lua
.
Shouts out to HazardX
for initial reverse engineering of the scmap format, but not to forget svenni_badbwoi
and tokyto
for maps which needed to be mirrored and kicking off this whole thing.
- Option "keep side" doesn't remove units/props/decals on mirror side prior to mirroring
- This is intentional at least for decals as they can have origin on mirrored side and still span more of the original side
- For units and props it's just not implemented
- Mirrored preview image doesn't have correct lighting on mirrored side
- Workaround: Save mirrored version with SC map editor to get preview re-rendered
- Unit meshes are not getting mirrored
- Yeah, what can I do about this?
- Connections between nodes are not taken into account
- You need to fix air and land pass nodes in SC map editor after mirroring
I didn't use Windows while implementing this script. I did only use Windows running in a VM to make some of theses screenshots below. Thing is, Windows is bad at the command line. That's why you Windows users need a mirror_batch_example_theta.bat file. You will have to fill in all your Python/ImageMagick/Maps pathes there, because you wouldn't want to do that in a Windows terminal. Some advice would be to create a copy of that file for every map you want to mirror. You will change this file more than once and you need to understand most of it. The file contains a usage/help text from the mirror script as reference to the mirror script command line.
- Download and install Python 3.5
- Find and remember Python 3.5 path
- Find and remember SC gamedata path
- Copy and update mirror Batch script
- Running first time
Put in all the pathes you remebered and maybe change --mirror-axis
and/or add a --keep-side=2
parameter.