AWS Thinkbox Discussion Forums

Deadline for Photoshop?

Hi,

I’m looking for a way to execute a Photoshop script from Deadline.

My current setup is a scripted watchfolder in Bridge wich sends .pdf files to Photoshop.
These are then processed by Photoshop scripting, when done and Photoshop is idle the next pdf file is presented.

This works fine but there is no queue to manage and also I want to scale this to multiple hosts.
Is there a way for Deadline to watch for .pdf files and send them to a Photoshop script when idle?

Because the Photoshop script involves several stages I would also like to send progress indicators from within the Photoshop script to Deadline. What would be the most efficient way to execute this?

Many thanks for advice!
Kind regards,
Danny

Hey Danny,

What would the command line executable and arguments be to submit the pdf to the script manually? When you submit does it output progress to StdOut?

Regards,

Charles

Hello Charles,

Currently I’m using Adobe bridge as batch manager based on this watch folder script:
It uses: if (BridgeTalk.getStatus(“photoshop”) == “IDLE”) to queue the next file

//The Hot Folder will be the folder where you run the script. //You should be able to use bridge as normal. if( BridgeTalk.appName == "bridge" ) { var newMenuHF = new MenuElement( "menu", "Hot Folder", "after Help", "hotFolder" ); var runHotFolder= new MenuElement( "command", "Start Hot Folder", "at the end of hotFolder" , "hotFolderxx" ); } runHotFolder.onSelect = function () { var thisFolder = encodeURI(Folder(app.document.presentationPath)); var cmd = "$.setenv('HotFolder','" +thisFolder+ "');"; var bt = new BridgeTalk(); bt.target = "photoshop"; bt.body = cmd; bt.send(); processHotFolder = function(){ /* files to look for */ if(Folder(thisFolder).getFiles(/\.(jpg|tif|psd|cr2,nef)$/i).length <1) return; if (BridgeTalk.getStatus("photoshop") == "IDLE"){ bt.target = "photoshop"; bt.body = "var PShotFolder = " + PShot.toSource() + "; PShotFolder();"; bt.send(); } } BottomBar = app.document.navbars.filesystem.bottom; BottomBar.height = 30; BottomBar.visible = true; BottomBar.bu1 = BottomBar.add ('button',[5,5,300,25],'Stop Hot Folder'); id = app.scheduleTask( "processHotFolder()", 2000, true ); BottomBar.bu1.onClick=function(){ app.cancelTask (id); BottomBar.visible = false; } function PShot(){ var SCRIPTS_FOLDER = decodeURI(app.path + '/' + localize("$$$/ScriptingSupport/InstalledScripts=Presets/Scripts")); var hotFile = new File(SCRIPTS_FOLDER + "/PShotFolder.jsx"); $.evalFile (hotFile); } };

Photoshop then picks up the file and continues (based) on this script: PShotFolder.jsx
In my version of this script I added lots of texture extractions code based in the pdf file names. (not visible here)

#target Photoshop main(); function main(){ if($.getenv('HotFolder') == null){ alert("Please re-start the Hot Folder in Bridge!"); return; } var hotFolder = Folder($.getenv('HotFolder')); //create a couple of folders if they do not exist var ProcessedFolder = Folder(hotFolder +"/Processed"); if(!ProcessedFolder.exists) ProcessedFolder.create(); var OriginalsFolder = Folder(hotFolder +"/Originals"); if(!OriginalsFolder.exists) OriginalsFolder.create(); //get a list of files in the hot folder var fileList = hotFolder.getFiles(/\.(jpg|tif|psd|cr2,nef)$/i); //This is where all the work is done for(var z in fileList){ //Add your own code to suit your needs //Example code .... //open each file open(fileList[z]); var Name = decodeURI(app.activeDocument.name).replace(/\.[^\.]+$/, ''); //run an action ? //app.doAction('atn name', 'atnSet name'); //resize FitImage( 1024, 600 ); //save processed file var saveFile = File(ProcessedFolder +"/" + Name + ".psd"); SavePSD(saveFile); //close file app.activeDocument.close(SaveOptions.DONOTSAVECHANGES); //move file to Originals folder fileList[z].rename(File(OriginalsFolder + "/" + fileList[z].name)); } } function SavePSD(saveFile){ psdSaveOptions = new PhotoshopSaveOptions(); psdSaveOptions.embedColorProfile = true; psdSaveOptions.alphaChannels = true; psdSaveOptions.layers = true; activeDocument.saveAs(saveFile, psdSaveOptions, true, Extension.LOWERCASE); } function FitImage( inWidth, inHeight ) { if ( inWidth == undefined || inHeight == undefined ) { alert( "FitImage requires both Width & Height!"); return; } var desc = new ActionDescriptor(); var unitPixels = charIDToTypeID( '#Pxl' ); desc.putUnitDouble( charIDToTypeID( 'Wdth' ), unitPixels, inWidth ); desc.putUnitDouble( charIDToTypeID( 'Hght' ), unitPixels, inHeight ); var runtimeEventID = stringIDToTypeID( "3caa3434-cb67-11d1-bc43-0060b0a13dc4" ); executeAction( runtimeEventID, desc, DialogModes.NO ); }

My goal is to replace Adobe Bridge with Deadline so I can manage the queue and use multiple hosts.

The flow would be:

  1. Deadline picks up pdf files from watch folder and adds them to queue
  2. Deadline checks hosts if Photoshop is Idle (possible?)
  3. Deadline sends file to Photoshop on client
  4. Photoshop executes its script until idle
  5. Deadline flags file as done

For progress indicators I could add some code in the Photoshop script that Deadline could interpret.

It’s the first time I am building some flow in Deadline so any direction would be great!

Thx!

Kind regards,
Danny

Well, the key here is that Deadline should start Photoshop either way. It’s fundamental with how the system works, though you can break that from time to time. The usual expectation is:

  1. Start application X, pass it arguments if any
  2. Tap into application X using API calls
  3. Watch standard output streams or stream text ourselves
  4. Wait for app to close, or close it ourselves.

Now, to address your pipeline there are some challenges!

Deadline picks up pdf files from watch folder and adds them to queue
Deadline doesn’t natively support the concept of a watch folder. One of the support guys on my team wrote one for Draft jobs though. You can find that here and use it as a base:
github.com/ThinkboxSoftware/Dea … atchfolder

Deadline checks hosts if Photoshop is Idle (possible?)
It probably makes more sense for Deadline to start up a fresh copy. I don’t expect PS takes that much RAM these days so I’m hoping this idea is doable, but I never really graduated past version 7. :smiley:

I think we have some example somewhere of how to start a script through Photoshop, but I’ll have to ask around.

Deadline sends file to Photoshop on client

The usual expectation is that the assets Deadline is going to process are available on some file server that can be accessed from all of the machines that will take part in that processing. It’s possible to copy all assets into the Repository, and they will be synced to the machines that will render but only one application currently does that for local rendering (3DS Max). The rest of the asset syncing is usually for cloud rendering and is usually just pushing those up into S3.

Deadline flags file as done

That’s open to interpretation I suppose. I think what Justin B did with the Draft watch folder was to just remember which files had been handled, but it may make more sense to move them somewhere else like an out box. It’s been a long time since I dabbled with Adobe’s watch folder stuff, so I’m not sure how they handle that.

Interesting thoughts anyway. Something to shift thinking again, can we just run Adobe Bridge via Deadline and have it do everything? You could make a plugin where the processes it starts never end, similar to what we do with V-Ray Swarm / and V-Ray distributed rendering.

Privacy | Site terms | Cookie preferences