Jump to content

Recommended Posts

This is a script I wrote to improve and speed up my workflow for the mod I'm working on. I decided to share it with the rest of you in case you are as frustrated as I am while iterating textures. It's pretty easy to use but for the sake of clarity I will write down details.

Why?
Copying and collapsing layers into their corresponding channels (gloss, specular, alpha etc), save as .tga, browse to correct data folder, write the name of the texture (in case your PS file had a different name), select number of bits, export, open TexView, save as .paa. <---- This times the number of textures needed to complete the asset takes a lot of time, especially when iterating. Also, working with channels in Photoshop can be tedious and this script/workflow fixes that too.

So, what does the script do?
All of these steps. .tga and .paa files are outputted. It forces a workflow but it is, in general, a good one to follow anyway.

In detail, this is how the workflow works.
1. Setting things up:
The script can be anywhere on your machine.
The PSD can be anywhere on your machine (but in general place it in your source folder).
To setup the Arma 3 Tools path for the script, open ps_to_paa.jsx (in notepad is fine), on the 4th line type the path to your Arma 3 Tools.
To setup your EXPORT path, in Photoshop go to File>File Info... and type the path in the Description field. For example P:\myMod\data. Do not write/paste the last " \ ". This has to be done for each PSD you make.

To setup an export keyboard shortcut (which is very much recommended): open the Actions window in Photoshop, "Create New Action", name it something like PS_To_Paa, set function key to any of your preference (I use F7), hit Record, Go to File->Scripts->Browse... and load the ps_to_paa.jsx file you downloaded. Stop recording. Now when you hit F7 the script will run.
 

2. PSD authoring Workflow.
The workflow is based on Layer Groups. It does NOT support having layers outside of groups but hidden layers inside groups are OK (won't be exported). Groups within groups might not work (haven't  tested it). Each texture, for example "myImage_co", has it's own group. In some instances, for example if you want an alpha channel for your "myImage_co" texture a special type of group is created, namely "myImage_co.a". This will during export place the information in the alpha group into the alpha channel. The exporter needs and will make use of the alpha channel in the document during export so consider it not yours. Also, please make sure there is an alpha channel in the document before attempting to export. Multiple alpha channels in the PSD is not supported.

The script reads and processes following Layer Group names as something special:
".a" - alpha channel of a texture. Example: image_nohq.a
".specular" - if a specular AND a gloss group exists in your PSD it will combine these for you and fill the Red channel with 1. The texture exported will automatically be named _smdi. Limitation: you cannot have multiple spec/gloss textures in your PSD. Example: image.specular and image.gloss
".gloss" - see specular description ^
".shadow" -  Diffuse Shadow part of an ADS/ADSHQ texture - If you're only using Ambient Occlusion/ want the same data as AO in the shadow this group can be ignored. Example: image_ads.shadow
"hq.shadow" - same as ".shadow" but as high quality. Example: image_adshq.shadow

"REF" - group isn't exported. Example: REF_image

See attached image to get a better understanding of what you PSD should look like when following this workflow and what textures it will produce.
ps_to_paa_1.jpg


NOTE: This script was mainly created for my own work so I haven't made it bulletproof. There is almost no exception handling. Errors in your PSD won't be resolved by the script and could break the export half ways and you will have to clean up the mess manually. Undo is not supported but if you undo long enough you'll get back to your "real" history, assuming that you have enough History States.
If I see a lot of interest in this, I might come back with one or two updates. One feature I'd like to put in is an option to flip the green channel on export to support for example OpenGL normals maps on the source side (Maya for example) and DirectX after export.

Feel free to drop suggestions and if I forgot to mention any step, let me know.



Download Photoshop To PAA here (right-click, save target as)





 

Quote

 

 

  • Like 3
  • Thanks 2

Share this post


Link to post
Share on other sites

I'm sorry, there was a bug in the script making paa conversion not working. The script was reuploaded just now.

Share this post


Link to post
Share on other sites

I love you, take me and make me yours!!

Share this post


Link to post
Share on other sites

That's great! Save a lot of time! Thanks!

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×