PSD Autolayout Script copyFriday, June 24, 2016 8:19 PM
This document describes using the PSD (Photoshop file format) Auto-Layout python script to assist you in laying out character layer regions exported out from a PSD framework like Photoshop.
Using Creature's built in Image Packer, basic and easy option:
Exporting data via Texture Packer, advanced option:
Python - You need this installed on your system. Here is a guide on how to install python on Windows. By default, python is already installed on Mac OSX machines. Once that is installed, setup the following:
psd.py Script. Grab it from here
layerExport.py Script. Grab it from here
psdGUI.py Script. Grab it from here
psd-Tools Python package. Instructions to install here
Pillow Python package. Instructions to install here
EasyGui Python package. Instructions to install here
TexturePacker Instructions to install here You only need this if you pick the advanced option.
Python Package installation Tip: In general if you have the PIP setup for python, installing the above python packages is very easy.
For example, to install EasyGui, you would simply type:
pip install easygui
at the command prompt/terminal.
- Make sure you install Pillow, EasyGui and TexturePacker python packages.
- After that, copy psd.py, layerExport.py and psdGUI.py into a directory of your choice
Start out your command prompt/terminal program from that directory in order to run the scripts.
Export with Gui
There is now a gui script to aid you in your PSD export. Just type at the command prompt:
and it will take you through Phase 1 and Phase 2. Please read through the writeups below however to understand how the process works.
python layerExport.py <Source PSD> <Output Folder>
This will generate PNG files per layer into your specified Output Folder from your Source PSD file. These files will be brought into TexturePacker.
python psd.py <Source PSD> <Output JSON>
This will generate an output json file from your Source PSD file.
Run TexturePacker (Remember to check DISALLOW ROTATION)
Drag in the sprites generated from Phase 1
Make sure your export format is set to JSON ARRAY
Make sure you give enough padding for your images in your layout
Export out the packed PNG and json file
Enter Mesh Mode in Creature
Import the packed PNG file from Phase 3
Click Tools->Create Texture Regions from Layout JSON...
Select the TexturePacker json file from Phase 3
You should see your texture region meshes automatically renamed
Enter Rig Mode in Creature
Click on the menu Rig->Create Regions from Layout JSON...
Select your Output JSON from Phase 2. Make sure al the layout regions are listed in the window and click OK
You should see Creature automatically create the appropriate layer region meshes and place them in approximately the correct positions.