Install:

Download and save the script In Photoshop go to File -> Scripts -> Scripts Event Manager

At the bottom, from the drop down box next to Photoshop Events select Save Document and

at Script select browse.. Select the downloaded script (located in the folder where you downloaded the script). Now press Add (at the right side of the panel). Press Done.

Spoiler: NQ - Cities Skylines - Save Texture.jsx HTML: #target photoshop //////////////////////////////////////////////// /// /// /// P H O T O S H O P S C R I P T /// /// ---------------------------------------- /// /// PNG TEXTURE EXPORTS FOR CITIES SKYLINES /// /// /// /// Date: 9/12/2015 /// /// Version: 1.1 /// /// /// /// This script saves the all the kinds of /// /// texture maps with a (_x) suffix if the /// /// art made for that texture map is placed /// /// the corresponding group layer. /// /// /// /// It corrects the document's mode to rgb /// /// 8 Bit and automaticly hides the /// /// "Template" layer on save. It ignores the /// /// "Background". The script only affects /// /// root layers. /// /// /// /// You are free to use / change this script /// /// But if you decide to redistribute please /// /// mention my name as thanks for my effort. /// /// /// /// Update log: /// /// v1.0: Support for diffuse and alpha /// /// v1.1: Added support for all maps /// /// /// /// /// /// Created by Nique de Graaff /// /// /// /// /// /// niquedegraaff@gmail.com /// /// /// //////////////////////////////////////////////// // Initialize var doc = app.activeDocument; var docName = doc.name.replace(/\.[^\.]+$/, ''); var docExt = decodeURI(doc.name).replace(/^.*\./, ''); var docPath = ""; // Run the script main(); function main() { // Check if the document exists if (docExt.toLowerCase() != 'psd') return; docPath = doc.path; // Check if document is in RGB mode, if not update if (doc.mode != DocumentMode.RGB) { doc.changeMode(ChangeMode.RGB); } // Check if document is in 8 bit mode, if not update if (doc.bitsPerChannel != BitsPerChannelType.EIGHT) { doc.bitsPerChannel = BitsPerChannelType.EIGHT; } // Make a list of all affected (root) layers var affectedLayers = {}; for (i = 0; i < doc.layers.length; i++) { if (doc.layers[i].parent == doc) affectedLayers[doc.layers[i].name] = doc.layers[i].visible; } // Save the diffuse texture saveTexture('Diffuse'); // Save the alpha texture saveTexture('Alpha'); // Save the color map texture saveTexture('Color'); // Save the illumination texture saveTexture('Illumination'); // Save the normal texture saveTexture('Normal'); // Save the specular texture saveTexture('Specular'); // Reset all layers as it was for (var key in affectedLayers) { if(affectedLayers.hasOwnProperty(key)) { doc.layers.getByName(key).visible = affectedLayers[key]; } } } // Save Texture function saveTexture(name) { for(i = 0; i < doc.layers.length; i++) { var currentLayer = doc.layers[i]; var save = false; var ext = ""; if (currentLayer.name == name && currentLayer.parent == doc && currentLayer.name != 'Background') { currentLayer.visible = true; save = true; ext = "_" + currentLayer.name.charAt(0).toLowerCase(); } else { currentLayer.visible = false; save = false; } if (save == true) { var file = File(docPath + "/" + docName + ext); if (file.exists) file.remove(); SavePNG(file); } } } // Saves the (texure) file to disk function SavePNG(file) { pngSaveOptions = new PNGSaveOptions(); pngSaveOptions.compression = 0; pngSaveOptions.interlaced = false; activeDocument.saveAs(file, pngSaveOptions, true, Extension.LOWERCASE); }

How to use:

Auto setup?

When you no longer want to make use of the script, simply go to the Script Event Manager and disable the script.In case the download link gets removed... the script is here, save it as a jsx file:When you export your UV Template to a PNG file, open it with Photoshop.Make sure (for practice) that you saved it as a 8 bit rgb(a) file or change that mode in Photoshop. The script will change the mode if you forgot to do it. If you use other modes the game will not recognize your model and textures as valid and fails to import it.Change the layer name (there is probably only one for now) to "Template" and lock it.In the root (important!) add the layer groups ("Diffuse", "Alpha", etc). Inside these folders you can do whatever you want.Optionally you can add a background layer called "Background". This layer will be ignored by the script and will get saved to the resulting png files.It doesn't really matter how you do it because all layers with the name Specular for example will be visible only for the specular texture. The rest will be hidden. You can make as many Specular Layers/Groups as you want.You can setup your Layer structure like this. But this is just an example.I did all the stuff in groups because when minimized, i get more space in the layers paleteNow, save the document as a PSD file.On the next save, the script puts the texture files next to where the PSD file is stored.If you do not save your created and opened template as a PSD first, the script will do nothing as it needs to know where to store the png files. The script also automaticly adds the _d and _a suffixes to the file names.Now, everytime you save the document (as psd and not as 'save as..'), the png's will be generated.Im also working on a 'setup script'. It is not finished yet, i'm at 80%. When you load the by your 3D Modeling software generated uv map template file (png), the script will automatically generate those layer groups and create basic layer masks for you to start. The script works but there are some wonky things going on I want to fix before I release that.