I’m still trying to get my feet wet with tech-artistry and I stumbled onto something that could help my efforts in deconstructing an engine/content that I’m working with…
I’m working with ArmAIII and have a tool packed with this software that can convert from the compressed paa format to tga format. I’ve found a method that can execute this converter by writing a batch script through Photoshop’s file.execute command explained here.
This sample code allows me to define the Cfile_in and Cfile_out explicitly, but I’m looking for a way to assign those variables for each time that a paa file is found throughout a vast directory structure. So I want something that will crawl from a root location and if a paa file is found at that directory layer then apply this code to it:
Cfile_in = "path/file.paa";
Cfile_out = "path/file.tga";
pal2pace = function(){};
pal2pace.execute = function(){
var bat = new File("/c/data/pal2pace.bat");
bat.open("w");
bat.writeln("p:\ ools\ ex\\Pal2PacE.exe\ " +Cfile_in + " " + Cfile_out+"");
bat.execute();
};
function main(){
alert(pal2pace.execute());
};
main();
This works good for one texture and I am learning how to build this out further, but wanted to know if anyone has experience in writing JSX scripts for Photoshop. First, is this API something that’s widely used by tech-artists given the breadth of tools that are out there?
Secondly, does anybody know if it’s possible to script crawling through directories? I want to start with a root directory and find all the paa files in this directory, then convert each file. For each directory within this, crawl it and search for paa files and then convert each of those. Is this possible or far fetched?