Last active
March 28, 2023 01:11
-
-
Save GetUpKidAK/bc6a5e444187c1fb8561c4fc8e760bef to your computer and use it in GitHub Desktop.
Revisions
-
GetUpKidAK revised this gist
Jun 17, 2021 . No changes.There are no files selected for viewing
-
GetUpKidAK revised this gist
Mar 17, 2021 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -21,8 +21,9 @@ #target photoshop // Get iRacing paint path homeDrive = $.getenv("HOMEDRIVE"); homePath = $.getenv("HOMEPATH"); paintPath = homeDrive + homePath + "\\Documents\\iRacing\\paint"; doc = app.activeDocument; -
GetUpKidAK revised this gist
Mar 17, 2021 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -31,6 +31,7 @@ custID = "135364"; // Get car info from filename carModel = doc.name.split(".")[0]; carPath = paintPath + "\\" + carModel; // Original version... // Get car and customer ID from filename -
GetUpKidAK renamed this gist
Mar 17, 2021 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
GetUpKidAK created this gist
Mar 17, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,77 @@ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // iRacing paint exporter // // Created by Samuel Cordingly. (https://members.iracing.com/jforum/posts/list/3795673.page) // // Modified by Ash Kendall. ash.kendall(at)gmail.com ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // NOTES: // - Customer ID must be updated below! // - PSD start with the correct name for the car, based on the paint folder name // -- e.g. Porsche 911 GT3 Cup (991) should be named 'porsche911cup.psd' ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// <javascriptresource> <name>$$$/Menu=Export to iRacing</name> <category>Scripts</category> </javascriptresource> #target photoshop // Get iRacing paint path homePath = $.getenv("HOMEPATH"); paintPath = homePath + "\\Documents\\iRacing\\paint"; doc = app.activeDocument; // Customer ID!! custID = "135364"; // Get car info from filename carModel = doc.name.split(".")[0]; // Original version... // Get car and customer ID from filename //carInfo = doc.name.split(".")[0].split("_") //carModel = carInfo[0]; //carPath = paintPath + "\\" + carModel; //carNum = carInfo[carInfo.length - 1]; // Get layers specLayer = doc.layers["Custom Spec Map"]; albedoLayer = doc.layers["Paintable Area"]; infoLayer = doc.layers["Turn Off Before Exporting TGA"]; // store visibility of layers so that we can go back to how they were specVisible = specLayer.visible; albedoVisible = albedoLayer.visible; infoVisible = infoLayer.visible; // save spec layer specPath = carPath + "\\car_spec_" + custID; albedoLayer.visible = false; infoLayer.visible = false; specLayer.visible = true; saveTarga(specPath); // save main paint layer albedoPath = carPath + "\\car_" + custID; albedoLayer.visible = true; infoLayer.visible = false; specLayer.visible = false; saveTarga(albedoPath); // undo visibility changes albedoLayer.visible = albedoVisible; specLayer.visible = specVisible; infoLayer.visible = infoVisible; function saveTarga(filepath) { targaSaveOptions = new TargaSaveOptions(); targaSaveOptions.alphaChannels = true; targaSaveOptions.resolution = TargaBitsPerPixels.THIRTYTWO; app.activeDocument.saveAs(File(filepath), targaSaveOptions, true, Extension.LOWERCASE); };