03 October 2011
I’m back from sunny San Francisco after my first Unite conference. It was a wonderful trip. I visited old friends and met new ones. At the conference I gave the talk, “Artists as Programmers”, then helped out with the “Artist Discussion”. Lots of fun. I’m already looking forward to next years Unite.
During the talks I mentioned a tool I had written that speeds publishing assets to the Unity assets folder. It’s a python script I’ve written and embedded in an Automator task.
Here’s how I use it:
All my work-in-progress images, animations and meshes I keep organised in my Development folder (marked in grey below). As an example the background daytime & nighttime image is located at Sin or Win/Development/Environment/Artwork/Environment Art v019.psd. I tend to work at least double the desired size, and enjoy layers so this Photoshop image is 500+ megabytes. To export to Unity I save the image using Photoshop’s Save for Web interface, dumping the png to Sin or Win/Development/Environment/Publish/Environment Art v019.png.
I’ll work away in Photoshop updating several different images at a time. When it’s time to copy them all into Unity I’ll use my Publish Automator script. I select the updated images in the Publish folders and drag them all onto my publish tool in the Finder toolbar. My script then copies the files into the appropriate location in the Unity/Assets folder while also stripping their version number. This last bit is important. If the image retained it’s “v019” Unity would see it as a new image and I’d get a messy Unity/Assets folder as well as have to manually assign the image to existing materials. Working with the publish tool enables me to work outside the Unity/Assets folder with version history, and easily publish to the Unity/Assets folder with Unity updating automatically. The script also automatically creates any folders in the Unite/Assets folder that are needed.
It’s saved me a tonne of time by simplifying my workflow. Hopefully it’ll help your development pipeline.
Instructions for Installation
- Download, unzip and store where convenient
- Drag the icon to your Finder toolbar
- To change the Python script within the Automator action, right click on the Toxic Blob Publish Automator application and select “Show Package Contents”. Open the Contents folder. Then open document.wflow in your favourite text editor
- On line 74 is the variable “devPath” which is my “/Development” folder, and on line 75 is the variable “publishPath” which is my “/Unity/Assets” folder. Change both to suit your paths & save the file
- Drag any file(s) onto the tool and relax as it copies them into your Unity project. Note, I haven’t tested dragging folders onto the tool, and that may not work as you would expect, so stick to files
- If you find this tool useful, drop me an email or a tweet and let me know where you’re using it. Thanks!